7.3 based on CentOS deployment Docker install Zookeeper

1, the installation Docker

1. Check the Linux kernel version

 

Recommended kernel Version 3.10

 

2. Update package yum, yum is the latest to ensure that

Execute the command yum update

 

3. Install the required packages

执行:yum install -y yum-utils device-mapper-persistent-data lvm2

yum-utils provide yum-config-manager function, the other two are driven dependent devicemapper

 

4. Set the source yum

 

5. Installation Docker

1. Review the warehouse Docker version

 

2. Install Docker, here is my version of a docker-ce-18.03.1.ce

Performing yum install docker-ce-18.03.1.ce complete the installation

 

6. Start docker

1. Perform systemctl start docker start Docker

2. Perform systemctl enable docker set boot Docker

3. Use docker version to verify that the installation was successful

 

7. Set mirror Accelerator

Ali cloud Site "container mirror service" in the steps to configure mirroring accelerator

 

8. Installation docker-compose

1. Before installing the need to install pip docker-compose, to check whether the installation pip

 

2. installed pip, need to be upgraded

And use pip install --upgrade pip pip install --upgrade setuptools upgrade

 

3. Installation docker-compose

Performing sudo pip install -U docker-compose == 1.17.1 install

 

4. Verify docker-compose

Execution docker-compose --version to verify the successful installation

 

2, based on the deployment of Docker install Zookeeper

1. yml configuration file

Execute vi docker-compose.yml under / usr / local / docker / zookeeper, write a configuration file, define up the application service

 1 version: '3.1'
 2 services:
 3   zoo1:
 4     image: zookeeper:3.4.14
 5     restart: always
 6     hostname: zoo1
 7     ports:
 8       - 2181:2181
 9     environment:
10       ZOO_MY_ID: 1
11       ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=zoo2:2888:3888 server.3=zoo
12 3:2888:3888
13 
14   zoo2:
15     image: zookeeper:3.4.14
16     restart: always
17     hostname: zoo2
18     ports:
19       - 2182:2181
20     environment:
21       ZOO_MY_ID: 2
22       ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=zoo2:2888:3888 server.3=zoo
23 3:2888:3888
24 
25   zoo3:
26     image: zookeeper:3.4.14
27     restart: always
28     hostname: zoo3
29     ports:
30       - 2183:2181
31     environment:
32       ZOO_MY_ID: 2
33       ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=zoo2:2888:3888 server.3=zoo
34 3:2888:3888

Note: The ":" and "-" after the need for space

 

2. Start program

Execution docker-compose up -d in the docker-compose.yml file directory, compose the whole application up and running

 

3. Verify that the service is started successfully

Use docker exec -it zookeeper_zoo1_1 / bin / bash to enter the service directory

Execute the following command to check the service status

Guess you like

Origin www.cnblogs.com/DP-CPzhu/p/12592304.html