In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
1. Zabbix3.0 experimental environment
Nginx:1.10.2Mysql: 5.6.33PHP:5.6.12Zabbix:3.0.5Zabbix_server_IP: 192.168.10.150 (based on LNMP) Zabbix_client_IP: 192.168.10.106
two。 Prepare the environment LAMP
# change the download source wget-O / etc/yum.repos.d/CentOS-Base.repo yum clean allyum makecache# Clean the installed package rpm-e httpd mysql phpyum remove-y httpd php mysql*# download the NMP source package wget-P / tmp http://nginx.org/download/nginx-1.10.2.tar.gzwget-P / tmp http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.33.tar.gzwget-P / tmp http://mirrors.sohu.com/php/php-5.6.12.tar.gz# downloads the dependency package yum install-y gcc gcc-c++ ncurses-devel for the compilation environment
3. Install mysql
# create mysql users and groups, do not allow login and do not create a home directory (if prompted by the user, modify the command is usermod) groupadd mysqluseradd-s / sbin/nologin-g mysql-m mysql# install cmake (Mysql from version 5.5. / configure configuration has been cancelled So you need to install the cmake tool) # tar-zxvf cmake-2.18.2.2.tar.gz-C / optcd / opt/cmake-2.18.2.2./configuremake & & make install# uses cmake to compile and install mysql, if prompted that a package is missing Delete CMakeCache.txt after installing a package and rerun cmaketar-zxvf / tmp/mysql-5.6.33.tar.gz-C / opt/cd / opt/mysql-5.6.33cmake\-DCMAKE_INSTALL_PREFIX=/usr/local/mysql\-DMYSQL_DATADIR=/usr/local/mysql/data\-DSYSCONFDIR=/etc\-DWITH_MYISAM_STORAGE_ENGINE=1\-DWITH_INNOBASE_STORAGE_ENGINE=1\-DWITH_MEMORY_STORAGE_ENGINE=1\-DWITH_READLINE=1\-DMYSQL_UNIX_ADDR=/var/ Lib/mysql/mysql.sock\-DMYSQL_TCP_PORT=3306\-DENABLED_LOCAL_INFILE=1\-DWITH_PARTITION_STORAGE_ENGINE=1\-DEXTRA_CHARSETS=all\-DDEFAULT_CHARSET=utf8\-DDEFAULT_COLLATION=utf8_general_ci\-DMYSQL_USER=mysql\-DWITH_DEBUG=0\-DWITH_SSL=system make & & make install# modify / usr/local/mysql permission chmod + w / usr/local/mysqlchown-R mysql:mysql / usr/local/mysql# copy profile cp. / support-files/my-default.cnf / etc/my.cnf# initialization database / usr/local/mysql/scripts/mysql_install_db-- defaults-file=/etc/my.cnf-- basedir=/usr/local/mysql-- datadir=/usr/local/mysql/data-- user=mysql# copy startup file Set boot cp support-files/mysql.server / etc/init.d/mysqldchmod + x / etc/init.d/mysqldchkconfig mysqld on/etc/init.d/mysqld startecho 'export PATH=$PATH:/usr/local/mysql/bin/' > > / etc/profile# default login does not require a password, you need to set a root password mysqladmin-uroot-p password' Admin123'# to view the user select user,host from mysql.user in the database # remove the unnecessary remote access permission granted to the account by drop user root@'::1';# *. * TO 'root'@'127.0.0.1' IDENTIFIED BY' your password 'WITH GRANT OPTION;GRANT ALL PRIVILEGES ON *. * TO' root'@'localhost' IDENTIFIED BY 'your password' WITH GRANT OPTION;GRANT ALL PRIVILEGES ON *. * TO 'root'@'zabbix' IDENTIFIED BY' your password 'WITH GRANT OPTION # check the database version mysql-uroot-p "password"-e "select version ();"
4. Install php
# download php dependency package yum install-y libxml2-devel openssl-devel libcurl-devel libjpeg-turbo-devel libpng-devel freetype-devel libmcrypt-devel# extract php package tar-zxvf / tmp/php-5.6.12.tar.gz-C / optcd / opt/php-5.6.12./configure-- prefix=/usr/local/php\-- with-config-file-path=/usr/local/php/etc\-- enable-fpm\-- with-fpm-user=www\- -with-fpm-group=www\-- with-mysql=mysqlnd\-- with-mysqli=mysqlnd\-- with-pdo-mysql=mysqlnd\-- with-iconv-dir\-- with-freetype-dir\-- with-jpeg-dir\-- with-png-dir\-- with-zlib\-- with-libxml-dir=/usr\-- enable-xml\-- disable-rpath\-- enable-bcmath\-enable-shmop\-enable-sysvsem\-enable-inline-optimization\-- with-curl\-- -enable-mbregex\-- enable-mbstring\-- with-mcrypt\-- enable-ftp\-- with-gd\-- enable-gd-native-ttf\-- with-openssl\-- with-mhash\-- enable-pcntl\-- enable-sockets\-- with-xmlrpc\-- enable-zip\-- enable-soap\-- without-pear\-- with-gettext\-- disable-fileinfo\-- enable-maintainer-ztsmake & make install# modify fpm configuration php-fpm .conf.default name mv / usr/local/php/etc/php-fpm.conf.default / usr/local/php/etc/php-fpm.conf# copy php.ini configuration file cp php.ini-production / usr/local/php/etc/php.ini# copy startup script to init.d cp sapi/fpm/init.d.php-fpm / etc/init.d/php-fpmchmod + x! $# add startup item chkconfig php-fpm on# according to the above standard Create users and user groups for php groupadd wwwuseradd-s / sbin/nologin-g www-M www# launch php-fpmservice php-fpm start
5. Install nginx
# to install the nginx dependency package, we usually need to install pcre and zlib first. The former is to rewrite rewrite. The latter starts to install nginxtar-zxvf / tmp/nginx-1.10.2.tar.gz-C / optcd / opt/nginx-1.10.2./configure-- prefix=/usr/local/nginx\-- pid-path=/usr/local/nginx/nginx.pid\-- error-log-path=/usr/local/nginx/error.log\-- http-log-path=/usr/local/nginx/access.log\-- with for gzip compression yum install zlib-devel pcre-devel#. -http_ssl_module-- with-mail\-- with-mail_ssl_module-- with-stream\-- with-threadsmake & & make install# edits the nginx configuration file vim / usr/local/nginx/conf/nginx.conf if nginx cannot parse the php file The visit is 404. Modify this paragraph to the following location ~\ .php$ {root / usr/local/nginx/www; fastcgi_pass 127.0.0.1 root 9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # fastcgi_param SCRIPT_FILENAME / scripts$fastcgi_script_name; include fastcgi_params } # Edit the nginx startup script vim / ETC _ init. D _ HTTP (S) reverse\ # proxy and IMAP/POP3 proxy server# processname: nginx# config: / etc/nginx/nginx.conf# config: / etc/sysconfig/nginx# pidfile: / var/run/nginx.pid# Source function library.. / etc/rc.d/init.d/functions# Source networking configuration.. / etc/sysconfig/network# Check that networking is up. ["$NETWORKING" = "no"] & & exit 0nginx = "/ usr/local/nginx/sbin/nginx" prog=$ (basename $nginx) sysconfig= "/ etc/sysconfig/$prog" lockfile= "/ var/lock/subsys/nginx" pidfile= "/ usr/local/nginx/nginx.pid" NGINX_CONF_FILE= "/ usr/local/nginx/conf/nginx.conf" [- f $sysconfig] &. $sysconfigstart () {[- x $nginx] | | exit 5 [- f $NGINX_CONF_FILE] | | exit 6 echo-n $"Starting $prog:" daemon $nginx-c $NGINX_CONF_FILE retval=$? Echo [$retval-eq 0] & & touch $lockfile return $retval} stop () {echo-n $"Stopping $prog:" killproc-p $pidfile $prog retval=$? Echo [$retval-eq 0] & & rm-f $lockfile return $retval} restart () {configtest_q | | return 6 stop start} reload () {configtest_q | | return 6 echo-n $"Reloading $prog:" killproc-p $pidfile $prog-HUP echo} configtest () {$nginx-t-c $NGINX_CONF_FILE} configtest_q () {$nginx-t-Q-c $NGINX_CONF_FILE} rh_status () {status $prog} rh_status_q () {rh_status > / dev/null 2 > & 1} # Upgrade the binary with no downtime.upgrade () {local oldbin_pidfile= "${pidfile} .oldbin" configtest_q | | return 6 echo-n $"Upgrading $prog:" killproc-p $pidfile $prog-USR2 retval=$? Sleep 1 if [[- f ${oldbin_pidfile} & &-f ${pidfile}]] Then killproc-p $oldbin_pidfile $prog-QUIT success $"$prog online upgrade" echo return 0 else failure $"$prog online upgrade" echo return 1 fi} # Tell nginx to reopen logsreopen_logs () {configtest_q | | return 6 echo-n $"Reopening $prog logs:" killproc-p $pidfile $prog-USR1 retval=$? Echo return $retval} case "$1" in start) rh_status_q & & exit 0 $1; stop) rh_status_q | | exit 0 $1;; restart | configtest | reopen_logs) $1;; force-reload | upgrade) rh_status_q | | exit 7 upgrade;; reload) rh_status_q | | exit 7 $1 | ; status | status_q) rh_$1;; condrestart | try-restart) rh_status_q | | exit 7 restart;; *) echo $"Usage: $0 {start | stop | reload | configtest | status | force-reload | upgrade | reopen_logs}" exit 2esac# launches nginxchmod + x / etc/init.d/nginxservice nginx startchkconfig nginx on# to test whether php access is normal vim / usr/local/nginx/www/phpinfo.phpcurl localhost/phpinfo.php-I.
6. Compile and install zabbix3.0.5
Tar-zxvf / tmp/zabbix-3.0.5.tar.gz-C / optcd / opt/zabbix-3.0.5# create zabbix process user and group groupadd zabbixuseradd-s / sbin/nologin-g zabbix- M zabbix# download dependency package yum install-y net-snmp-devel libssh3-devel# start installing zabbix./configure-- prefix=/usr/local/zabbix\-- enable-server-- enable-agent\-- with-mysql-- with-net-snmp\-- -with-libcurl-- with-libxml2\-- with-ssh3make & & make install# verify installation result / usr/local/zabbix/sbin/zabbix_server-V detected an error: error while loading shared libraries: libmysqlclient.so.18:ln-s / usr/local/mysql/lib/libmysqlclient.so.18 / usr/lib64/libmysqlclient.so.18/usr/local/zabbix/sbin/zabbix_server-V/usr/local/zabbix/sbin/zabbix_agentd-Vnetstat-lnp | grep zabbix# if the server side is not started Check log file / tmp/zabbix_server.log# modification / usr/local/zabbix/etc/zabbix_server.conf configuration file database connection [root@zabbix_server ~] # egrep-v "^ # | ^ $" / usr/local/zabbix/etc/zabbix_server.confLogFile=/tmp/zabbix_server.logDBHost=127.0.0.1DBName=zabbixDBUser=zabbixDBSocket=/var/lib/mysql/mysql.sockDBPassword=Admin123DBPort=3306Timeout=4LogSlowQueries=3000# configuration zabbix database mysql-uroot-p-e 'create database zabbix '# create a database authorized user. Only allow the 192.168.0.0 network segment to log in to mysql-uroot-p-e "grant all privileges on zabbix.* to zabbix@'192.168.%' identified by' Admin123';" mysql-uroot-p-e "grant all privileges on zabbix.* to zabbix@'127.0.0.1' identified by 'Admin123';" mysql-uroot-p-e "flush privileges "# Import the zabbix database, and the file is mysql-u zabbix-p-h 192.168.10.150 zabbix in the database under the decompression package
< database/mysql/schema.sqlmysql -u zabbix -p -h 192.168.10.150 zabbix < database/mysql/p_w_picpaths.sqlmysql -u zabbix -p -h 192.168.10.150 zabbix < database/mysql/data.sql# 查看zabbix是否有数据 mysql -u zabbix -p -h 192.168.10.150 -e "show tables from zabbix;" ## 添加启动脚本cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d/zabbix_agentdcp misc/init.d/fedora/core/zabbix_server /etc/init.d/zabbix_server# 修改启动脚本sed -i "s#BASEDIR=/usr/local#BASEDIR=/usr/local/zabbix#g" /etc/init.d/zabbix_serversed -i "s#BASEDIR=/usr/local#BASEDIR=/usr/local/zabbix#g" /etc/init.d/zabbix_agentd# 修改zabbix配置文件(/usr/local/zabbix/etc/zabbix_server.conf)# 添加到开机启动chmod +x /etc/init.d/zabbix_serverchmod +x /etc/init.d/zabbix_agentdchkconfig zabbix_server --level 35 onchkconfig zabbix_agentd --level 35 on# 拷贝网页到nginx目录下cp -rfp frontends/php/* /usr/local/nginx/zabbix/ -Rchown -R root:root /usr/local/nginx/zabbix# 修改nginx配置文件为如下(/usr/local/nginx/nginx.conf) server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { # root zabbix; root /usr/local/nginx/zabbix; index index.php index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } location ~ \.php$ { root /usr/local/nginx/zabbix; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; #fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; include fastcgi_params; }# 重新加载nginx(/etc/init.d/nginx reload) 7. zabbix界面安装 界面检查配置出错 错误1: Minimum required size of PHP post is 16M (configuration option "post_max_size"). Minimum required limit on execution time of PHP scripts is 300 (configuration option "max_execution_time"). Minimum required limit on input parse time for PHP scripts is 300 (configuration option "max_input_time"). Time zone for PHP is not set (configuration parameter "date.timezone"). PHP option "always_populate_raw_post_data" must be set to "-1" 这一步默认的php.ini一般都有错误: 修改/usr/local/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即可 #/etc/init.d/php-fpm56 restart 错误2: Install Cannot create the configuration file. Details Unable to create the configuration file. 下载那个页面,然后上传到/usr/local/nginx/zabbix/conf下(网页有提升具体路径) 8. 配置中文支持 左上角倒数第二个图标---language---Chinese(zh_CN) 9. 配置图片中文支持 将/usr/local/nginx/zabbix/include/defines.inc.php 第45行改为 define('ZBX_GRAPH_FONT_NAME', 'simkai'); // font file name 第93行改为 define('ZBX_FONT_NAME', 'simkai'); 1)从windows控制面板->Font > Select a Chinese font such as "italics"
2) copy the font to / usr/local/nginx/zabbix/fonts
3) finally set it in the user
Zabbix web page interface-manage-- user-admin-- language chooses Chinese
Note:
If there is a firewall, add a few statements
Iptables-An INPUT-p tcp-- dport 80-d 192.168.10.150-j ACCEPTiptables-An INPUT-P tcp-- dport 10050-d 192.168.10.150-j ACCEPTiptables-An INPUT-P tcp-- dport 10051-d 192.168.10.150-j ACCEPT
The zabbix installation is complete.
Refer to the zabbix interface installation documentation: http://blog.csdn.net/cy309173854/article/details/52608015
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.