Support Questions

Find answers, ask questions, and share your expertise

adding sandbox.hortonworks.com to /etc/hosts does not seem to make a difference and that seems to be a problem for Banana

avatar
New Contributor

Hello. I have been going through the Analyzing Twitter Data With Apache NiFi and HDP Search tutorial using Sandbox VM I downloaded a couple of weeks ago.

I did run 'echo 127.0.0.1 sandbox.hortonworks.com >> /etc/hosts' (I am assuming the partial quotation marks in 'echo "127.0.0.1 sandbox.hortonworks.com >> /etc/hosts' in the instructions are a typo), and my /etc/hosts file now looks like this:

127.0.0.1 localhost.localdomain localhost 10.0.2.15 sandbox.hortonworks.com sandbox ambari.hortonworks.com 127.0.0.1 sandbox.hortonworks.com

However, the following links never work:

http://sandbox.hortonworks.com:4200 http://sandbox.hortonworks.com:9090/nifi http://sandbox.hortonworks.com:8983/solr/

So, I replace 'http://sandbox.hortonworks.com' with '127.0.0.1' and NiFi and Solr seem to work fine, based on my limited understanding. However, when I get to starting Banana, and, go to '127.0.0.1:8983/solr/banana/index.html' (I am assuming that leaving out 'index.html' from 'http://sandbox.hortonworks.com:8983/solr/banana/' in the instructions is just an oversight, since without it we just see contents of the directory), I do get the basic Banana dashboard layout with black/gray background and buttons and rows and headers, but no data. I get the following two errors:

'Error Could not contact Solr at http://sandbox.hortonworks.com:8983/solr/. Please ensure that Solr is reachable from your system.' 'Error Could not retrieve collections from Solr (error status = 0)'

I thought, perhaps, if I replaced 'http://sandbox.hortonworks.com' with '127.0.0.1' in the 'default.json' file I downloaded from github earlier in the tutorial that might fix the problem, but Banana still saw no data, even though the error messages have changed slightly:

'Error Collection not found at 127.0.0.1:8983/solr/tweets. Please check your configuration or create the collection. If you are using a proxy ensure it is configured correctly.' 'Error Could not retrieve collections from Solr (error status = 404)'

The 'tweets' collection DOES exist, from what I can tell. If I enter the command we are given to create it, I am told it already exists. I can delete it and create it again, but that does not seem to make a difference for Banana.

Why does adding 'sandbox.hortonworks.com' to /etc/hosts not seem to work for me, does that mess anything else up besides Banana that I perhaps do not realize, and is there a workaround?

Many thanks!

1 ACCEPTED SOLUTION

avatar
Expert Contributor

This may not have been specified but you should add "sandbox.hortonworks.com" to your HOST machine. This is not the sandbox. It is the machine which you have installed virtualbox/vmware on

On a windows machine you'll find your hosts file at

%systemroot%\system32\drivers\etc\hosts

If you are using *nix system or Mac OS X it is simply

/etc/hosts

After editing the correct file on the host machine it should work

View solution in original post

11 REPLIES 11

avatar
Master Mentor

@Gerda 39

Make sure that you setup /etc/hosts entries in sandbox and your local laptop to make this work

Don't point to 10.0.2.15

Keep it to 127.0.0.1

avatar
Master Mentor

@Gerda 39

thats in my mac ..

127.0.0.1 localhost.localdomain localhost sadbox.hortonworks.com

#10.0.2.15 sandbox.hortonworks.com sandbox ambari.hortonworks.com

#127.0.0.1sandbox.hortonworks.com sanbox

avatar
Expert Contributor

This may not have been specified but you should add "sandbox.hortonworks.com" to your HOST machine. This is not the sandbox. It is the machine which you have installed virtualbox/vmware on

On a windows machine you'll find your hosts file at

%systemroot%\system32\drivers\etc\hosts

If you are using *nix system or Mac OS X it is simply

/etc/hosts

After editing the correct file on the host machine it should work

avatar
Expert Contributor

I also want to note that we will soon have a guide for common sandbox issues like this. Keep an eye out for it.

avatar
New Contributor

Thanks, Zac! That was it. My host machine is Windows and because the command in the instructions mentioned /etc/hosts specifically, I assumed they referred to the VM, which is Linux. All better now, and looking forward to the Sandbox specific troubleshooting guide!

avatar

@zblanco

I add '127.0.0.1 sandbox.hortonworks.com' to the Host machine hosts file, however I still get dns error when I entered something like 'http://sandbox.hortonworks.com:8888/' in my browser. (I also restarted my browser and machine, the the problem still exists). I can ping 'sandbox.hortonworks.com' and it redirects my ping to 127.0.0.1. But do you know why dns is looked up when I use the domain name in browser or in a webhdfs connection to sandbox?

avatar
Expert Contributor

@Koosha Tahmasebipour That's interesting. Do you have custom DNS settings on your computer? Have you tried disabling your firewall?

Also I would make sure that the settings on your VirtualBox/Vmware box have not changed.

Make sure the network adapter is 'NAT'. Have you been able to access ambari?

Also here is a tutorial about the Sandbox: http://hortonworks.com/hadoop-tutorial/learning-the-ropes-of-the-hortonworks-sandbox/

avatar

Thanks for your comment. I just solved the problem after 2 days of struggling. There reason was the proxy settings set on my machine by the company I work for. I just added 'sandbox.hortonworks.com' domain name to the proxy bypass list. Also, in order to make webhdfs connection to sandbox from another CentOS VM I added 'sandbox.hortonworks.com' to no_proxy variable at /etc/bashrc of the CentOS and it worked! Thanks 🙂

avatar

You may be running old version of dashboard which hard coded sandbox.hortonworks.com in one of the configs. Run below to update the dashboard to get the new one which doesn't care about this:

cd /opt/lucidworks-hdpsearch/solr/server/solr-webapp/webapp/banana/app/dashboards/
mv default.json default.json.orig
wget https://raw.githubusercontent.com/abajwa-hw/ambari-nifi-service/master/demofiles/default.json