In some circumstances, you need to start or stop a datanode without touching other nodes or whole hadoop cluster, how to do it?

Here is it

To stop

You can stop the DataNodes and TaskTrackers from NameNode's hadoop bin directory. If you have hadoop environment variables setup, then just run:

$ hadoop-daemon.sh stop tasktracker 
$ hadoop-daemon.sh stop datanode

So this script checks for slaves file in conf directory of hadoop to stop the DataNodes and same with the TaskTracker.

To start

Again this script checks for slaves file in conf directory of hadoop to start the DataNodes and TaskTrackers.

$ hadoop-daemon.sh start tasktracker
$ hadoop-daemon.sh start datanode