Installation docker
Yum install docker need to configure the network source, centos7 own version too low
Step One: Download Ali cloud docker installation package
Under the yum repository directory
[root@localhost yum.repos.d]# wget http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
Also you need to use extra source and epel
[extra] name=centos extra enabled=1 gpgcheck=0 baseurl=https://mirrors.aliyun.com/centos/7/extras/x86_64/ [epel] name=epel enabled=1 gpgcheck=0 baseurl=https://mirrors.aliyun.com/epel/7Server/x86_64/
Step 2: Use yum to install
docker-ce is a community edition is free
docker-ee Enterprise Edition, for a fee
Here we download Community Edition
[root@ken ~]# yum install docker-ce -y
Step 3: Add accelerator Address
The resulting image just registered address accelerated following steps have filled in
[root@ken ~]# mkdir /etc/docker [root@ken ~]# cat /etc/docker/daemon.json { "registry-mirrors": ["https://XXX.mirror.aliyuncs.com"] }
Step four: Restart docker
[root@ken ~]# systemctl restart docker
Installation zabbix
zabbix use docker container mounted official website address (version 4.2)
https://www.zabbix.com/documentation/4.2/manual/installation/containers
The first step: Start the database
docker run --name mysql-server -t \ -e MYSQL_DATABASE="zabbix" \ -e MYSQL_USER="zabbix" \ -e MYSQL_PASSWORD="zabbix_pwd" \ -e MYSQL_ROOT_PASSWORD="root_pwd" \ -d mysql:5.7 \ --character-set-server=utf8 --collation-server=utf8_bin
Step Two: Start Zabbix server instances, and associate it to the MySQL server instance has been created.
docker run --name zabbix-server-mysql -t \ -e DB_SERVER_HOST="mysql-server" \ -e MYSQL_DATABASE="zabbix" \ -e MYSQL_USER="zabbix" \ -e MYSQL_PASSWORD="zabbix_pwd" \ -e MYSQL_ROOT_PASSWORD="root_pwd" \ --link mysql-server:mysql \ -p 10051:10051 \ -d zabbix/zabbix-server-mysql:latest
The third step: start Zabbix Web interface, and link to the MySQL server has been created and Zabbix server instances.
docker run --name zabbix-web-nginx-mysql -t \ -e DB_SERVER_HOST="mysql-server" \ -e MYSQL_DATABASE="zabbix" \ -e MYSQL_USER="zabbix" \ -e MYSQL_PASSWORD="zabbix_pwd" \ -e MYSQL_ROOT_PASSWORD="root_pwd" \ --link mysql-server:mysql \ --link zabbix-server-mysql:zabbix-server \ -p 81:80 \ -d zabbix/zabbix-web-nginx-mysql:latest
View of the port has started
[root@ken ~]# ss -tnl
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 127.0.0.1:9000 *:*
LISTEN 0 50 *:3306 *:*
LISTEN 0 50 *:139 *:*
LISTEN 0 128 *:80 *:*
LISTEN 0 128 *:22 *:*
LISTEN 0 50 *:445 *:*
LISTEN 0 50 :::139 :::*
LISTEN 0 128 :::80 :::*
LISTEN 0 128 :::81 :::*
LISTEN 0 50 :::445 :::*
LISTEN 0 128 :::10051 :::*
Browser access
Deployment zabbix-agent end
docker run –name zabbix-agent -p 10050:10050 -e ZBX_HOSTNAME=”zabbix_agent” -e ZBX_SERVER_HOST=”127.0.0.1″ -e ZBX_SERVER_PORT=10051 -d zabbix/zabbix-agent
View Host
Note that the IP address to IP address 127.0.0.1 can not be used