在虚拟机安装zabbix

实验材料:centos_template.rar、k8s_docker.vmdk
zabbix版本:3.4
1.配置本地yum仓库
mount /dev/sdb2 /var/www/html/materials
systemctl starts httpd
systemctl enable httpd
curl http://localhost/materials/materials/
cp /var/www/html/materials/materials/repo.repo /etc/yum.repos.d/
yum repolist
2.安装zabbix、mariadb包
yum install -y zabbix-
yum install -y mariadb

3.修改数据库配置文件
cat /etc/my.cnf
增加以下内容
[mysqld]
innodb_file_per_table=1
character-set-server=utf8
systemctl start mariadb
systemctl enable mariadb
4.数据库初始化
mysql_secure_installation #配置数据库密码,根据向导输入5个y
mysql -uroot -pTesting@123
mysql -uroot -pTesting@123 -e "create database zabbix character set utf8"
mysql -uroot -pTesting@123 -e "grant all privileges on zabbix.* to zabbix@'%' identified by 'zabbix';"
mysql -uroot -pTesting@123 -e "flush privileges;"
rpm -qa |grep zabbix
rpm -ql zabbix-server-mysql-3.4.11-1.el7.x86_64
mkdir zabbix
cd zabbix/
cp /usr/share/doc/zabbix-server-mysql-3.4.11/create.sql.gz .
zcat create.sql.gz |mysql -uzabbix -pzabbix zabbix
mysql -uzabbix -pzabbix zabbix
5.修改zabbix配置文件
vim /etc/zabbix/zabbix_server.conf
DBPassword=zabbix
vim /etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Shanghai
systemctl restart httpd
systemctl restart zabbix-server
systemctl enable zabbix-server
6.访问zabbix首页
在浏览器打开并做初始化的操作:http://192.168.222.129/zabbix/
用户名/密码:admin/zabbix

猜你喜欢

转载自blog.51cto.com/4708948/2478484