Hortonworks Sandbox Forum

Mapreduce Internet Access

  • #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()));

to create new topics or reply. | New User Registration

  • Author
    Replies
  • #27545
    tedr
    Moderator

    Hi Gareth,

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

    Thanks,
    Ted.

    #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

    #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

    #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.

    #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)

    #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.

    #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

    #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.

You must be to reply to this topic. | Create Account

Support from the Experts

A HDP Support Subscription connects you experts with deep experience running Apache Hadoop in production, at-scale on the most demanding workloads.

Enterprise Support »

Become HDP Certified

Real world training designed by the core architects of Hadoop. Scenario-based training courses are available in-classroom or online from anywhere in the world

Training »

Hortonworks Data Platform
The Hortonworks Data Platform is a 100% open source distribution of Apache Hadoop that is truly enterprise grade having been built, tested and hardened with enterprise rigor.
Get started with Sandbox
Hortonworks Sandbox is a self-contained virtual machine with Apache Hadoop pre-configured alongside a set of hands-on, step-by-step Hadoop tutorials.
Modern Data Architecture
Tackle the challenges of big data. Hadoop integrates with existing EDW, RDBMS and MPP systems to deliver lower cost, higher capacity infrastructure.