yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum install yum-utils -y
# 安装底层依赖
yum -y install gcc-c++ mysql-devel net-snmp-devel libevent-devel harfbuzz libxml2 libxml2-devel mtr bc telnet yum-utils curl-devel
# 选择php版本
yum-config-manager --enable remi-php74
# 安装php及扩展
yum -y install php php-cli php-common php-gd php-json php-ldap php-mbstring php-mysqlnd php-pdo php-xml \
php-devel php-embedded php-mcrytp php-pecl-mongodb php-pecl-redis php-pecl-memcached php-opcache php-fpm
# 查看php版本及扩展信息
php -v
php -m
#下载MySQL源
wget https://dev.mysql.com/get/mysql80-community-release-el7-5.noarch.rpm
#配置MySQL源
yum -y install mysql80-community-release-el7-5.noarch.rpm
# 安装MySQL相关依赖
yum -y install gcc-c++ mysql-devel net-snmp-devel libevent-devel
# 安装mysql
yum install -y mysql-community-libs-compat-8.0.30-1.el7.x86_64 \
mysql-community-common-8.0.30-1.el7.x86_64 \
mysql-community-libs-8.0.30-1.el7.x86_64 \
mysql-community-client-8.0.30-1.el7.x86_64 \
mysql-community-server-8.0.30-1.el7.x86_64 \
mysql-community-devel-8.0.30-1.el7.x86_64 \
mysql-community-client-plugins-8.0.30-1.el7.x86_64 \
mysql-community-icu-data-files-8.0.30-1.el7.x86_64
# 文件路径: /etc/my.cnf
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/8.0/en/server-configuration-defaults.html
[mysqld]
datadir=/data/mysql
socket=/var/lib/mysql/mysql.sock
pid-file=/var/run/mysqld/mysqld.pid
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
innodb_file_per_table=1
log-error=/var/log/mysqld.log
max_connections=2000
max_allowed_packet=16M
max_connect_errors=400
tmp_table_size = 32M
innodb_buffer_pool_size=8G
!includedir /etc/my.cnf.d
systemctl start mysqld
systemctl enable mysqld
# 查看初始密码
cat /var/log/mysqld.log |grep 'A temporary password is generate'
# 设置密码
mysql -uroot -p
ALTER USER 'root'@'localhost' IDENTIFIED BY 'your password';
# 由于MySQL8.0 有密码验证组件,若希望设置简单的密码,需要修改服务验证条件
# 密码检查等级,0/LOW、1/MEDIUM、2/STRONG
set global validate_password.policy=0;
# 密码的最短长度
set global validate_password.length=6;
# 密码至少要包含的小写字母个数和大写字母个数
set global validate_password.mixed_case_count=0;
wget https://cdn.zabbix.com/zabbix/sources/stable/6.0/zabbix-6.0.6.tar.gz
# 创建zabbix组
groupadd zabbix
# 创建zabbix用户
useradd -g zabbix -M -s /sbin/nologin zabbix
# 创建zabbix目录
mkdir /usr/local/zabbix
# 解压
tar -zxvf zabbix-6.0.6.tar.gz -C /usr/local/zabbix/
# 移动到zabbix目录
cd /usr/local/zabbix/zabbix-6.0.6/
# 编译
./configure --prefix=/usr/local/zabbix \
--enable-server \
--enable-agent \
--enable-proxy \
--with-mysql \
--enable-ipv6 \
--with-net-snmp \
--with-libcurl \
--with-libxml2
# 编译二
make install
# 创建zabbix库
create database zabbix_proxy character set utf8mb4 collate utf8mb4_bin;
# 创建zabbix用户
create user zabbix@localhost identified by 'Zabbix@123';
# 授权
grant all privileges on zabbix_proxy .* to zabbix@localhost;
# 导入初始表
mysql -uzabbix -pZabbix@123 zabbix_proxy </usr/local/zabbix/zabbix-6.0.6/database/mysql/schema.sql
Server=212.129.239.109:10051
Hostname=x2-global-hk-proxy
LogFile=/var/log/zabbix/zabbix_proxy.log
LogFileSize=0
PidFile=/usr/local/zabbix/zabbix_proxy.pid
SocketDir=/usr/local/zabbix
DBHost=localhost
DBName=zabbix_proxy
DBUser=zabbix
DBPassword=Zabbix@123
ConfigFrequency=600
DataSenderFrequency=3
StartPollers=100
StartDBSyncers=5
Timeout=5
ExternalScripts=/usr/local/zabbix/share/zabbix/externalscripts
LogSlowQueries=3000
#权限
chown -R zabbix. /var/log/zabbix/
chown -R zabbix. /usr/local/zabbix/
# 启动
/usr/local/zabbix/sbin/zabbix_proxy