A wireless sensor network (WSN) is an essential element of industrial internet of things (IIoT). However, it is prone to failures owing to the harsh conditions offered by IIoT. Furthermore, most of the applications of IIoT have real-time requirements. Thus, this paper proposes a novel faulty-node-detection scheme for IIoT that leverages edge computing and deep reinforcement learning (DRL); edge computing is used to reduce the processing time and network latency by performing a DRL task. Moreover, DRL improves the faulty-node-detection accuracy. The simulation results indicate that the reliability of the proposed scheme is higher than those of the traditional schemes.