Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of Docker centralized web Interface Management platform shipyard

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

Docker centralized web interface management platform shipyard example analysis, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can get something.

Shipyard (github) is a docker graphical tool based on web cluster management tool Citadel, which can manage containers, hosts and other resources. It includes two versions: core and extension. Core or shipyard mainly manages containers on multiple Docker host (supports spanning multiple host). Extension or shipyard-extensions adds application routing and load balancing, centralized logging, deployment, and so on.

1. Several Concepts engine

A shipyard-managed docker cluster can contain one or more engine (engines), and an engine is the docker daemon that listens on the tcp port. Shipyard management of docker daemon, images, containers is based entirely on Docker API, and no other modifications are required. In addition, shipyard can impose resource restrictions on each engine, including CPU and memory. Because TCP snooping has some security risks compared with Unix socket, shipyard also supports secure communication with docker background processes through SSL certificates.

Rethinkdb

RethinkDB is a docker image of a shipyard project, which is used to store information such as account (account), engine (engine), service key (service key), extended metadata (extension metadata), but does not store anything about containers or images. A shipyard/rethinkdb container shipyard-rethinkdb-data is typically launched to use its / data as a data volume for another rethinkdb to mount specifically for data storage.

two。 Modify tcp snooping during building process

In order for Shipyard to manage and control Docker host, you need to modify the default configuration on Docker host to listen on the tcp port (you can continue to maintain Unix socket). There are two ways

Sudo docker-H tcp://0.0.0.0:4243-H unix:///var/run/docker.sock-d starts docker daemon. To avoid writing such a long command every time you start, you can modify it directly in / etc/init/docker.conf.

Modify the DOCKER_OPTS of / etc/default/docker

DOCKER_OPTS= "- H tcp://127.0.0.1:4243-H unix:///var/run/docker.sock". This approach didn't work on my docker version 1.4.1 in ubuntu 14.04.

Restart the service $sudo docker-H tcp://0.0.0.0:4243-H unix:///var/run/docker.sock-d verify $netstat-ant | grep 4243tcp6 0 0:: 4243

Start rethinkdb

The installation process of shipyard (based on Python/Django) in v1 version is complicated, either by installing on host or by deploying shipyard images (including components such as shipyard-agent, shipyard-deploy, etc.). The v2 version simplifies the installation process by starting two images:

Get a / data data volume $sudo docker run-it-d-- name shipyard-rethinkdb-data\-- entrypoint / bin/bash shipyard/rethinkdb-l use the data volume / data to start RethinkDBdocker run-it-P-d-name shipyard-rethinkdb\-volumes-from shipyard-rethinkdb-data shipyard/rethinkdb deployment shipyard image

Start the shipyard controller:

Sudo docker run-it-p 8080 name shipyard 8080-d-- link shipyard-rethinkdb:rethinkdb shipyard/shipyard

At this point, you can access the shipyard UI interface by accessing http://host:8080 through a browser.

After the first run, use it directly when you turn it off and start it again:

Sudo docker stop shipyard shipyard-rethinkdb shipyard-rethinkdb-datasudo docker start shipyard-rethinkdb-data shipyard-rethinkdb shipyard diagram

Login:

The default username / password is admin/shipyard

Main interface:

Dashboard shows the CPU specified when the engine is added and the memory usage.

Container:

All containers for all docker hosts managed by shipyard, including stop and running state. You can directly click the DEPLOY button to run other containers from the image, which is almost the same as the option of docker run, and you can limit the use of CPU and memory, as detailed in shipyard's containers documentation.

Container operation:

You can use stop, start, and restart containers. You can see the container log output through LOGS, and SCALE can deploy the container in batch (scale). This operation is closely related to the container's Type attribute. Because shipyard can manage docker containers of multiple host, the type to launch a container can be: service-- can run on engine with the same label; unique--, only one instance of an image is allowed to run on a host; host-- runs the container on the specified host, and docker host is specified with-- label host: syntax when starting.

Engine Management:

An engine means that multiple containers are launched under a docker daemon,docker daemon, which can limit the overall CPU and memory limits to the engine, and the shipyard connects to the daemon through the TCP port. What needs to be noted is the version of docker client and server: (because shipyard is still in the process of rapid improvement, different versions of docker should be backward compatible)

Curl-X GET http://172.29.88.223:4243/v1.15/containers/jsonclient and server don't have same version (client: 1.15, server: 1.13)

3. Shipyard-cli

At present, the graphical interface can do very little, but what is powerful is to manage it through the command line window (called Shipyard CLI) provided by shipyard. Refer to http://shipyard-project.com/docs/usage/cli/.

Start command line interaction mode:

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

You can even replace the docker client with it.

Sean@seanubt:~$ sudo docker run-it shipyard/shipyard-clishipyard cli > shipyard helpNAME:shipyard-manage a shipyard clusterUSAGE:shipyard [global options] command [command options] [arguments...] VERSION:2.0.8COMMANDS:login login to a shipyard clusterchange-password update your passwordaccounts show accountsadd-account add accountdelete-account delete accountcontainers list containersinspect inspect containerrun run a containerstop stop a containerrestart restart a containerscale scale a containerlogs show container logsdestroy destroy a containerengines list enginesadd-engine add shipyard engineremove-engine removes an engineinspect-engine inspect an engineservice-keys list service keysadd-service- Key adds a service keyremove-service-key removes a service keyextensions show extensionsadd-extension add extensionremove-extension remove an extensionwebhook-keys list webhook keysadd-webhook-key adds a webhook keyremove-webhook-key removes a webhook keyinfo show cluster infoevents show cluster eventshelp H Shows a list of commands or help for one commandGLOBAL OPTIONS:--help,-h show help--generate-bash-completion--version -v print the version login shipyardshipyard cli > shipyard loginURL: http://172.29.88.205:8080Username: adminPassword: view containersshipyard cli > shipyard containers launch 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 container logs (only container ID can be accessed Cannot use container name) shipyard cli > shipyard logs ff2761d close and remove container shipyard cli > shipyard destroy

After the trial, I feel that the web of shipyard has only achieved the most basic functions, and if you need to easily manage the docker cluster from web, you still need to do a lot of customization work.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report