Docker+mysql+zabix-server Environment Construction

Source: Internet
Author: User
Tags docker run

The combination of using Docker to build Zabbix is Mysql+docker+zabix-server, using the Zabbix container to connect to the MySQL container, the database file of the MySQL container is guaranteed to exist the physical host/opt/mysql_db/mysql/ The DataDir directory. Test environment
1, the operating system version is: Centos7. 5 2, the Docker version is:1.13. 1 3 . mysql database is:5.7
1 Installing Docker
Yum install docker-  y
Systemctl Start Docker
Systemctl Enable Docker

2 Modifying the default Docker image address
sudo mkdir-p/etc//etc/docker/daemon.json <<-'EOF'{  "  registry-mirrors": ["https://3pm9ld7m.mirror.aliyuncs.com"  ]}eofsudo systemctl daemon-reloadsudo systemctl restart Docker

3 Install the database first MySQL
Docker run--name zabbix-mysql-server--hostname zabbix-mysql-Server-v/opt/mysql_db/mysql/conf/etc/mysql/conf.d-v/opt/mysql_db/mysql/datadir:/var/lib/mysql--privileged=true -E mysql_root_password="123456" -E mysql_user="Zabbix" -E mysql_password="123456" -E mysql_database="Zabbix" -P3306:3306 -D MySQL:5.7 --character-Set-server=utf8--collation-server=utf8_bin
4 Creating Zabbix-server
Docker run--name zabbix-server-mysql--hostname zabbix-server-MySQL--link zabbix-mysql-Server:mysql-E db_server_host="MySQL" -E mysql_user="Zabbix" -E mysql_database="Zabbix" -E mysql_password="123456" -v/etc/localtime:/etc/Localtime:ro-v/data/docker/zabbix/alertscripts:/usr/lib/zabbix/alertscripts-v/data/docker/zabbix/externalscripts:/usr/lib/zabbix/externalscripts-P10051:10051 -D Zabbix/zabbix-server-mysql
5 Last Web-nginx
Final installation zabbix-web-Nginxdocker Run--name Zabbix-web-nginx-mysql--hostname zabbix-web-nginx-MySQL--link zabbix-mysql-Server:mysql--link zabbix-server-mysql:zabbix-Server-E db_server_host="MySQL" -E mysql_user="Zabbix" -E mysql_password="123456" -E mysql_database="Zabbix" -E zbx_server_host="Zabbix-server" -E php_tz="Asia/shanghai" -P8000: the -P8443:443 -D Zabbix/zabbix-web-nginx-mysql
6 Results Test
Browser access ip:8000 View default login Username:Adminpassword:zabbix
7 docker-zabbbix-agent Installation and link zabbix-server
Docker run--name zabbix-agent--link zabbix-server-mysql:zabbix-server-d zabbix/zabbix-agent:latest

Finally, you need to add the zabbix-agent to the Zabbix-server host list on the web side.

Docker+mysql+zabix-server Environment Construction

Related Article

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.