Browser (extranet) access to Hadoop in Docker container

Source: Internet
Author: User

Let's say you made a docker image of Hadoop, which is called hd_image, and if you want to access Hadoop's 50070 and 8088 ports in a browser on an external network, when you start mirroring hd_image,

The script is as follows:

50070 8088 --name bbbbb hd_image

--name bbbbb, indicating that the name of this container is bbbbb.

-H AAAAA, which indicates that the host name in the container is AAAAA.

-D, which represents the detach mode.

-P 50070-p 8088, which means to bind the ports 50070 and 8088 of this container to your host.

At this point, you can access the application in your container by using the IP of your host's eth0 plus the port number of the map in the external network.

An example:

Ps

You'll find that the port mappings for the container and the host appear below ports, like mine:

0.0. 0.0:49212-500700.0. 0.0:49213-8088/tcp

Then execute the command:

sudo ifconfig eth0

will see your host's IP address, like mine.

Eth0 Link encap:ethernet HWaddr ,:xx: -: 0b:1b: +inet Addr:192.168.4. 341Bcast:192.168.4. 255Mask:255.255.255.0Inet6 addr:fe80::a00:27ff:fe0b:1b32/ -scope:link up broadcast RUNNING multicast MTU: theMetric:1RX Packets:5229Errors0Dropped0Overruns:0Frame0TX Packets:2850Errors0Dropped0Overruns:0Carrier0Collisions:0Txqueuelen: +RX Bytes:685234(669.1KiB) TX Bytes:2826660(2.6MiB)

At this point, you are in your browser, type:

192.168. 4.341:49212192.168. 4.341:49213

You can access the 50070-port and 8088-port applications of Hadoop in your Docker container separately, that's all!

Browser (extranet) access to Hadoop in Docker container

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.