选择您Zabbix服务器的平台
Install Zabbix repository
[root@ip-10-1-9-117 ~]# rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm [root@ip-10-1-9-117 ~]# yum clean all
Install Zabbix server and agent
[root@ip-10-1-9-117 ~]# yum install zabbix-server-mysql zabbix-agent
Install Zabbix frontend
[root@ip-10-1-9-117 ~]# yum install centos-release-scl
编辑配置文件 /etc/yum.repos.d/zabbix.repo and enable zabbix-frontend repository.
[zabbix-frontend] ... enabled=1 ...
Install Zabbix frontend packages.
[root@ip-10-1-9-117 centos]# yum install zabbix-web-mysql-scl zabbix-nginx-conf-scl
安装数据库
yum安装mysql8.0
[root@ip-10-1-9-117 ~]# rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 [root@ip-10-1-9-117 ~]# yum localinstall https://repo.mysql.com//mysql80-community-release-el7-1.noarch.rpm [root@ip-10-1-9-117 ~]# yum install mysql-community-server [root@ip-10-1-9-117 ~]# systemctl start mysqld [root@ip-10-1-9-117 ~]# systemctl enable mysqld
修改密码
[root@ip-10-1-9-117 ~]# grep "A temporary password" /var/log/mysqld.log 2022-05-23T14:19:15.000395Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: kp_s;juwu5-O [root@ip-10-1-9-117 ~]# mysql -uroot -p Enter password: mysql> select version(); ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement. mysql> alter user 'root'@'localhost' identified by 'Root@123456'; Query OK, 0 rows affected (0.01 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec)
创建初始数据库
mysql> create database zabbix character set utf8 collate utf8_bin; mysql> create user zabbix@localhost identified by 'Root@1password'; Query OK, 0 rows affected (0.01 sec) mysql> grant all privileges on zabbix.* to zabbix@localhost; Query OK, 0 rows affected (0.00 sec) mysql> quit; Bye
导入初始架构和数据,系统将提示您输入新创建的密码
[root@ip-10-1-9-117 ~]# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix Enter password:
为Zabbix server配置数据库
[root@ip-10-1-9-117 ~]# vim /etc/zabbix/zabbix_server.conf DBPassword=Root@1password
为Zabbix前端配置PHP
编辑配置文件 /etc/opt/rh/rh-nginx116/nginx/conf.d/zabbix.conf, uncomment and set 'listen' and 'server_name' directives.
[root@ip-10-1-9-117 ~]# vim /etc/opt/rh/rh-nginx116/nginx/conf.d/zabbix.conf listen 80; server_name test-zabbix.lingoace.com;
编辑配置文件 /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf, add nginx to listen.acl_users directive.
[root@ip-10-1-9-117 ~]# vim /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf listen.acl_users = apache,nginx php_value[date.timezone] = Asia/Shanghai
启动Zabbix server和agent进程
[root@ip-10-1-9-117 zabbix]# systemctl restart zabbix-server zabbix-agent rh-nginx116-nginx rh-php72-php-fpm [root@ip-10-1-9-117 zabbix]# systemctl enable zabbix-server zabbix-agent rh-nginx116-nginx rh-php72-php-fpm
配置Zabbix前端
- 连接到新安装的Zabbix前端: http://server_ip_or_name
系统默认的用户名:Admin
系统默认密码:zabbix
继续阅读
评论