1. Preparing the Environment
Use CentOS7 + Docker + Zookeeper3.4.10 build dubbo microService
1.1. Installation vessel docker
(1) .uname -r: docker requirements CentOS kernel version is higher than 3.10, it is recommended to use CentOS7 and above. You can view the system's uname -r command kernel version
(2) .sudo yum update: ensure that the yum package up to date
(3).subo yum install docker-ce-17.12.0.ce:安装docker
This installation directly from the pull centos, if the network is not good, it is difficult to pull off. It can be specified by setting the mounting position of the source manner downloads
For example: sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo. If the local and docker installed, if you need to install the latest docker, need to delete the original, or not installed, delete the old version of the command: sudo yum remove docker docker-common docker-selinux docker-engine.
(4) .sudo systemctl start docker: docker start
After the start, it is recommended to set the boot from Kai docker: sudo systemctl enable docker, and the command docker docker version verify whether the installation is successful, if the following screen appears, the installation is successful
1.2. Installation zookeeper
zookeeper used primarily as service centers, and dubbo official website for the latest demo version has zk requirements, I tried the latest zk, is not compatible demo dubbo official website, so I downloaded zk3.4.10
(1).docker pull zookeeper:3.4.10:拉取zk
Here there may also be unable to pull down, there are two ways to solve,
a. their own download a zk, and then uploaded to the centos, then install.
b. Source set zk of
(2) Installation zk
Because one by one, starting ZK too much trouble, so for convenience, I use direct docker-compose the cluster to start ZK Create docker / zookeeper directory in the user / local, and then create a file called a docker-compose.yml, which reads as follows:
View zk just pull the mirror and start
Here docker-compose command may not, then you need to install:
Use pip install:
1. Install pip:
yum -y install epel-release
yum -y install python-pip
2. Installation docker-compose
pip install docker-compose
(3) .docker ps: View docker container to start zk
Description zookeeper port number:
2181: The client connection using the cluster zookeeper listening port number
3888: Select Use leader
2888: communication using the machine in a cluster (port data synchronization between the leader and the follower used, leader listens to this port)
(4) To view the operating status of docker
* Master-slave node is selected by election mechanism zk, where 2183 zNode set maximum, it was selected as primary node is to be expected.
State and the picture is consistent, as evidenced by the success of the launch. If it does not succeed, you need to manually set up a profile, first install zk, there is a case profile is not automatically created, you can enter the docker container to see if there is a missing zk profile
docker in many commands need to be installed, or can not use. So it is necessary to update the source apt-get update, but docker kernel uses debian, server is not in China, basically can not update successfully, this will need to modify the source, Here are two sources, currently also used: specific operations
Must first update the system software source:
sudo cp /etc/apt/sources.list /etc/apt/sources.list_bak # backup of software source
sudo vi /etc/apt/sources.list (This column may also be unable to use vi you can use cat> << EOF forced to write, remember to backup)
网易163更新服务器:
deb http://mirrors.163.com/debian/ squeeze main non-free contrib
deb http://mirrors.163.com/debian/ squeeze-proposed-updates main non-free contrib
deb-src http://mirrors.163.com/debian/ squeeze main non-free contrib
deb-src http://mirrors.163.com/debian/ squeeze-proposed-updates main non-free contrib
sohu 更新服务器:
deb http://mirrors.sohu.com/debian/ lenny main non-free contrib
deb http://mirrors.sohu.com/debian/ lenny-proposed-updates main non-free contrib
deb-src http://mirrors.sohu.com/debian/ lenny main non-free contrib
deb-src http://mirrors.sohu.com/debian/ lenny-proposed-updates main non-free contrib
2. Use dubbo-admin console
Enter dubbo official website: http://dubbo.apache.org/zh-cn/docs/user/quick-start.html
Installation documentation official website, download and start dubbo-admin:
This place, dubbo-admin warehouse difficult to download, spent a week, put all the jar package down, I have uploaded to the cloud Baidu, welcome to download
Link: https: //pan.baidu.com/s/1-JnuKgpMk3qRL-61oEF0xg
extraction code: o1bh
In dos boot, as shown below, a successful start
Access the console: