Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Change ip address of sandbox to static?

avatar
Expert Contributor

Hi, is it possible to change the ip address of the sandbox? I have two addresses 172.17.0.1 which i can change to static, but the actual sandbox address stays at 172.17.0.2, this is accessed using ssh into port 2222. can this be changed to static?

Thanks

1 ACCEPTED SOLUTION

avatar
Super Guru

@Roger Young

Ah, I see what you are trying to do. Ambari agents use port 8440 to communicate with the server (https://docs.hortonworks.com/HDPDocuments/Ambari-2.2.2.0/bk_ambari_reference_guide/content/_default_...). The docker container does not expose port 8440.

If you want to add that port, you can follow my tutorial for using the native Docker HDP sandbox to easily add ports to your containers before you create them (https://community.hortonworks.com/content/kbentry/58458/installing-docker-version-of-sandbox-on-mac....). Look at step four in the process.

Unfortunately the process is a bit more difficult when using the VirtualBox + Docker version of the sandbox. You will need to log into the VirtualBox VM directly using the VBox UI. The username is root and the password is hadoop.

The startup script for the Docker sandbox is located here:

/root/start_scripts/start_sandbox.sh

Edit that file and add

-p 8440:8440 \

At this point you need to delete the existing sandbox container. However that seems to hang for me. So there are extra steps you need to do.

1. Disable the sandbox service

systemctl disable sandbox.service

2. Reboot the VM and log back in via the VBox UI.

init 6

3. Delete the sandbox container

docker rm sandbox

4. Enable the sandbox service

systemctl enable sandbox.service

5. Reboot the VM and log back in via the VBox UI.

init 6

6. Verify the sandbox service is running

docker ps -a

You should see 0.0.0.0:8440->8440/tcp in the list of ports

7. Update the VirtualBox forwarded ports for the VM to include 8440.

View solution in original post

9 REPLIES 9

avatar
Super Guru
@Roger Young

Yes. its possible

Just change the Network settings from NAT to "Host-Only Adapter" as shown in screenshot.

network.png

Once done login to the VM and set BOOTPROTO to static.

$ vi /etc/sysconfig/network-scripts/ifcfg-eth0

BOOTPROTO="dhcp" ==> [set this to "static"]

and restart network service

avatar
Expert Contributor

Hi @Sagar Shimpi, thanks for the reply. i have since edited my question. i can change the docker container address to static but the actual sandbox address stays the same which causes problems with ports etc when trying to add nodes. When i ssh into th sandbox via port 2222 and try to edit the ifcfg-eth0 file, it gives errors.

avatar
Super Guru

@Roger Young

The HDP 2.5 sandboxes are now all based on Docker containers. When you ssh into the sandbox via port 2222, you are connecting to the VirtualBox VM which is then forwarding your request to the Docker container.

avatar
Expert Contributor

Thanks, so if i use port 2222 all the time i should be fine? Previously i was doing all commands through port 22 and was getting errors . Is it still possible to connect nodes to the sandbox through the docker container.

avatar
Super Guru

@Roger Young

Yes the Docker container is accessible via the IP address where VirtualBox is running. My laptop is currently 192.168.1.162. From any computer on the network I can access Ambari on my laptop via http://192.168.1.162:8080. This is because VirtualBox has port 8080 forwarding from my laptop to the VirtualBox VM. The VM is running a Docker container that forwards port 8080 on the VM to the Docker container.

I hope this helps. If it does, please accept an answer as it helps the community find solutions to questions.

avatar
Expert Contributor

Hi, i can also access my ambari-server via 8080.. but when i want to add hosts to the sandbox, they will not register as the agents cannot connect to the server. if i try to ping from an agent node to the sandbox (172.17.0.2) it wont ping either, but i can ping to the docker (172.17.01).

Failed to connect to https://sandbox.hortonworks.com:8440/ca due to [Errno 111] Connection refused  
WARNING 2016-11-10 16:04:57,138 NetUtil.py:116 - Server at https://sandbox.hortonworks.com:8440 is not reachable, sleeping for 10 seconds...

avatar
Super Guru

@Roger Young

Ah, I see what you are trying to do. Ambari agents use port 8440 to communicate with the server (https://docs.hortonworks.com/HDPDocuments/Ambari-2.2.2.0/bk_ambari_reference_guide/content/_default_...). The docker container does not expose port 8440.

If you want to add that port, you can follow my tutorial for using the native Docker HDP sandbox to easily add ports to your containers before you create them (https://community.hortonworks.com/content/kbentry/58458/installing-docker-version-of-sandbox-on-mac....). Look at step four in the process.

Unfortunately the process is a bit more difficult when using the VirtualBox + Docker version of the sandbox. You will need to log into the VirtualBox VM directly using the VBox UI. The username is root and the password is hadoop.

The startup script for the Docker sandbox is located here:

/root/start_scripts/start_sandbox.sh

Edit that file and add

-p 8440:8440 \

At this point you need to delete the existing sandbox container. However that seems to hang for me. So there are extra steps you need to do.

1. Disable the sandbox service

systemctl disable sandbox.service

2. Reboot the VM and log back in via the VBox UI.

init 6

3. Delete the sandbox container

docker rm sandbox

4. Enable the sandbox service

systemctl enable sandbox.service

5. Reboot the VM and log back in via the VBox UI.

init 6

6. Verify the sandbox service is running

docker ps -a

You should see 0.0.0.0:8440->8440/tcp in the list of ports

7. Update the VirtualBox forwarded ports for the VM to include 8440.

avatar
Expert Contributor

@Michael Young thank you for your time, thats what i needed to know. I can work on that tutorial now

avatar
New Contributor

And what this fails to mention is that deleting the container deletes any customization, such as any NiFi installation or anything else custom you've worked on. Need to setup port forwarding first. Found that out the hard way.