sequenceiq / docker-ambari

Docker image with Ambari
291 stars 200 forks source link

can't work correctly in cloudbreak #106

Closed ylvmw closed 8 years ago

ylvmw commented 8 years ago

Hi,

When we created the cluster with cloudbreak, the ambari can't work correclty. Could you give some hints on how to fix it? Do we need to configure something for docker engine or OS?

docker inspect:

[
{
    "Id": "df8926b8290e80645b01fe92c434ef78e59419fd35080c6f995e3b4aaef86947",
    "Created": "2016-01-21T08:14:57.258655233Z",
    "Path": "/start-server",
    "Args": [],
    "State": {
        "Status": "running",
        "Running": true,
        "Paused": false,
        "Restarting": false,
        "OOMKilled": false,
        "Dead": false,
        "Pid": 3141,
        "ExitCode": 0,
        "Error": "",
        "StartedAt": "2016-01-21T08:15:03.51735823Z",
        "FinishedAt": "0001-01-01T00:00:00Z"
    },
    "Image": "70f5dbe71f4a2baaffd67f1d44b562b317cf272382a1a88740f98a1f57c3c15a",
    "ResolvConfPath": "/var/lib/docker/containers/df8926b8290e80645b01fe92c434ef78e59419fd35080c6f995e3b4aaef86947/resolv.conf",
    "HostnamePath": "/var/lib/docker/containers/df8926b8290e80645b01fe92c434ef78e59419fd35080c6f995e3b4aaef86947/hostname",
    "HostsPath": "/var/lib/docker/containers/df8926b8290e80645b01fe92c434ef78e59419fd35080c6f995e3b4aaef86947/hosts",
    "LogPath": "/var/lib/docker/containers/df8926b8290e80645b01fe92c434ef78e59419fd35080c6f995e3b4aaef86947/df8926b8290e80645b01fe92c434ef78e59419fd35080c6f995e3b4aaef86947-json.log",
    "Name": "/ambari-server",
    "RestartCount": 0,
    "Driver": "devicemapper",
    "ExecDriver": "native-0.2",
    "MountLabel": "",
    "ProcessLabel": "",
    "AppArmorProfile": "",
    "ExecIDs": null,
    "HostConfig": {
        "Binds": [
            "/hadoopfs/fs1/logs:/var/log:rw",
            "/etc/krb5.conf:/etc/krb5.conf:rw"
        ],
        "ContainerIDFile": "",
        "LxcConf": null,
        "Memory": 0,
        "MemoryReservation": 0,
        "MemorySwap": 0,
        "KernelMemory": 0,
        "CpuShares": 0,
        "CpuPeriod": 0,
        "CpusetCpus": "",
        "CpusetMems": "",
        "CpuQuota": 0,
        "BlkioWeight": 0,
        "OomKillDisable": false,
        "MemorySwappiness": null,
        "Privileged": true,
        "PortBindings": {
            "8080/tcp": [
                {
                    "HostIp": "",
                    "HostPort": "8080"
                }
            ]
        },
        "Links": null,
        "PublishAllPorts": false,
        "Dns": null,
        "DnsOptions": null,
        "DnsSearch": null,
        "ExtraHosts": null,
        "VolumesFrom": null,
        "Devices": null,
        "NetworkMode": "host",
        "IpcMode": "",
        "PidMode": "",
        "UTSMode": "",
        "CapAdd": null,
        "CapDrop": null,
        "GroupAdd": null,
        "RestartPolicy": {
            "Name": "always",
            "MaximumRetryCount": 0
        },
        "SecurityOpt": null,
        "ReadonlyRootfs": false,
        "Ulimits": null,
        "LogConfig": {
            "Type": "json-file",
            "Config": {}
        },
        "CgroupParent": "",
        "ConsoleSize": [
            0,
            0
        ],
        "VolumeDriver": ""
    },
    "GraphDriver": {
        "Name": "devicemapper",
        "Data": {
            "DeviceId": "271",
            "DeviceName": "docker-253:0-17855111-df8926b8290e80645b01fe92c434ef78e59419fd35080c6f995e3b4aaef86947",
            "DeviceSize": "107374182400"
        }
    },
    "Mounts": [
        {
            "Source": "/hadoopfs/fs1/logs",
            "Destination": "/var/log",
            "Mode": "rw",
            "RW": true
        },
        {
            "Source": "/etc/krb5.conf",
            "Destination": "/etc/krb5.conf",
            "Mode": "rw",
            "RW": true
        }
    ],
    "Config": {
        "Hostname": "***",
        "Domainname": "abc.com",
        "User": "",
        "AttachStdin": false,
        "AttachStdout": false,
        "AttachStderr": false,
        "ExposedPorts": {
            "8080/tcp": {}
        },
        "Tty": false,
        "OpenStdin": false,
        "StdinOnce": false,
        "Env": [
            "POSTGRES_DB=localhost",
            "CLOUD_PLATFORM=***",
            "SERVICE_NAME=ambari-8080",
            "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/jdk64/jdk1.7.0_67/bin:/usr/local/maven/bin",
            "JAVA_HOME=/usr/jdk64/jdk1.7.0_67",
            "AMBARI_JVM_ARGS=-XX:MaxPermSize=512m",
            "PLUGIN_PATH=/plugins",
            "HADOOP_CLASSPATH=/usr/lib/hadoop/lib/*",
            "M2_HOME=/usr/local/maven",
            "PS1=[\\u@docker-ambari \\W]# "
        ],
        "Cmd": [
            "/start-server"
        ],
        "Image": "sequenceiq/ambari:2.1.2-v8",
        "Volumes": {
            "/var/log": {}
        },
        "WorkingDir": "/tmp",
        "Entrypoint": null,
        "OnBuild": null,
        "Labels": {
            "com.docker.swarm.constraints": "[\"node==wdc-vhadp-pub1-dhcp44.eng.vmware.com\"]",
            "com.docker.swarm.id": "d756b74215f5ee2df3f15bb8fcf71db43f19ca41c07169f8fb309a8220c6405a"
        }
    },
    "NetworkSettings": {
        "Bridge": "",
        "SandboxID": "1b4d3e7601208df75c8306abc74e6a476d3f63c7d2510b7ae97d40e68e871cfa",
        "HairpinMode": false,
        "LinkLocalIPv6Address": "",
        "LinkLocalIPv6PrefixLen": 0,
        "Ports": {},
        "SandboxKey": "/var/run/docker/netns/default",
        "SecondaryIPAddresses": null,
        "SecondaryIPv6Addresses": null,
        "EndpointID": "",
        "Gateway": "",
        "GlobalIPv6Address": "",
        "GlobalIPv6PrefixLen": 0,
        "IPAddress": "",
        "IPPrefixLen": 0,
        "IPv6Gateway": "",
        "MacAddress": "",
        "Networks": {
            "host": {
                "EndpointID": "b577381157d2ef3375a48ebbdd365561bb8e3b79b6fd5c9b493dca27db67b622",
                "Gateway": "",
                "IPAddress": "",
                "IPPrefixLen": 0,
                "IPv6Gateway": "",
                "GlobalIPv6Address": "",
                "GlobalIPv6PrefixLen": 0,
                "MacAddress": ""
            }
        }
    }
}
]

docker logs:

sing python  /usr/bin/python2.6
Starting ambari-server
WARNING: The hostname was not found in the reverse DNS lookup. This may result in incorrect behavior. Please check the DNS setup and fix the issue.
Ambari Server running with administrator privileges.
Organizing resource files at /var/lib/ambari-server/resources...
Server PID at: /var/run/ambari-server/ambari-server.pid
Server out at: /var/log/ambari-server/ambari-server.out
Server log at: /var/log/ambari-server/ambari-server.log
Waiting for server start.........
ERROR: Exiting with exit code -1.
REASON: Ambari Server java process died with exitcode 1. Check /var/log/ambari-server/ambari-server.out for more information.
Using python  /usr/bin/python2.6
Starting ambari-server
WARNING: The hostname was not found in the reverse DNS lookup. This may result in incorrect behavior. Please check the DNS setup and fix the issue.
Ambari Server running with administrator privileges.
Organizing resource files at /var/lib/ambari-server/resources...
Server PID at: /var/run/ambari-server/ambari-server.pid
Server out at: /var/log/ambari-server/ambari-server.out
Server log at: /var/log/ambari-server/ambari-server.log
Waiting for server start...................
Ambari Server 'start' completed successfully.
Using python  /usr/bin/python2.6
Starting ambari-server
ERROR: Exiting with exit code 1.
REASON: Ambari Server is already running.
keyki commented 8 years ago

Can you please take a look at the ambari server log? /hadoopfs/fs1/logs/ambari-server/ambari-server.log

ylvmw commented 8 years ago

It reports:

26 Jan 2016 05:49:37,140 ERROR [main] AmbariServer:722 - Failed to run the Ambari Server
com.google.inject.ProvisionException: Guice provision errors:

1) Error injecting constructor, java.net.UnknownHostException: *.*.*.com: *.*.*.*.com
  at org.apache.ambari.server.controller.AmbariManagementControllerImpl.<init>(AmbariManagementControllerImpl.java:292)
  at org.apache.ambari.server.controller.AmbariManagementControllerImpl.class(AmbariManagementControllerImpl.java:183)
  while locating org.apache.ambari.server.controller.AmbariManagementControllerImpl
  while locating org.apache.ambari.server.controller.AmbariManagementController
  at org.apache.ambari.server.agent.HeartBeatHandler.<init>(HeartBeatHandler.java:183)
  at org.apache.ambari.server.agent.HeartBeatHandler.class(HeartBeatHandler.java:120)
  while locating org.apache.ambari.server.agent.HeartBeatHandler
keyki commented 8 years ago

It seems that those addresses are not resolvable. Is it a custom HDP repo?

ylvmw commented 8 years ago

I used the default HDP repo. Tested with a standalone Java app on the same host, but no such exception threw and it returned the correct values. Code:

InetAddress inetAddr = InetAddress.getLocalHost();
System.out.println("hostname=" + inetAddr.getHostName() + ", ip=" + inetAddr.getHostAddress() + ", cname=" + inetAddr.getCanonicalHostName());
lalyos commented 8 years ago