zabbix-server-mysql安装_zabbix-server 5.0.2 install

本文详细指导了如何在Linux上安装Zabbix 5.0.2,涉及MySQL数据库配置、PHP版本升级、Nginx代理及MySQL数据库权限设置。重点在于创建zabbix数据库和调整PHP配置以支持大规模监控需求。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

zabbix-server 5.0.2 install

2020-08-20

Zabbix用户界面也得到了改进,以支持监控和管理数百万受监控设备。

1、安装zabbix 5.0.2

rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/8/x86_64/zabbix-release-5.0-1.el8.noarch.rpm

dnf install zabbix-server-mysql zabbix-web-mysql zabbix-nginx-conf zabbix-agent

2、安装php7.3

dnf install dnf-utils http://rpms.remirepo.net/enterprise/remi-release-8.rpm

dnf module reset php

dnf module enable php:remi-7.3

#默认设置为remi-7.3版本

yum -y install php php-mysqlnd php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc php-zip

vi /etc/php.ini

post_max_size = 16M

max_execution_time = 300

max_input_time = 300

date.timezone =Asia/Shanghai

vi /etc/php-fpm.conf

[www]

user = www

group = www

listen = 127.0.0.1:9002

pm = dynamic

pm.max_children = 200

pm.start_servers = 10

pm.min_spare_servers = 10

pm.max_spare_servers = 90

3、安装mysql8

yum -y install mysql-server mysql

systemctl start mysqld

pw=$(cat /var/log/mysqld.log|grep root|awk '{print $NF}')

export MYSQL_PWD='06(s7dI=2XHy'

mysql --connect-expired-password -uroot -Dmysql -e"alter USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'item-123456';"

mysql --connect-expired-password -uroot -Dmysql -e"FLUSH PRIVILEGES;"

4、创建数据库

mysql -uroot -ppasswordmysql> create database zabbix character set utf8 collate utf8_bin;mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'password';mysql> quit;zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix

5、cp /usr/share/zabbix/conf/zabbix.conf.php.example /etc/zabbix/web/zabbix.conf.php

chown -R www.www /etc/zabbix

$DB['TYPE']                             = 'MYSQL';

$DB['SERVER']                   = '172.16.2.1';

$DB['PORT']                             = '3306';

$DB['DATABASE']                 = 'zabbixdb';

$DB['USER']                             = 'zabbixuser';

$DB['PASSWORD']                 = 'db123456';

6、nginx配置

server{

listen  80;

server_name zabbix.wallcopper.com;

location / {

root /usr/share/zabbix;

index  index.php index.htm index.html;

#include proxy.conf;

}

location ~ \.php$ {

root /usr/share/zabbix;

fastcgi_pass   127.0.0.1:9002;

fastcgi_index  index.php;

fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

include        fastcgi_params;

}

}

分类:Linux | 标签: |

相关日志

version: "3.8" networks: zabbix-net: driver: bridge ipam: config: - subnet: 172.20.0.0/24 services: mysql-server: image: mysql:8.0.36 container_name: mysql-server restart: unless-stopped environment: MYSQL_DATABASE: zabbix MYSQL_USER: zabbix MYSQL_PASSWORD: Zmsl@123 MYSQL_ROOT_PASSWORD: Zmsl@123 TZ: Asia/Shanghai command: > --default-authentication-plugin=mysql_native_password --character-set-server=utf8 --collation-server=utf8_bin volumes: - mysql_data:/var/lib/mysql - mysql_logs:/var/log/mysql - mysql_conf:/etc/mysql/conf.d ports: - "3306:3306" networks: zabbix-net: ipv4_address: 172.20.0.10 zabbix-java-gateway: image: zabbix/zabbix-java-gateway:alpine-6.2-latest container_name: zabbix-java-gateway restart: unless-stopped environment: TZ: Asia/Shanghai networks: zabbix-net: ipv4_address: 172.20.0.20 zabbix-server-mysql: image: zabbix/zabbix-server-mysql:6.2-alpine-latest container_name: zabbix-server-mysql restart: unless-stopped depends_on: - mysql-server - zabbix-java-gateway environment: DB_SERVER_HOST: mysql-server MYSQL_DATABASE: zabbix MYSQL_USER: zabbix MYSQL_PASSWORD: Zmsl@123 MYSQL_ROOT_PASSWORD: Zmsl@123 ZBX_JAVAGATEWAY: zabbix-java-gateway ZBX_JAVAGATEWAY_TIMEOUT: 30 ZBX_START_POLLERS: 5 ZBX_START_POLLERS_UNREACHABLE: 1 TZ: Asia/Shanghai volumes: - /data/zabbix/alertscripts:/usr/lib/zabbix/alertscripts:ro - zabbix_server:/etc/zabbix - /data/zabbix/server:/var/lib/zabbix - /data/zabbix/log:/var/log/zabbix ports: - "10051:10051" networks: zabbix-net: ipv4_address: 172.20.0.30 zabbix-web-nginx-mysql: image: zabbix/zabbix-web-nginx-mysql:alpine-6.2-latest container_name: zabbix-web-nginx-mysql restart: unless-stopped depends_on: - mysql-server - zabbix-server-mysql environment: PHP_TZ: Asia/Shanghai ZBX_SERVER_HOST: zabbix-server-mysql DB_SERVER_HOST: mysql-server MYSQL_DATABASE: zabbix MYSQL_USER: zabbix MYSQL_PASSWORD: Zmsl@123 MYSQL_ROOT_PASSWORD: Zmsl@123 ports: - "7099:8080" networks: zabbix-net: ipv4_address: 172.20.0.40 zabbix-agent: image: zabbix/zabbix-agent:alpine-6.2-latest container_name: zabbix-agent restart: unless-stopped environment: ZBX_HOSTNAME: zabbix-server-docker ZBX_SERVER_HOST: zabbix-server-mysql ZBX_SERVER_PORT: 10051 ZBX_PASSIVE_ALLOW: "true" ZBX_ACTIVE_ALLOW: "true" volumes: - zabbix_agent:/etc/zabbix ports: - "10050:10050" networks: zabbix-net: ipv4_address: 172.20.0.50 cap_add: - NET_RAW - NET_ADMIN volumes: mysql_data: mysql_logs: mysql_conf: zabbix_server: zabbix_agent:
最新发布
08-20
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值