Web Interface Management Platform Shipyard management Docker container

Source: Internet
Author: User
Tags memory usage docker run webhook

use shipyard to manage Docker

Docker need a management tool to consolidate and manage, shipyard is a good choice.
Docker management tools run with Docker, the simple steps are as follows:
An example of a RETHINKDB data volume:

Docker run-it-d--name shipyard-rethinkdb-data \
--entrypoint/bin/bash shipyard/rethinkdb-l

Use the data volume you just created to start a rethinkdb instance again

Docker Run-it-p-D--name shipyard-rethinkdb \
--volumes-from Shipyard-rethinkdb-data SHIPYARD/RETHINKDB

Up a shipyard controller.

Docker run-it-p 8080:8080-d--name shipyard \
--link SHIPYARD-RETHINKDB:RETHINKDB Shipyard/shipyard

Then the browser ip:8080 can access to the Shipyard management page, the front and then add layer Nginx, with a domain name better
The default user name is Admin shipyard

Add a docker host, this is called engines
Write a name, label, fill in the host's CPU number and memory, and then write in address to find the problem
Docker must specify a remote management port when booting.
If it is the source code installation docker, need to modify the boot configuration/etc/init/docker.conf, set the management port:

Description "Run Docker"

Start on filesystem or RunLevel [2345]
Stop on RunLevel [!2345]

Respawn

Script
/usr/bin/docker-d-H tcp://0.0.0.0:2375-h unix:///var/run/docker.sock
End Script

or specify startup parameters directly, such as

/usr/bin/docker-d-H tcp://0.0.0.0:2375-h unix:///var/run/docker.sock >>/dev/null 2>&1 &

and write http://ip:2375 in the address in the Add engines.
Then, if you use SSL on TCP, you also need to write a certificate, so that the Docker host is added, and you can manage Docker on multiple host in one place




Docker centralized web interface management Platform Shipyard

1. Several concepts

Engine

A shipyard managed Docker cluster can contain one or more engine (engines), and one engine is the Docker daemon that listens on TCP ports. Shipyard Management Docker daemon, images, containers are completely based on the Docker API and no other modifications are required. In addition, shipyard can make resource restrictions on each engine, including CPU and memory, because TCP listening has a certain security risk compared to UNIX sockets, so shipyard also supports secure communication with Docker background processes through SSL certificates.

Rethinkdb

RETHINKDB is a docker image of a shipyard project that holds information such as account, Engine (engine), service key (services key), extended metadata (extension metadata), It does not store any container or mirror content. Typically, a SHIPYARD/RETHINKDB container shipyard-rethinkdb-data is started to use its/data as a data volume for another RETHINKDB mount, dedicated to data storage.

2. Build Process

Modify TCP Listening

Shipyard to manage and control the Docker host, you need to modify the default configuration on the Docker host to listen on the TCP port (you can continue to keep the UNIX socket). There are 2 different ways to do this

sudo docker-h tcp://0.0.0.0:4243-h unix:///var/run/docker.sock-d starts Docker daemon. If you write such long commands to avoid each startup, you can modify them directly in the/etc/init/docker.conf.
Modify the/etc/default/docker docker_opts
docker_opts= "-H tcp://127.0.0.1:4243-h unix:///var/run/docker.sock". This is not effective on my Docker version 1.4.1 in Ubuntu 14.04.

Restart Service
$ sudo docker-h tcp://0.0.0.0:4243-h unix:///var/run/docker.sock-d
Verify
$ netstat-ant |grep 4243
TCP6 0 0:: 4243:::* LISTEN

Start RETHINKDB

Shipyard (based on Python/django) the installation process is more complex when V1 version, either by installing on host or by deploying shipyard mirrors (including Shipyard-agent, Shipyard-deploy, and so on). The V2 version simplifies the installation process, starting with two mirrors to complete:

To get a/data data volume
$sudo Docker run-it-d--name shipyard-rethinkdb-data \
--entrypoint/bin/bash shipyard/rethinkdb-l

Start rethinkdb with data volume/data
Docker Run-it-p-D--name shipyard-rethinkdb \
--volumes-from Shipyard-rethinkdb-data SHIPYARD/RETHINKDB

Deploying Shipyard Mirrors

To start the shipyard controller:

sudo docker run-it-p 8080:8080-d--name shipyard \
--link SHIPYARD-RETHINKDB:RETHINKDB Shipyard/shipyard

You can now access the shipyard UI interface through a browser access http://host:8080.

When you run the first time, turn it off again when you start it:

sudo docker stop shipyard SHIPYARD-RETHINKDB Shipyard-rethinkdb-data
sudo docker start Shipyard-rethinkdb-data SHIPYARD-RETHINKDB Shipyard

Icon

Login:

Default username/password is Admin/shipyard

Main interface:

Dashboard shows the CPU and memory usage that was specified when adding engine.

Container:
Docker-shipyard-containers
All containers for all Docker hosts managed by shipyard, including the stop and running states. You can click the Deploy button to run the other containers from the mirror, almost the same as the Docker run option, which limits CPU and memory usage, as detailed in the shipyard containers documentation.

Container action:

You can stop, start, restart containers, logs can see the container log output, scale can bulk (scale) deployment of the container, this operation is closely related to the container's Type property. Because shipyard can manage multiple host Docker containers, the type that initiates a container can be: service--can run on engine with the same label; unique--only one instance of a mirror is allowed to run on a host host--runs the container on the specified host and specifies Docker host through the--label host:
Engine management:

A engine is a Docker daemon,docker daemon boot multiple containers, which limits a whole CPU and memory limit to engine, shipyard through TCP ports. Note the issue of Docker client and server versioning: (since shipyard is still in the process of rapid refinement, different versions of Docker should be backward-compatible)

Curl-x Get Http://172.29.88.223:4243/v1.15/containers/json
Client and server don ' t have same version (client:1.15, server:1.13)

3. Shipyard-cli

At present, the graphical interface can do very few things, is very powerful through the shipyard provided by the Command Line window (called Shipyard CLI) for management, reference http://shipyard-project.com/docs/usage/cli/
To start command line interaction mode:

sudo docker run--rm-it shipyard/shipyard-cli

It can even be used to replace Docker clients.

sean@seanubt:~$ sudo docker run-it shipyard/shipyard-cli
Shipyard Cli> Shipyard Help
NAME:
Shipyard-manage a shipyard cluster

USAGE:
Shipyard [Global Options] command [command options] [arguments ...]

VERSION:
2.0.8

COMMANDS:
Login login to a shipyard cluster
Change-password Update your password
Accounts show accounts
Add-account Add Account
Delete-account Delete Account
Containers List Containers
Inspect Inspect container
Run Run a container
Stop Stop a container
Restart Restart a container
Scale scale a container
Logs show container logs
Destroy destroy a container
Engines List Engines
Add-engine Add Shipyard Engine
Remove-engine removes an engine
Inspect-engine inspect an engine
Service-keys List Service keys
Add-service-key adds a service key
Remove-service-key Removes a service key
Extensions Show Extensions
add-extension Add Extension
Remove-extension Remove an extension
Webhook-keys list Webhook keys
Add-webhook-key adds a Webhook key
Remove-webhook-key removes a Webhook key
Info Show Cluster Info
Events Show Cluster Events
Help, H shows a list of commands or help for one command

GLOBAL OPTIONS:
--help, h Show help
--generate-bash-completion
--version, v-print version

Login Shipyard

Shipyard Cli> Shipyard Login
url:http://172.29.88.205:8080
Username:admin
Password:

View containers

Shipyard Cli> Shipyard Containers

Start a container

Shipyard Cli> Shipyard run--name nginx:1.7.6--container-name web_test \
--cpus 0.2 \
--memory 64 \
--type service \
--hostname nginx-test \
--domain example.com \
--link redis:db \
--port tcp/172.29.88.205:81:8081 \
--port tcp/::8000 \
--restart "On-failure:5" \
--env foo=bar \
--label Dev \

View the container log (only the container ID can be used, temporarily cannot use the container name)
Shipyard Cli> Shipyard Logs ff2761d

To close and remove a container
Shipyard Cli> Shipyard Destroy <container_id>

Not a list of ...

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.