Support Questions

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

How to add port forwarding in HDP Sandbox 2.6.5?

avatar

Hello community!

I have a problem with the last version of the HDP Sandbox (2.6.5), I know about this article explaining the new architecture but I still don't understand how I can add new ports. Could someone please explain in simple steps how to do this?

I would like to add the MySQL port.

Any help would be appreciated!

1 ACCEPTED SOLUTION

avatar

I asked the same question on Github and they answered me, this was what worked for me.

Read the vineshcpaul's answer.

I copy it here:

If you have HDP 2.6.5 VM deployed, there should be a file name generate-proxy-deploy-script.sh under /sandbox/deploy-scripts/assets. Please try editing the script to add a port that you want to forward. There are 2 arrays defined in the script, one is called tcpPortsHDP, add a new entry in the following format considering port 23232 as the one you need to forward.
[23232]=23232.
Once the change is made, rerun the script
cd /sandbox/deploy-scripts
assets/generate-proxy-deploy-script.sh

This generate as new script proxy-deploy.sh under /sandbox/deploy-scripts/sandbox/proxy/proxy-deploy.sh

execute proxy-deploy.sh to get the new reverse proxy deployed.
cd /sandbox/deploy-scripts
sandbox/proxy/proxy-deploy.sh
Also, the port needs to be forwarded on the virtualbox as well .
VirtualBox -> settings -> network -> Advanced -> port forwarding -> add new port forwarding rule

View solution in original post

6 REPLIES 6

avatar
Master Mentor

@Krystle Salazar

There is no better resource than this HW KB document on port forwarding HDP 2.5 VirtualBox Sandbox

If that helped please accept the answer to close the thread Happy HDP'ing

HTH

avatar

Hello @Geoffrey Shelton Okot sorry for my late response, but that tutorial doesn't work anymore for version 2.6.5 of the sandbox.

Just trying to execute the first command already gives error.

92773-captura.png

And the ´start_scripts´ is not found in the ´/root' directory. I know that that tutorial works well until version 2.6.4, however this is not the case why I ask.

So again, is there a way to add ports forwarding in the new version?

avatar

I asked the same question on Github and they answered me, this was what worked for me.

Read the vineshcpaul's answer.

I copy it here:

If you have HDP 2.6.5 VM deployed, there should be a file name generate-proxy-deploy-script.sh under /sandbox/deploy-scripts/assets. Please try editing the script to add a port that you want to forward. There are 2 arrays defined in the script, one is called tcpPortsHDP, add a new entry in the following format considering port 23232 as the one you need to forward.
[23232]=23232.
Once the change is made, rerun the script
cd /sandbox/deploy-scripts
assets/generate-proxy-deploy-script.sh

This generate as new script proxy-deploy.sh under /sandbox/deploy-scripts/sandbox/proxy/proxy-deploy.sh

execute proxy-deploy.sh to get the new reverse proxy deployed.
cd /sandbox/deploy-scripts
sandbox/proxy/proxy-deploy.sh
Also, the port needs to be forwarded on the virtualbox as well .
VirtualBox -> settings -> network -> Advanced -> port forwarding -> add new port forwarding rule

avatar
New Contributor

Dear Krystle,

Please take a look. I tried your approach. The proxy-deploy is generated at a different path.

93516-test.png

,

Dear Krystle,

What did I do wrong? You connect to port 22 ...righT?

I ran this file "/sandbox/deploy-scripts/assets/generate-proxy-deploy-script.sh" from the root directory "/". Like this "bash /sandbox/deploy-scripts/assets/generate-proxy-deploy-script.sh"

This file is genereated at different path "proxy-deploy.sh"

93515-test.png

avatar
New Contributor

- Run virtual machine
ssh -p 2122 root@localhost
-u root
-p hadoop

- vi /sandbox/proxy/generate-proxy-deploy-script.sh

Please try editing the script to add a port that you want to forward.
There are 2 arrays defined in the script, one is called tcpPortsHDP,
add a new entry in the following format considering port 9200 as the one you need to forward.
[9200]=9200. (Example to use Elasticsearch in HDP Sandbox 2.6.5)

- Save the file and rerun the script. This script generate new file 'proxy-deploy.sh' which is in the same directory
(/sandbox/proxy/) and Run the script 'proxy-deploy.sh'

- Check that port is already opened: run 'docker ps'. In the middle of all ports opened in the proxy towards the
VM you will see your last ports configured. That's fine.

- Reboot the system

- VirtualBox -> settings -> network -> Advanced -> port forwarding -> add new port forwarding rule using 0.0.0.0 IP address
(maybe you will have to allow access in the firewall on the host machine (in my case window)

Enjoy, your address is available for it access on your host machine explorer!!!

- In my case, for Elasticsearch, was necessary add to /etc/elasticsearch/elasticsearch.yml add the following code:

network.bind_host: 0.0.0.0 (THAT IS THE THEY TO ALLOW IT WORKING GOOD!!)
transport.host: localhost

node.master: true
node.data: true
transport.tcp.port: 9300

avatar
New Contributor

I tried this in HDP3.0.1 everything at first seems ok and all services are started but then I found that I cannot start spark-shell, the error prompted that port 4040 cannot be bind. Seems I broke the proxy setting when modifying the file. Really would like to have some hints to go further...