Deploy the Humpback Agent

Humpback Agent

Three servers: 192.168.2.80, 192.168.2.81, 192.168.2.82 need to deploy Humpback Agent for the local image and container management.

  • Check the Docker version

First check the Docker API version number:1.21. Different Docker versions has different api.

  1. $ docker version
  2. Client:
  3. Version: 1.9.1
  4. API version: 1.21
  5. Go version: go1.4.3
  6. Git commit: a34a1d5
  7. Built: Fri Nov 20 17:56:04 UTC 2015
  8. OS/Arch: linux/amd64
  9. Server:
  10. Version: 1.9.1
  11. API version: 1.21
  12. Go version: go1.4.3
  13. Git commit: a34a1d5
  14. Built: Fri Nov 20 17:56:04 UTC 2015
  15. OS/Arch: linux/amd64
  • Start the Humpback Agent

    1、Start in cluster mode

    1. $ docker pull humpbacks/humpback-agent:latest
    2. $ docker run -d -ti --net=host --restart=always \
    3. --name=humpback-agent \
    4. -e DOCKER_API_VERSION=v1.21 \
    5. -e DOCKER_AGENT_IPADDR=0.0.0.0 \
    6. -e DOCKER_CLUSTER_ENABLED=true \
    7. -e DOCKER_CLUSTER_URIS=zk://192.168.2.80:2181,192.168.2.81:2181,192.168.2.82:2181 \
    8. -e DOCKER_CLUSTER_NAME=humpback/center \
    9. -v /var/run/:/var/run/:rw \
    10. humpbacks/humpback-agent:latest
    11. $ docker ps -a
    12. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
    13. b1ac4a82c2dd humpbacks/humpback-agent:latest "./humpback-agent" 3 minutes ago 20 seconds ago humpback-agent

    2、Start in single mode

    1. $ docker pull humpbacks/humpback-agent:latest
    2. $ docker run -d -ti --net=host --restart=always \
    3. --name=humpback-agent \
    4. -e DOCKER_API_VERSION=v1.21 \
    5. -e DOCKER_CLUSTER_ENABLED=false \
    6. -v /var/run/:/var/run/:rw \
    7. humpbacks/humpback-agent:latest
    8. $ docker ps -a
    9. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
    10. b1ac4a82c2dd humpbacks/humpback-agent:latest "./humpback-agent" 3 minutes ago 20 seconds ago humpback-agent
  • Environment variables

DOCKER_API_VERSION=v1.21 must be consistent with the above version number.

DOCKER_AGENT_IPADDR=0.0.0.0 When the container is started, the node in the cluster mode registers with the local network address of the cluster. The default is: 0.0.0.0 randomly selects a valid local address. If the local is a dual network card, you need to select an IP address.

DOCKER_CLUSTER_ENABLED=trueIf the current agent needs to be scheduled by cluster mode, set the cluster mode to true, otherwise, close the node of cluster scheduling to Single Mode mode.

DOCKER_CLUSTER_URIS=zk://192.168.2.80:2181,192.168.2.81:2181,192.168.2.82:2181 is the previously configuredZookeeper cluster address information.

DOCKER_CLUSTER_NAME=humpback/center Cluster name, It is consistent with the Humpback Center configuration.

  • Register the server and create group(cluster)

After the three servers have successfully started the Humpback Agent container, go to the Humpback Web site. Expand the left side of the Manage function, click Groups to create a group MyCluster

And add three node servers to the group and click Save.

Humpback Add Group

Go to the grouping page to view cluster server information.

Humpback Group