本篇内容介绍了“Zabbix监控的安装部署过程”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!
一、安装Zabbix部署所需依赖包
二、安装nginx
#useradd nginx #tar zxvf nginx-1.9.15.tar.gz && cd nginx-1.9.15 #./configure --prefix=http://www.yisu.com/usr/local/nginx --user=nginx --group=nginx --with-http_ssl_module --with-http_v2_module --with-http_stub_status_module --with-pcre #make && make install三、安装PHP
1.编译安装PHP
#tar zxvf php-5.5.35.tar.gz && cd php-5.5.35 #./configure --prefix=http://www.yisu.com/usr/local/php --with-config-file-path=http://www.yisu.com/usr/local/php/etc --with-bz2 --with-curl --enable-ftp --enable-sockets --disable-ipv6 --with-gd --with-jpeg-dir=http://www.yisu.com/usr/local --with-png-dir=http://www.yisu.com/usr/local --with-freetype-dir=http://www.yisu.com/usr/local --enable-gd-native-ttf --with-iconv-dir=http://www.yisu.com/usr/local --enable-mbstring --enable-calendar --with-gettext --with-libxml-dir=http://www.yisu.com/usr/local --with-zlib --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-mysql=mysqlnd --enable-dom --enable-xml --enable-fpm --with-libdir=lib64 --enable-bcmath #make && make install #cp php.ini-production /usr/local/php/etc/php.ini #cd /usr/local/php/etc/ #cp php-fpm.conf.default php-fpm.conf2.编辑/usr/local/php/etc/php.ini(zabbix环境需要修改的参数)
max_execution_time = 300 memory_limit = 128M post_max_size = 16M upload_max_filesize = 2M max_input_time = 300 date.timezone = “Asia/Shanghai”四、安装Mysql
1.编译安装mysql
#groupadd mysql #mkdir -p /usr/share/mysql/data #useradd -r -g mysql -d /usr/share/mysql/data -s /sbin/nologin mysql #chown -R mysql.mysql /usr/share/mysql/data #tar zxvf mysql-5.5.49.tar.gz && cd mysql-5.5.49 #cmake -DCMAKE_INSTALL_PREFIX=http://www.yisu.com/usr/local/mysql -DDEFAULT_CHARSET=utf8 -DENABLED_LOCAL_INFILE=1 -DMYSQL_DATADIR=http://www.yisu.com/usr/share/mysql/data -DWITH_EXTRA_CHARSETS=all -DWITH_READLINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_TCP_PORT=3306 -DDEFAULT_COLLATION=utf8_general_ci #make && make install #chown -R mysql.mysql /usr/local/mysql #cd /usr/local/mysql/support-files/ #cp my-medium.cnf /usr/share/mysql/data/my.cnf #cp mysql.server /etc/init.d/mysqld #chmod +x /etc/init.d/mysqld #cd /usr/local/mysql/scripts #./mysql_install_db --user=mysql --basedir=http://www.yisu.com/usr/local/mysql/ --datadir=http://www.yisu.com/usr/share/mysql/data2.编辑/usr/share/mysql/data/my.cnf
datadir = /usr/share/mysql/data3.启动mysql服务
#/etc/init.d/mysqld4.登录数据库,创建zabbix数据库及用户名和密码:
mysql> create database zabbix default charset utf8; Query OK, 1 row affected (0.00 sec) mysql> grant all privileges on zabbix.* to zabbix@'localhost' identified by '123456'; Query OK, 0 rows affected (0.03 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> show databases;5.创建数据库root用户密码:
#mysqladmin -uroot password "123456"五、安装zabbix server
1.编译安装zabbix server
#tar zxvf zabbix-3.0.0.tar.gz && cd zabbix-3.0.0 #./configure --prefix=http://www.yisu.com/usr/local/zabbix --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-libxml2 #make && make install #groupadd zabbix #useradd -r -g zabbix -s /sbin/nologin zabbix #mysql -uroot -p123456 zabbix < database/mysql/schema.sql #mysql -uroot -p123456 zabbix < database/mysql/images.sql #mysql -uroot -p123456 zabbix < database/mysql/data.sql #mkdir /usr/share/data/web/zabbix -p #mkdir /usr/share/data/logs/zabbix -p #cp -rp frontends/php/* /usr/share/data/web/zabbix/ #mkdir /usr/local/nginx/conf/extra2.编辑/usr/local/nginx/conf/extra/zabbix.conf
3.编辑/usr/local/nginx/conf/nginx.conf
郑重声明:本文版权归原作者所有,转载文章仅为传播更多信息之目的,如作者信息标记有误,请第一时间联系我们修改或删除,多谢。