localhost : ERROR: ssh: connect to host localhost port 22: Address not available

-3

Newbie to docker, trying to set up Hadoop container for which I first create ssh-server container for easy debug as my first container is working fine am able to login

ssh localhost

within the container without any password.

ssh-container: https://github.com/nitesh-kumar-sharma/hands-dirty-docker/blob/master/hadoop/Dockerfile

docker build -t ssh-local .
docker run -d ssh-local

build success !!.

Hadoop-container: https://github.com/nitesh-kumar-sharma/hands-dirty-docker/blob/master/ssh/Dockerfile

when I run my second Hadoop container it says

ERROR: ssh: connect to host localhost port 22: Address not available

Please find all the relevant files in the repository itself. https://github.com/nitesh-kumar-sharma/hands-dirty-docker/blob/master/

Hadoop container logs :

This script is Deprecated. Instead use start-dfs.sh and start-yarn.sh
Starting namenodes on [localhost]
localhost: ssh: connect to host localhost port 22: Address not available
localhost: ssh: connect to host localhost port 22: Address not available
Starting secondary namenodes [0.0.0.0]
0.0.0.0: ssh: connect to host 0.0.0.0 port 22: Connection refused
starting yarn daemons
BusyBox v1.29.3 (2019-01-24 07:45:07 UTC) multi-call binary.

Usage: chown [-RhLHPcvf]... USER[:[GRP]] FILE...

Change the owner and/or group of each FILE to USER and/or GRP

        -R      Recurse
        -h      Affect symlinks instead of symlink targets
        -L      Traverse all symlinks to directories
        -H      Traverse symlinks on command line only
        -P      Don't traverse symlinks (default)
        -c      List changed files
        -v      List all files
        -f      Hide errors
starting resourcemanager, logging to /usr/local/hadoop/logs/yarn--resourcemanager-40777cdc0820.out
localhost: ssh: connect to host localhost port 22: Address not available

Nitesh Sharma

Posted 2020-01-23T18:24:47.777

Reputation: 1

Does it work if the second instance has a different port number? – Burgi – 2020-02-14T09:27:18.980

Answers

0

Actually, when docker trying to run this docker file it was not opening SSL port so I was facing the issue but I was confused because I already added to run command in ENTRYPOINT.

so runaround i added small script in bootstrap.sh to check whether ssl is not up then first up the service and then try to start hadoop services.

# Run ssh on logging, only if not running yet
ACTIVE=$(pgrep -f /usr/sbin/sshd)
if [ ! "$ACTIVE" ]; then
    echo "starting sshd....";

    echo "successfully started PID = $(pgrep -f /usr/sbin/sshd)";
else
    echo "ssh service already started PID=$ACTIVE"
fi

Nitesh Sharma

Posted 2020-01-23T18:24:47.777

Reputation: 1