Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No way to enable port mapping #8

Open
eyasuyuki opened this issue Apr 24, 2015 · 3 comments
Open

No way to enable port mapping #8

eyasuyuki opened this issue Apr 24, 2015 · 3 comments

Comments

@eyasuyuki
Copy link

I use boot2docker/OS X 10.10.3.

kylin-deploy-cluster works fine.
But it not enables port mapping.

How do I map ports to boot2docker host from amb0 container?

$ docker ps
CONTAINER ID        IMAGE                    COMMAND                CREATED             STATUS              PORTS                                    NAMES
2ae2542ff9df        sequenceiq/kylin:0.6.4   "/usr/local/serf/bin   About an hour ago   Up About an hour    7070/tcp, 7373/tcp, 7946/tcp, 8080/tcp   amb2                
1c26d4ecab32        sequenceiq/kylin:0.6.4   "/usr/local/serf/bin   About an hour ago   Up About an hour    7070/tcp, 7373/tcp, 7946/tcp, 8080/tcp   amb1                
09bafd87ceeb        sequenceiq/kylin:0.6.4   "/usr/local/serf/bin   About an hour ago   Up About an hour    7070/tcp, 7373/tcp, 7946/tcp, 8080/tcp   amb0    

$ docker inspect amb0
[{
    "AppArmorProfile": "",
    "Args": [
        "--tag",
        "ambari-server=true"
    ],
    "Config": {
        "AttachStderr": false,
        "AttachStdin": false,
        "AttachStdout": false,
        "Cmd": [
            "--tag",
            "ambari-server=true"
        ],
        "CpuShares": 0,
        "Cpuset": "",
        "Domainname": "mycorp.kom",
        "Entrypoint": [
            "/usr/local/serf/bin/start-serf-agent.sh"
        ],
        "Env": [
            "KEYCHAIN=",
            "HOME=/",
            "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/jdk64/jdk1.7.0_67/bin",
            "SERF_HOME=/usr/local/serf",
            "JAVA_HOME=/usr/jdk64/jdk1.7.0_67",
            "CATALINA_HOME=/usr/local/apache-tomcat-7.0.59"
        ],
        "ExposedPorts": {
            "7070/tcp": {},
            "7373/tcp": {},
            "7946/tcp": {},
            "8080/tcp": {}
        },
        "Hostname": "amb0",
        "Image": "sequenceiq/kylin:0.6.4",
        "Labels": {},
        "MacAddress": "",
        "Memory": 0,
        "MemorySwap": 0,
        "NetworkDisabled": false,
        "OnBuild": null,
        "OpenStdin": false,
        "PortSpecs": null,
        "StdinOnce": false,
        "Tty": false,
        "User": "",
        "Volumes": {
            "/var/log": {}
        },
        "WorkingDir": "/tmp"
    },
    "Created": "2015-04-24T02:59:23.234938353Z",
    "Driver": "aufs",
    "ExecDriver": "native-0.2",
    "ExecIDs": null,
    "HostConfig": {
        "Binds": null,
        "CapAdd": null,
        "CapDrop": null,
        "CgroupParent": "",
        "ContainerIDFile": "",
        "CpuShares": 0,
        "CpusetCpus": "",
        "Devices": [],
        "Dns": [
            "127.0.0.1"
        ],
        "DnsSearch": null,
        "ExtraHosts": null,
        "IpcMode": "",
        "Links": null,
        "LogConfig": {
            "Config": null,
            "Type": "json-file"
        },
        "LxcConf": [],
        "Memory": 0,
        "MemorySwap": 0,
        "NetworkMode": "bridge",
        "PidMode": "",
        "PortBindings": {},
        "Privileged": false,
        "PublishAllPorts": false,
        "ReadonlyRootfs": false,
        "RestartPolicy": {
            "MaximumRetryCount": 0,
            "Name": "no"
        },
        "SecurityOpt": null,
        "Ulimits": null,
        "VolumesFrom": null
    },
    "HostnamePath": "/mnt/sda1/var/lib/docker/containers/09bafd87ceebf6bf112ae4451f73a19f376d80d83fbc696bc636c3c9e9a4398a/hostname",
    "HostsPath": "/mnt/sda1/var/lib/docker/containers/09bafd87ceebf6bf112ae4451f73a19f376d80d83fbc696bc636c3c9e9a4398a/hosts",
    "Id": "09bafd87ceebf6bf112ae4451f73a19f376d80d83fbc696bc636c3c9e9a4398a",
    "Image": "c7db58ccb5969fc1522d00b287e9adacc39e2464bf7eb280c1302a78bd17e103",
    "LogPath": "/mnt/sda1/var/lib/docker/containers/09bafd87ceebf6bf112ae4451f73a19f376d80d83fbc696bc636c3c9e9a4398a/09bafd87ceebf6bf112ae4451f73a19f376d80d83fbc696bc636c3c9e9a4398a-json.log",
    "MountLabel": "",
    "Name": "/amb0",
    "NetworkSettings": {
        "Bridge": "docker0",
        "Gateway": "172.17.42.1",
        "GlobalIPv6Address": "",
        "GlobalIPv6PrefixLen": 0,
        "IPAddress": "172.17.0.1",
        "IPPrefixLen": 16,
        "IPv6Gateway": "",
        "LinkLocalIPv6Address": "fe80::42:acff:fe11:1",
        "LinkLocalIPv6PrefixLen": 64,
        "MacAddress": "02:42:ac:11:00:01",
        "PortMapping": null,
        "Ports": {
            "7070/tcp": null,
            "7373/tcp": null,
            "7946/tcp": null,
            "8080/tcp": null
        }
    },
    "Path": "/usr/local/serf/bin/start-serf-agent.sh",
    "ProcessLabel": "",
    "ResolvConfPath": "/mnt/sda1/var/lib/docker/containers/09bafd87ceebf6bf112ae4451f73a19f376d80d83fbc696bc636c3c9e9a4398a/resolv.conf",
    "RestartCount": 0,
    "State": {
        "Dead": false,
        "Error": "",
        "ExitCode": 0,
        "FinishedAt": "0001-01-01T00:00:00Z",
        "OOMKilled": false,
        "Paused": false,
        "Pid": 2894,
        "Restarting": false,
        "Running": true,
        "StartedAt": "2015-04-24T02:59:23.691134433Z"
    },
    "Volumes": {
        "/var/log": "/mnt/sda1/var/lib/docker/vfs/dir/5c07d65771c2044183f7c0e7deab1a6b16281cf081a1cd3718ba51469d622618"
    },
    "VolumesRW": {
        "/var/log": true
    }
}
]
@anselmo
Copy link

anselmo commented May 28, 2015

@eyasuyuki try the following in your host machine (osx)

// e.g sudo route add -net 172.17.0.53 192.168.59.103  
sudo route add -net <container-ip> <bootodocker-ip>

You should have access to your-container-ip::8080 (Ambari)

@eyasuyuki
Copy link
Author

Why don't use Docker's port mapping "docker run -p" option?

@shaofengshi
Copy link
Contributor

Hi eyasuyuki, thanks for the input; The kylin docker image has been updated with kylin 0.7.2 release, the "ambari-functions" script is also updated to enable port mapping; please retry by following the steps on https://github.com/sequenceiq/docker-kylin ; The dynamic port that mapped to 7070 can be found with "docker ps" command;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants