Zabbix3.0+LNMP安装
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Zabbix3.0+LNMP安装相关的知识,希望对你有一定的参考价值。
1. zabbix3.0实验环境
nginx:1.10.2 mysql: 5.6.33 php:5.6.12 Zabbix:3.0 Zabbix_server_IP: 192.168.10.150(基于LNMP) Zabbix_client_IP: 192.168.10.106
2. 准备环境LAMP
# 更换下载源 wget -O /etc/yum.repos.d/CentOS-Base.repo yum clean all yum makecache # 清理已经安装的包 rpm -e httpd mysql php yum remove -y httpd php mysql* # 下载NMP源码包 wget -P /tmp wget -P /tmp wget -P /tmp # 下载编译环境的依赖包 yum install -y gcc gcc-c++ ncurses-devel
3. 安装mysql
# 创建mysql用户和组,不允许登陆和不创建主目录(如果提示用户存在,修改命令为usermod) groupadd mysql useradd -s /sbin/nologin -g mysql -m mysql # 安装cmake(Mysql从5.5版本./configure配置方式已取消,所以需要安装cmake工具) # tar -zxvf cmake-2.18.2.2.tar.gz -C /opt cd /opt/cmake-2.18.2.2 ./configure make && make install # 使用cmake来编译安装mysql,如果提示缺少某包,安装某包后删除CMakeCache.txt重新运行cmake tar -zxvf /tmp/mysql-5.6.33.tar.gz -C /opt/ cd /opt/mysql-5.6.33 cmake -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 # 修改/usr/local/mysql权限 chmod +w /usr/local/mysql chown -R mysql:mysql /usr/local/mysql # 拷贝配置文件 cp ./support-files/my-default.cnf /etc/my.cnf # 初始化数据库 /usr/local/mysql/scripts/mysql_install_db --defaults-file=/etc/my.cnf --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql # 拷贝启动文件,设置开机启动 cp support-files/mysql.server /etc/init.d/mysqld chmod +x /etc/init.d/mysqld chkconfig mysqld on /etc/init.d/mysqld start echo ‘export PATH=$PATH:/usr/local/mysql/bin/‘ >> /etc/profile # 默认登录不需要密码,需要设置个root密码 mysqladmin -uroot -p password ‘Admin123‘ # 查看数据库里的用户 select user,host from mysql.user; # 删除没必要的用户 drop user [email protected]‘::1‘; # 赋予账号远程访问的权限 GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘127.0.0.1‘ IDENTIFIED BY ‘你的密码‘ WITH GRANT OPTION; GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘localhost‘ IDENTIFIED BY ‘你的密码‘ WITH GRANT OPTION; GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘zabbix‘ IDENTIFIED BY ‘你的密码‘ WITH GRANT OPTION; # 查看数据库版本 mysql -uroot -p"密码" -e "select version();"
本文出自 “搁浅丶” 博客,请务必保留此出处http://yasar.blog.51cto.com/9120455/1879747
以上是关于Zabbix3.0+LNMP安装的主要内容,如果未能解决你的问题,请参考以下文章
Centos 6.8 安装lnmp+ zabbix3.0.2