Error reported when starting Hadoop in docker: Connection refused

  docker, question

Starting hadoop to Report Error

[root@master hadoop-2.8.2]# ./sbin/start-all.sh
 This script is Deprecated. Instead use start-dfs.sh and start-yarn.sh
 Starting namenodes on [master]
 master: namenode running as process 366. Stop it first.
 slave1: ssh: connect to host slave1 port 22: Connection refused
 slave2: ssh: connect to host slave2 port 22: Connection refused
 slave3: ssh: connect to host slave3 port 22: Connection refused
 localhost: datanode running as process 511. Stop it first.
 Starting secondary namenodes [master]
 master: secondarynamenode running as process 704. Stop it first.
 starting yarn daemons
 resourcemanager running as process 2738. Stop it first.
 slave1: ssh: connect to host slave1 port 22: Connection refused
 slave2: ssh: connect to host slave2 port 22: Connection refused
 slave3: ssh: connect to host slave3 port 22: Connection refused
 localhost: nodemanager running as process 2860. Stop it first.

Error reporting displayslave1: ssh: connect to host slave1 port 22: Connection refused

Docker container is as follows, onemasterThreeslave

[root@Optimus /]# docker ps -a
 CONTAINER ID        IMAGE                   COMMAND                CREATED             STATUS                     PORTS                                                                        NAMES
 4a38c8552b61        hadoop                  "/bin/bash"            22 hours ago        Up 37 minutes                                                                                           slave3
 8366ebfd9949        hadoop                  "/bin/bash"            22 hours ago        Up 37 minutes                                                                                           slave2
 3ef4f68c9cf6        hadoop                  "/bin/bash"            22 hours ago        Up 37 minutes                                                                                           slave1
 758c647970c8        hadoop                  "/bin/bash"            22 hours ago        Up 22 hours                0.0.0.0:8088->8088/tcp, 0.0.0.0:19888->19888/tcp, 0.0.0.0:50070->50070/tcp   master

hostThe documents are as follows

[root@master /]# cat /etc/hosts
 172.17.0.42    master
 172.17.0.46     slave1
 172.17.0.47     slave2
 172.17.0.48     slave3
 127.0.0.1    localhost
 ::1    localhost ip6-localhost ip6-loopback
 fe00::0    ip6-localnet
 ff00::0    ip6-mcastprefix
 ff02::1    ip6-allnodes
 ff02::2    ip6-allrouters

masterAndslaveEither waypingthrough

[root@master /]# ping 172.17.0.46
 PING 172.17.0.46 (172.17.0.46) 56(84) bytes of data.
 64 bytes from 172.17.0.46: icmp_seq=1 ttl=64 time=0.360 ms
 64 bytes from 172.17.0.46: icmp_seq=2 ttl=64 time=0.061 ms
 64 bytes from 172.17.0.46: icmp_seq=3 ttl=64 time=0.061 ms
 ^C
 --- 172.17.0.46 ping statistics ---
 3 packets transmitted, 3 received, 0% packet loss, time 2022ms
 rtt min/avg/max/mdev = 0.061/0.160/0.360/0.141 ms
 [root@master /]# ping 172.17.0.47
 PING 172.17.0.47 (172.17.0.47) 56(84) bytes of data.
 64 bytes from 172.17.0.47: icmp_seq=1 ttl=64 time=0.398 ms
 64 bytes from 172.17.0.47: icmp_seq=2 ttl=64 time=0.061 ms
 ^C
 --- 172.17.0.47 ping statistics ---
 2 packets transmitted, 2 received, 0% packet loss, time 1782ms
 rtt min/avg/max/mdev = 0.061/0.229/0.398/0.169 ms
 [root@master /]# ping 172.17.0.48
 PING 172.17.0.48 (172.17.0.48) 56(84) bytes of data.
 64 bytes from 172.17.0.48: icmp_seq=1 ttl=64 time=0.343 ms
 64 bytes from 172.17.0.48: icmp_seq=2 ttl=64 time=0.055 ms
 ^C
 --- 172.17.0.48 ping statistics ---
 2 packets transmitted, 2 received, 0% packet loss, time 1310ms
 rtt min/avg/max/mdev = 0.055/0.199/0.343/0.144 ms

Firewall status, respectively closedmasterslaveThe firewall of

Turn off master firewall
 [root@master /]# chkconfig iptables off
 
 Shut down the slave1 firewall.
 [root@slave1 /]# chkconfig iptables off
 
 Shut down the slave2 firewall.
 [root@slave2 /]# chkconfig iptables off
 
 Shut down the slave3 firewall.
 [root@slave3 /]# chkconfig iptables off
 
 [root@Optimus /]# service iptables status
 Table: filter
 Chain INPUT (policy ACCEPT)
 num  target     prot opt source               destination
 
 Chain FORWARD (policy ACCEPT)
 num  target     prot opt source               destination
 1    DOCKER     all  --  0.0.0.0/0            0.0.0.0/0
 2    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           ctstate RELATED,ESTABLISHED
 3    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0
 4    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0
 
 Chain OUTPUT (policy ACCEPT)
 num  target     prot opt source               destination
 
 Chain DOCKER (1 references)
 num  target     prot opt source               destination
 1    ACCEPT     tcp  --  0.0.0.0/0            172.17.0.5          tcp dpt:22
 2    ACCEPT     tcp  --  0.0.0.0/0            172.17.0.9          tcp dpt:80
 3    ACCEPT     tcp  --  0.0.0.0/0            172.17.0.15         tcp dpt:3306
 4    ACCEPT     tcp  --  0.0.0.0/0            172.17.0.30         tcp dpt:80
 5    ACCEPT     tcp  --  0.0.0.0/0            172.17.0.42         tcp dpt:50070
 6    ACCEPT     tcp  --  0.0.0.0/0            172.17.0.42         tcp dpt:19888
 7    ACCEPT     tcp  --  0.0.0.0/0            172.17.0.42         tcp dpt:8088
 
 Table: nat
 Chain PREROUTING (policy ACCEPT)
 num  target     prot opt source               destination
 1    DOCKER     all  --  0.0.0.0/0            0.0.0.0/0           ADDRTYPE match dst-type LOCAL
 
 Chain POSTROUTING (policy ACCEPT)
 num  target     prot opt source               destination
 1    MASQUERADE  all  --  172.17.0.0/16        0.0.0.0/0
 2    MASQUERADE  tcp  --  172.17.0.5           172.17.0.5          tcp dpt:22
 3    MASQUERADE  tcp  --  172.17.0.9           172.17.0.9          tcp dpt:80
 4    MASQUERADE  tcp  --  172.17.0.15          172.17.0.15         tcp dpt:3306
 5    MASQUERADE  tcp  --  172.17.0.30          172.17.0.30         tcp dpt:80
 6    MASQUERADE  tcp  --  172.17.0.42          172.17.0.42         tcp dpt:50070
 7    MASQUERADE  tcp  --  172.17.0.42          172.17.0.42         tcp dpt:19888
 8    MASQUERADE  tcp  --  172.17.0.42          172.17.0.42         tcp dpt:8088
 
 Chain OUTPUT (policy ACCEPT)
 num  target     prot opt source               destination
 1    DOCKER     all  --  0.0.0.0/0           !  127.0.0.0/8         ADDRTYPE match dst-type LOCAL
 
 Chain DOCKER (2 references)
 num  target     prot opt source               destination
 1    DNAT       tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:2222 to:172.17.0.5:22
 2    DNAT       tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:8080 to:172.17.0.9:80
 3    DNAT       tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:3307 to:172.17.0.15:3306
 4    DNAT       tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:9090 to:172.17.0.30:80
 5    DNAT       tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:50070 to:172.17.0.42:50070
 6    DNAT       tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:19888 to:172.17.0.42:19888
 7    DNAT       tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:8088 to:172.17.0.42:8088

Error reported: slave1: ssh: connect to hostslave1port22: connectionrefused
The reason is that sshd is not started (or not installed)
Start ssh:service sshd start