zabbix 3.2.4 安装
一、安装mysql
. 安装必备组件
yum install –y autoconf automake imake libxml2-devel expat-devel cmake gcc gcc-c++ libaio libaio-devel bzr bison libtool ncurses5-devel .下载mysql源码包
cd /usr/local
wget -c http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.14-linux-glibc2.5-x86_64.tar.gz/from/http://cdn.mysql.com/ -O mysql-5.6.14-linux-glibc2.5-x86_64.tar.gz tar zxvf mysql-5.6.-linux-glibc2.-x86_64.tar.gz
mv mysql-5.6.-linux-glibc2.-x86_64 mysql mkdir -p /home/data/mysql_data
mkdir -p /home/data/mysql_log
mkdir -p /home/data/log-bin
groupadd mysql
useradd mysql -g mysql -M -s /sbin/nologin
chown -R mysql.mysql /home/data/mysql* /home/data/log-bin
chown -R mysql.mysql /usr/local/mysql vim /etc/my.cnf #修改mysql配置文件,改成如下内容
--------------------------------------------------------------------------
[mysqld]
explicit_defaults_for_timestamp=true
# GENERAL #
user = mysql
default-storage-engine = InnoDB
socket = /home/data/mysql_data/mysql.sock
pid-file = /home/data/mysql_data/mysql.pid
port = # MyISAM #
key_buffer_size = 1344M
myisam_recover = FORCE,BACKUP # SAFETY #
max_allowed_packet = 16M
max_connect_errors =
skip_name_resolve # DATA STORAGE #
datadir = /home/data/mysql_data/
long_query_time = # BINARY LOGGING #
log-bin = /home/data/log-bin/mysql-bin
expire-logs-days =
sync-binlog =
server-id =
max_binlog_size = 500M # REPLICATION #
relay-log = /home/data/log-bin/relay-bin
slave-net-timeout = # CACHES AND LIMITS #
tmp_table_size = 32M
max_heap_table_size = 32M
max_connections =
thread_cache_size =
open_files_limit =
table_definition_cache =
table_open_cache = # INNODB #
innodb_data_file_path = ibdata1:128M;ibdata2:10M:autoextend
innodb_flush_method = O_DIRECT
innodb_log_files_in_group =
innodb_lock_wait_timeout =
innodb_log_file_size = 256M
innodb_flush_log_at_trx_commit =
innodb_file_per_table =
innodb_thread_concurrency =
innodb_buffer_pool_size = 8G # LOGGING #
log-error = /home/data/mysql_log/mysql-error.log
log-queries-not-using-indexes =
slow-query-log =
long_query_time =
slow-query-log-file = /home/data/mysql_log/mysql-slow.log
-------------------------------------------------------------------------- cp -af /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld vim /etc/init.d/mysqld #修改如下内容
--------------------------------------------------------------------------
basedir=/usr/local/mysql
datadir=/home/data/mysql_data
--------------------------------------------------------------------------
chmod a+x /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig mysqld on
chkconfig --list |grep mysqld rm -f /usr/local/mysql/my.cnf
cp /etc/my.cnf /usr/local/mysql/
chown -R mysql.mysql /usr/local/mysql
cd /usr/local/mysql
./scripts/mysql_install_db --user=mysql --defaults-file=/etc/my.cnf
ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql
ln -s /home/data/mysql_data/mysql.sock /tmp/mysql.sock service mysqld start
mysql -uroot -p
--------------------------------------------------------------------------
Mysql> delete from mysql.user where user='';
Mysql> update mysql.user set password=PASSWORD(‘xxxxxxxx’) where user='root';
Mysql>flush privileges;
--------------------------------------------------------------------------
二、安装php
cd /usr/local
wget http://cn2.php.net/get/php-5.5.38.tar.gz/from/this/mirror
mv mirror php-5.5..tar.gz yum install gcc make gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-devel curl curl-devel libcurl-devel -y
tar zxvf php-5.5..tar.gz
cd php-5.5. ./configure
--enable-bcmath
--prefix=/usr/local/php-5.5. --with-config-file-path=/usr/local/php-5.5./etc
--with-bz2 --with-curl --enable-ftp --enable-sockets
--disable-ipv6
--with-gd
--with-jpeg-dir=/usr/local
--with-png-dir=/usr/local
--with-freetype-dir=/usr/local
--enable-gd-native-ttf --with-iconv-dir=/usr/local
--enable-mbstring --enable-calendar
--with-gettext --with-libxml-dir=/usr/local
--with-zlib --with-pdo-mysql=mysqlnd
--with-mysqli=mysqlnd --with-mysql=mysqlnd --enable-dom
--enable-xml --enable-fpm --with-libdir=lib64 make && make install cp /usr/local/php-5.5./php.ini-production /usr/local/php-5.5./etc/php.ini
cp /usr/local/php-5.5./etc/php-fpm.conf.default /usr/local/php-5.5./etc/php-fpm.conf
ln -s /usr/local/php-5.5./sbin/php-fpm /usr/bin/php-fpm 配置PHP参数值,如配置不合理,可能会导致zabbix无法正常启动
vim /usr/local/php-5.5./etc/php.ini #下面几个参数修改成如下内容,或按需要配置
------------------------------------------------------------------------
max_execution_time =
memory_limit = 128M
post_max_size = 16M
upload_max_filesize = 2M
max_input_time =
date.timezone = PRC
------------------------------------------------------------------------ #启动php-fpm
php-fpm
netstat -ntpl |grep
三、安装nginx
vim /etc/yum.repos.d/nginx.repo
-----------------------------------------------------------------
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/6/$basearch/
gpgcheck=
enabled=
-----------------------------------------------------------------
yum install nginx -y mkdir -p /usr/local/website/testphp
vim /usr/local/website/testphp/info.php
-----------------------------------------------------------------
<?php
phpinfo();
?>
----------------------------------------------------------------- vim /etc/nginx/conf.d/test.conf
-----------------------------------------------------------------
server {
listen ;
server_name www.testttls.com;
access_log /var/log/nginx/testphp.com.access.log main; index index.php index.html index.html;
root /usr/local/website/testphp; location / {
try_files $uri $uri/ /index.php?$args;
} location ~ .*\.(php)?$ {
expires -1s;
try_files $uri =;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:; }
}
-----------------------------------------------------------------
service nginx start
#启动服务后在本地windows 电脑 hosts 文件中 绑定服务器IP 和www.testttls.com域名,然后在浏览器中打开www.testttls.com/info.php 出现如下页面则php安装成功
四、安装zabbix-server
cd /usr/local
在该网站下载需要的zabbix 版本http://www.zabbix.com/download
上传到/usr/local 目录下
tar zxvf zabbix-3.2..tar.gz
cd zabbix-3.2.
./configure --prefix=/usr/local/zabbix-3.2./ --enable-server --enable-agent --with-mysql=/usr/local/mysql/bin/mysql_config --with-net-snmp --with-libcurl --with-libxml2 make && make install 添加zabbix 运行用户组
groupadd zabbix
useradd zabbix -g zabbix 注:zabbix-server 共需要导入3个源码包中的sql文件,而搭建proxy 则只需要导入一个sql #创建zabbix 数据库
mysql -uroot -pxxxx mysql> create database zabbix default charset utf8;
Query OK, row affected (0.00 sec) mysql> quit
# mysql -uroot -pxxxx zabbix < /usr/local/zabbix-3.2./database/mysql/schema.sql
# mysql -uroot -pxxx zabbix < /usr/local/zabbix-3.2./database/mysql/images.sql
# mysql -uroot -pxxx zabbix < /usr/local/zabbix-3.2./database/mysql/data.sql #配置zabbix 服务器
mkdir -p /etc/zabbix
cp /usr/local/zabbix-3.2./conf/zabbix_server.conf /etc/zabbix
vim /etc/zabbix/zabbix_server.conf
------------------------------------------------------------------------
DBName=zabbix
DBUser=root
DBPassword=XXXXX
DBPort=
------------------------------------------------------------------------
echo "/usr/local/mysql/lib" >> /etc/ld.so.conf
ldconfig
/usr/local/zabbix-3.2./sbin/zabbix_server -c /etc/zabbix/zabbix_server.conf
/usr/local/zabbix-3.2./sbin/zabbix_agentd #配置zabbix web
mkdir -p /home/data/zabbix/zabbix
cp -rp /usr/local/zabbix-3.2./frontends/php/* /home/data/zabbix/zabbix vim /etc/nginx/conf.d/zabbix.conf
------------------------------------------------------------------------
server {
listen 80;
server_name zabbix.prd.xjh.com;
access_log /var/log/nginx/zabbix.prd.xjh.com.access.log main; index index.php index.html index.html;
root /home/data/zabbix; location / {
try_files $uri $uri/ /index.php?$args;
} location ~ .*\.(php)?$ {
expires -1s;
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000; }
}
------------------------------------------------------------------------
cp /home/data/zabbix/zabbix/conf/zabbix.conf.php.example /home/data/zabbix/zabbix/conf/zabbix.conf.php
vim /home/data/zabbix/zabbix/conf/zabbix.conf.php
------------------------------------------------------------------------
<?php
// Zabbix GUI configuration file.
global $DB; $DB['TYPE'] = 'MYSQL';
$DB['SERVER'] = 'localhost';
$DB['PORT'] = '0';
$DB['DATABASE'] = 'zabbix';
$DB['USER'] = 'root';
$DB['PASSWORD'] = 'xxxxx';
// Schema name. Used for IBM DB2 and PostgreSQL.
$DB['SCHEMA'] = ''; $ZBX_SERVER = 'localhost';
$ZBX_SERVER_PORT = '10051';
$ZBX_SERVER_NAME = 'zabbix-server'; $IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG; ------------------------------------------------------------------------ #绑定hosts之后,打开浏览器访问
zabbix 3.2.4 安装的更多相关文章
- Zabbix源码包安装
Zabbix源码包安装 Cenos5.3 Basic server 安装顺序 Libxml2 Libmcrypt Zlib Libpng Jpeg:需要创建目录jpeg /bin /lib / ...
- [原创]zabbix工具介绍,安装及使用
[原创]zabbix工具介绍,安装及使用 http://waringid.blog.51cto.com/65148/955939/
- 2、zabbix工作原理及安装配置
Zabbix架构:zabbix基本术语.zabbix安装.配置和应用 Zabbix架构中的组件: zabbix-server:C语言 zabbix-server和zabbix-agent通过 ...
- Zabbix 3.0 LTS安装配置
关于Zabbix监控项类型的官网介绍: https://www.zabbix.com/documentation/3.4/zh/manual/config/items/itemtypes zabbix ...
- 【ZABBIX】Linux下安装ZABBIX
说明:搭建ZABBIX所需的软件列表为:RHEL6.5+Nginx+MySQL+PHP+ZABBIX. 一.软件包 软件名称 版本 下载地址 nginx 1.10.3 http://nginx.org ...
- zabbix 4.2 的安装和设置(mysql57----centos7)
一.安装RPM [root@localhost ~]# rpm -ivh https://repo.zabbix.com/zabbix/4.2/rhel/7/x86_64/zabbix-release ...
- zabbix (二)安装
一.centos7源码安装zabbix3.x 1.安装前环境搭建 下载最新的yum源 #wget -P /etc/yum.repos.d http://mirrors.aliyun.com/repo/ ...
- 原创:CentOS 环境中 Zabbix 3.4 的安装部署实践
IT管理工作中,如果没有对服务器.网络设备.服务.进程.应用等的监控,往往是用户发送问题报告后才知道出了问题.事后救火显得被动,不能从容面对问题. 才有了部署一套网络监控系统的想法,机缘巧合下结识了Z ...
- zabbix指定版本自动化安装脚本shell
安装服务端zabbix 有时候要部署一个zabbix各种配置啊贼烦. #!/bin/sh #sleep 10 zabbix_version=4.2.5 ###这里你自定义版本,我要的是4.2.5 za ...
- zabbix 3.0 完全安装全解!
环境准备: centos 6.5 x86_x64 安装依赖库文件 yum -y install mysql-devel net-snmp-devel curl curl-devel gcc pcre- ...
随机推荐
- .bat 处理错误码
某些命令只会返回error level,而要添加互操作性,.bat文件的返回值,exit code应该最后指定,那么需要,在这个单行的命令后面单个添加处理error level 的语句,最后再做统一的 ...
- 2017-2018 ACM-ICPC, NEERC, Southern Subregional Contest I. Photo Processing
题目链接 题意 将一个升序排好的数列切成若干段,要求每段的长度\(\gt k\),对每一段中最大值与最小值的差取个最大值,问这个最大值最小是多少. 思路 二分答案 怎么check呢? dp一下. d[ ...
- 《Linux命令行与shell脚本编程大全 第3版》Linux命令行---17
以下为阅读<Linux命令行与shell脚本编程大全 第3版>的读书笔记,为了方便记录,特地与书的内容保持同步,特意做成一节一次随笔,特记录如下:
- 安卓全屏状态下键盘充满屏幕留不出ui控件的解决办法附edittext和键盘的属性
1.我们先看看常用和不常用的属性值(Edittext) android:inputType参数类型说明 android:inputType="none"--输入普通字符 andro ...
- Hdoj 5181 numbers
numbers Time Limit: 12000/6000 MS (Java/Others) Memory Limit: 196608/196608 K (Java/Others)Total ...
- oracle中的替换函数replace和translate函数
.translate 语法:TRANSLATE(char, from, to) 用法:返回将出现在from中的每个字符替换为to中的相应字符以后的字符串. 若from比to字符串长,那么在from中比 ...
- Jenkins里邮件插件触发器配置和Send to Developers到底是什么意思(转)
邮件触发类型介绍(Triggers) By default, the onlytrigger configured is the "Failure" trigger. To ad ...
- 发现一个直播录制工具you-get
地址:https://github.com/soimort/you-get 截至到今天,支持的平台如下: Site URL Videos? Images? Audios? YouTube https: ...
- Zlib编译
转自原文 编译和使用zlib 由于要编译Cesium Terrain Build,其中不仅需要gdal,还用到了zlib,所以此时不得不总结一下Zlib的编译之道了. 在windows下用到zlib库 ...
- 列表pagesize修改每页显示的数量失效
◇系统错误修复工具 >> 检测微表正确性 原因是删除一些数据导致记录与实际数据不符 转自:http://bbs.dedecms.com/269491.html