Home Forums Hortonworks Sandbox Mapreduce Internet Access

This topic contains 8 replies, has 2 voices, and was last updated by  tedr 1 year, 2 months ago.

  • Creator
    Topic
  • #27544

    Grover89
    Member

    Hi,

    I am trying to run a mapreduce job running on the hortonworks sandbox within which the following code is executed, in order to parse the text from a website. However an exception is being thrown when it tries to open the connection. Is internet access possible from the sandbox?

    Thanks and regards

    Gareth

    URL ipToLocation = new URL(“URL Required”);
    URLConnection ic = ipToLocation.openConnection();
    BufferedReader in = new BufferedReader(new InputStreamReader( ic.getInputStream()));

Viewing 8 replies - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.

  • Author
    Replies
  • #28044

    tedr
    Moderator

    Hi Gareth,

    A quick search of the internet reveals that for DHCP on VMware you don’t have to do anything the virtual network connections are set up with DHCP automatically. So I will have to dig to find out why you are not getting out to the internet from your vm. Do you have other vms that can reach the internet? Also we could go another way here, you could download the latest version of Sandbox which has not been reported to have that problem.

    Thanks,
    Ted.

    Collapse
    #27970

    Grover89
    Member

    Hi Ted,

    I am using VMWare player, however as far as i can tell it does not have any tools to set up DHCP. 192.168.226.129.

    Thanks

    Collapse
    #27965

    tedr
    Moderator

    Hi Gareth,

    What virtualization program are you using VMware, VirtualBox or …?
    Do you have DHCP set up on the Host Only network?
    What is the IP address reported for you to connect your browser to?

    Thanks,
    Ted.

    Collapse
    #27926

    Grover89
    Member

    Hi Ted,

    Sorry for the delay, my sandbox version is “Hortonworks Sandbox 1.2″ i tried switching the interfaces (first Host and Second NAT) and it still didnt work unfortunately . This is the full stack trace:

    Stack Trace java.net.UnknownHostException:-freegeoip.net
    at-java.net.PlainSocketImpl.connect(PlainSocketImpl.java:195)
    at-java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at-java.net.Socket.connect(Socket.java:529)
    at-java.net.Socket.connect(Socket.java:478)
    at-sun.net.NetworkClient.doConnect(NetworkClient.java:163)
    at-sun.net.www.http.HttpClient.openServer(HttpClient.java:395)
    at-sun.net.www.http.HttpClient.openServer(HttpClient.java:530)
    at-sun.net.www.http.HttpClient.(HttpClient.java:234)
    at-sun.net.www.http.HttpClient.New(HttpClient.java:307)
    at-sun.net.www.http.HttpClient.New(HttpClient.java:324)
    at-sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:970)
    at-sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:911)
    at-sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:836)
    at-sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1172)
    at-Map.ProcessIp(Map.java:158)
    at-Map.map(Map.java:85)
    at-Map.map(Map.java:1)
    at-org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:50)
    at-org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:436)
    at-org.apache.hadoop.mapred.MapTask.run(MapTask.java:372)
    at-org.apache.hadoop.mapred.Child$4.run(Child.java:255)
    at-java.security.AccessController.doPrivileged(Native-Method)
    at-javax.security.auth.Subject.doAs(Subject.java:396)
    at-org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1136)
    at-org.apache.hadoop.mapred.Child.main(Child.java:249)

    Collapse
    #27646

    tedr
    Moderator

    Hi Gareth,

    Which version of the Sandbox are you using? If you are using the latest based on hdp1.3 the network interface should be configured to use NAT. If you are using the version that has Bombardier in it’s name then the first of the interfaces needs to be set to NAT and the other to ‘Host Only’. If that doesn’t work try switching them.

    Thanks,
    Ted.

    Collapse
    #27591

    Grover89
    Member

    Trying to ping any site from the console on vmware also returns an unknown host. Does someone know how to setup the network adapter to still allow the sandbox to load while allowing internet access?

    Regards

    Gareth

    Collapse
    #27556

    Grover89
    Member

    Hi Ted

    Thanks for your reply. I am getting the exception “java.net.UnknownHostException” the same code running from the IDE is working fine however.

    Regards

    Gareth

    Collapse
    #27545

    tedr
    Moderator

    Hi Gareth,

    What is the exception that is thrown. The internet should be accesible from the sandbox.

    Thanks,
    Ted.

    Collapse
Viewing 8 replies - 1 through 8 (of 8 total)