Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

Connection refused -- 2.6

Explorer

Following the tutorials, installed Docker, installed Sandbox, troubleshooted for hours and finally got Ambari up and working. Came back 2 weeks later to do the Atlas tutorials, and can't connect. In OSX terminal, I an starting with command ssh root@127.0.0.1 -p 8080;. I am getting a Connection refused error. Did I miss some simple step? Thanks in advance.

1 ACCEPTED SOLUTION

Mentor

@L Hurley

Great to hear it worked for you 🙂 Now you ought to reward the best answer so members can promptly help other members to resolve issues instantly @HCC

Have a great weekend

View solution in original post

23 REPLIES 23

Guru

Hi @L Hurley

Can you try the ssh command again but use port 2222 ? 8080 is usually the default web port for the Ambari UI.

Explorer

I got a scary security message when I did that. What is going on? screen-shot-2017-08-21-at-43029-pm.png

Explorer

Which is weird because looking back through terminal, I did try 2222 originally.

Guru

Looks like the key has changed. On your local system, go into .ssh/known_hosts and just delete any lines related to the sandbox. Then try the ssh again on -p 2222 and you'll be prompted to re-accept the key and should be good to go.

Explorer

Thank you for your patience and your assistance. Here is what .ssh/known_hosts looks like. I don't know what to make of it. screen-shot-2017-08-21-at-81523-pm.png

Guru

hi @L Hurley

what you want to do is open the known_hosts file in a text editor and delete any lines that correspond with the IP address of the sandbox, which in your case is 127.0.0.1 and then try it again

Explorer

I did the image reinstalled and did do as you said deleting the info from known_hosts. Now I get the original connection refused error:

[root@sandbox ~]# ssh root@127.0.0.1 -p 2222

ssh: connect to host 127.0.0.1 port 2222: Connection refused

Guru

Hi @L Hurley

From the snippet you pasted, you are already logged in! You are logged into the sandbox as root, so ssh'ing in a second time would surley result in an error. root@sandbox

Explorer

But, I get an error at the URL. I'm not able to get to Ambari and move on with the darn tutorials. Error:

This page isn’t working

127.0.0.1 didn’t send any data.

ERR_EMPTY_RESPONSE

Super Mentor

@L Hurley

Can you please try the following to see if it works:

1. SSH on port 2222 to Sandbox. The default password will be "hadoop". If you face any error/exception while doing the ssh as following then please paste the output/error.

# ssh root@127.0.0.1 -p 2222

2. Please chekc if you are able to access the web terminal?

http://127.0.0.1:4200

3. Many times it happens that during the Sandbox startup some services are not started properly that causes ports not getting opened properly. So please try restarting the Sandbox image (Power off and power on) then again try the step 1 & 2 as mentioned above.

.

Explorer

It seems I have this problem solved now, but so that I learn more -- how do you safely power down the sandbox? and then to power up, I just do "docker start sandbox" and then ssh in on port 2222? I have tried so many things that I want to walk away with this clarified. So, 1) how to power down and 2) and I correct in how to power up? Thanks!

Explorer

Sometimes your docker instance may not be running.

To check if sandbox is running:

 docker ps -a

If not running, then try to start sandbox with docker command

docker start sandbox

Explorer

@Ramesh Prasad @Jay SenSharma @Sonu Sahi Thanks for your help. Looks @like my image is gone. No clue how that happened 😞 Trying to download again, but it keeps canceling. I imagine it will be problematic to try to install it now since it was installed previously? Argh.

Explorer

I added comments above. I have reinstalled the image. I think I deleted it from my downloads at some point, because I thought if it was loaded into Docker, it was loaded into Docker. Can you confirm this is true or not -- that I need to keep the tar file on my laptop? Because now that I have downloaded it again and reinstalled, I'm still getting the connection error. Also, when you say start and stop the image, do you just mean command line "docker start sandbox" and how to stop? I'm a newbie -- thanks for all your help!!

Explorer

I tried running the script again, per the Sandbox Deployment and Install guide, and it looks like the container is still not running:

Loris-MacBook-Pro:Desktop lorihurley$ docker start sandbox

sandbox

Loris-MacBook-Pro:Desktop lorihurley$ sh start_sandbox-hdp2.sh

Waiting for docker daemon to start up:

ba112ddd357esandbox-hdp "/usr/sbin/sshd -D" 2 weeks ago Exited (255) 2 weeks agosandbox-hdp

Error response from daemon: driver failed programming external connectivity on endpoint sandbox-hdp (c4f0630e5c909893ef7fee6ea8f4d8644238a9dd4a38b3da3168c8d0880f786f): Bind for 0.0.0.0:60080 failed: port is already allocated

Error: failed to start containers: sandbox-hdp

Error response from daemon: Container ba112ddd357e3a08eb7fe253d5d8a8749c34970d25fe312635c04693d8a1147f is not running

Error response from daemon: Container ba112ddd357e3a08eb7fe253d5d8a8749c34970d25fe312635c04693d8a1147f is not running

Error response from daemon: Container ba112ddd357e3a08eb7fe253d5d8a8749c34970d25fe312635c04693d8a1147f is not running

Error response from daemon: Container ba112ddd357e3a08eb7fe253d5d8a8749c34970d25fe312635c04693d8a1147f is not running

Error response from daemon: Container ba112ddd357e3a08eb7fe253d5d8a8749c34970d25fe312635c04693d8a1147f is not running

Error response from daemon: Container ba112ddd357e3a08eb7fe253d5d8a8749c34970d25fe312635c04693d8a1147f is not running

Error response from daemon: Container ba112ddd357e3a08eb7fe253d5d8a8749c34970d25fe312635c04693d8a1147f is not running

Waiting for ambari agent to connect

Error response from daemon: Container ba112ddd357e3a08eb7fe253d5d8a8749c34970d25fe312635c04693d8a1147f is not running

Waiting for ambari services to start

Error response from daemon: Container ba112ddd357e3a08eb7fe253d5d8a8749c34970d25fe312635c04693d8a1147f is not running

Error response from daemon: Container ba112ddd357e3a08eb7fe253d5d8a8749c34970d25fe312635c04693d8a1147f is not running

Error response from daemon: Container ba112ddd357e3a08eb7fe253d5d8a8749c34970d25fe312635c04693d8a1147f is not running

Error response from daemon: Container ba112ddd357e3a08eb7fe253d5d8a8749c34970d25fe312635c04693d8a1147f is not running

Error response from daemon: Container ba112ddd357e3a08eb7fe253d5d8a8749c34970d25fe312635c04693d8a1147f is not running

Error response from daemon: Container ba112ddd357e3a08eb7fe253d5d8a8749c34970d25fe312635c04693d8a1147f is not running

Error response from daemon: Container ba112ddd357e3a08eb7fe253d5d8a8749c34970d25fe312635c04693d8a1147f is not running

Error response from daemon: Container ba112ddd357e3a08eb7fe253d5d8a8749c34970d25fe312635c04693d8a1147f is not running

Error response from daemon: Container ba112ddd357e3a08eb7fe253d5d8a8749c34970d25fe312635c04693d8a1147f is not running

Error response from daemon: Container ba112ddd357e3a08eb7fe253d5d8a8749c34970d25fe312635c04693d8a1147f is not running

Loris-MacBook-Pro:Desktop lorihurley$

Super Mentor

@L Hurley

From the output it looks like you are already inside the "sandbox" ssh session. As we see prompt as "[root@sandbox ~]"

[root@sandbox ~]# ssh root@127.0.0.1 -p 2222
ssh: connect to host 127.0.0.1 port 2222: Connection refused

.

So once you are already inside the Sandbox ssh session then you do not need to reconnect it to port 2222.

Is there any specific reason you want to do that?

- You can also use the Web Terminal Login to your sandnox using the following URL on your browser

http://127.0.0.1:4200 

.

sandbox login: root                                                                                                                                                   
root@sandbox.hortonworks.com's password: hadoop                                                                                                               

Explorer

When I go to the URL I get error:

This page isn’t working

127.0.0.1 didn’t send any data.

ERR_EMPTY_RESPONSE

Guru

hi @L Hurley

Are you specifying the port?

http://127.0.0.1:8080/

When you are logged in as root@sandbox, try also running: ambari-server status and ensure its running.

Explorer

Looks like it's not:

[root@sandbox ~]# ambari-server status

Using python/usr/bin/python

Ambari-server status

Ambari Server not running. Stale PID File at: /var/run/ambari-server/ambari-server.pid

[root@sandbox ~]#

Mentor

@L Hurley

Can you run

# ifconfig 

Then grab the IP in the output and use it to access Ambari on

 http://IP_OUT:8080/

That should work

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.