mysql,php,tengine 安裝包和表分區腳本下載:https://pan.baidu.com/s/1o80fF8Aphp
ip:192.168.106.149前端
關閉selinux,iptablesjava
# setenforce 0mysql
# service iptables stop && chkconfig iptables offlinux
安裝epel源nginx
# yum install epel-release -ysql
安裝依賴包服務器
# yum install mysql-devel libcurl-devel libxml2-devel net-snmp-devel java-1.8.0-openjdk java-1.8.0-openjdk-devel -yapp
修改時區frontend
# \cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
下載並編譯安裝 zabbix server 3.2.3
# mkdir -p /data/packages && cd /data/packages && wget https://nchc.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.2.3/zabbix-3.2.3.tar.gz && tar xzvf zabbix-3.2.3.tar.gz && cd zabbix-3.2.3
# ./configure --prefix=/data/app/zabbix3.2.3/ --with-mysql --enable-server --enable-agent --enable-java --with-net-snmp --with-libcurl --with-libxml2
# make install
# cp misc/init.d/fedora/core5/zabbix_server /etc/init.d/
# chmod 755 /etc/init.d/zabbix_server
# sed -i 's/\/usr\/local\/sbin\/zabbix_server/\/data\/app\/zabbix3.2.3\/sbin\/zabbix_server/' /etc/init.d/zabbix_server
添加zabbix用戶
# useradd -s /sbin/nologin zabbix
修改zabbix server配置文件
# vi /data/app/zabbix3.2.3/etc/zabbix_server.conf
略,請執行調整修改
啓動zabbix server
# service zabbix_server start
查看zabbix server狀態
# service zabbix_server status
zabbix_server (pid 82433 82432 82431 82430 82425 82424 82423 82422 82418 82417 82416 82415 82414 82411 82410 82409 82408 82407 82406 82405 82404 82403 82402 82401 82400 82399 82398 82396) is running...
# tar xzvf mysql-5.6_install_scripts.tar.gz && cd mysql-5.6
# sh install.sh
# mysql -e "create database zabbix"
# mysql -e "grant all privileges on *.* to zabbix@'%' identified by 'zabbixpassword';"
依次導入結構和數據
# mysql zabbix < /data/packages/zabbix-3.2.3/database/mysql/schema.sql
# mysql zabbix < /data/packages/zabbix-3.2.3/database/mysql/images.sql
# mysql zabbix < /data/packages/zabbix-3.2.3/database/mysql/data.sql
修改root密碼
# mysql mysql -e "update user set password=password('password') where user='root';flush privileges;"
# cp -a /data/packages/zabbix-3.2.3/frontends/php /data/app/zabbix3.2.3/
上傳tengine和php安裝包,不要使用yum安裝,yum安裝php版本太低,不受支持
# tar xzvf php.tar.gz
# tar xzvf tengine-2.1.tar.gz
# cd php-5.6.10/ && sh install-php-5.6.10.sh
# cd .. && tar xzvf tengine-2.1.tar.gz && install.sh
# ldconfig
# cd /data/app/tengine/conf/vhost/
配置nginx站點,注意根據訪問的域名修改server_name
# vi zabbix.conf
server{ listen 80; server_name 192.168.106.149; access_log /data/app/tengine/logs/zabbix.access; error_log /data/app/tengine/logs/zabbix.error error; location ~ .php$ { root /data/app/zabbix3.2.3/php; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } location / { root /data/app/zabbix3.2.3/php; index index.php; } }
啓動php-fpm
# php-fpm
啓動nginx
# nginx -t && nginx
訪問http://192.168.106.149/安裝前端 發現報了一堆php參數錯誤
修改php.ini中以下參數
# vi /data/app/php/etc/php.ini
post_max_size = 16M max_execution_time = 300 max_input_time = 300 date.timezone = Asia/Shanghai always_populate_raw_post_data = -1
重啓php-fpm
# killall php-fpm && php-fpm
繼續配置zabbix前端
###表分區
執行腳本生成建立表分區sql
# sh showsql.sh
crontab腳本天天自動去建立分區
# sh add_partition.sh