Article Directory
A, Ansible-playbook deployment zabbix-mysql
Host and ip deployment
The basic idea: four roles to configure the total file yml scheduling
1.1 mariadb
1、 tasks
2. Trigger: handlers
3, static files
1) mariadb profile:
/etc/my.cnf, adding:charactet_set_server=utf8
2) zabbix database tables: create.sql.gz
Installation yum install zabbix-server-mysql -y on zabbix-server
In the /usr/share/doc/zabbix-server-mysql-4.0.5/, can be obtained create.sql.gz, before sending it to the server1 under devops.
1.2 zabbix-server
1、tasks
2、handlers
3、templates
On server2, will be sent to server1 zabbix_server.conf under devops
templates directory is placed in the template, so to change the file name suffix .j2
Change the configuration file
1.3 zabbix-agent
1、tasks
2、handlers
3、templates
On server2, will be sent to server1 zabbix_agentd.conf under devops
Change the file zabbix_agentd.conf.j2
1.4 zabbix-web
1、tasks
2、handlers
3、templates
On server3, installation zabbix-web-server, will send his past
Change the template file
1.5 zibbix.yml file
1、test : ansible-playbook zibbix.yml
2、Web access http://172.25.2.3/zabbix
Found error, Troubleshooting ideas:
- selinux whether the disabled;
- Setting the firewall
- Whether the host security database initialization
- When import zabbix database, login to write the playbook in and login password (login_user login_passwd)
- Users zabbix created to be landed in the playbook written in the user login and password (login_user login_passwd), authorization and password
- zabbix_server profile DBhost configuration file is correct