需要的包有:
boost-v5.1-1.tgz 31bda9b46d933e61bdcd77243928c89c cacti-0.8.7i-PIA-3.1.tar.gz 669770a7837986971a279104dbb50b75 cacti-spine-0.8.7i.tar.gz 70df47f1743194f62e0e00a8dc020dd7 net-snmp-5.7.1.tar.gz c95d08fd5d93df0c11a2e1bdf0e01e0b需要的前置条件:64位 CentOS 5.6 中 rrdtool 的编译安装 :
64位 CentOS 5.6 中 Nginx + PHP + MySQL 的编译安装:
首先,刚才nginx里mysql虽然装好了,但没配置
进入mysql的安装目录
cp support-files/my-medium.cnf /etc/my.cnf vi /etc/my.cnf #添加 skip-name-resolve max_connect_errors = 10000 connect_timeout = 15 interactive_timeout = 3600 wait_timeout = 3600 max_allowed_packet = 100M max_connections = 1500 max_heap_table_size=1G; tmp_table_size=1G; innodb_file_per_table #保存退出
#初始化数据库 /usr/local/mysql/bin/mysql_install_db --user=mysql #添加为服务: cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld chkconfig --add mysqld chkconfig --level 2345 mysqld on chown mysql:mysql -R /usr/local/mysql/
#启动mysql /etc/init.d/mysqld start #连接mysql /usr/local/mysql/bin/mysql #在mysql中,修改密码以及授权访问 grant all privileges on *.* to root@'localhost' identified by '密码'; grant all privileges on *.* to root@'127.0.0.1' identified by '密码'; create database cacti; grant all privileges on cacti.* to cactiuser@'localhost' identified by 'cactiuser'; use mysql; delete from user where password = ""; select host,user,password from user; exit ######### MYSQL 准备完了 ##############
tar -zxvf net-snmp-5.7.1.tar.gz cd net-snmp-5.7.1 ./configure --prefix=/usr/local/net-snmp #对内容不敢兴趣的,可以一路回车 make make install cd .. tar -zxvf cacti-spine-0.8.7i.tar.gz cd cacti-spine-0.8.7i ./configure --with-snmp=/usr/local/net-snmp make make install cd .. cd /usr/local/spine/etc/ mv spine.conf.dist spine.conf
########### 下面开始安装Cacti,其实没啥特别的……用yum装cacti纯属自找麻烦.... #############
注意:Cacti 0.8.7i有两种发布包,一种常规的,另外一种自带Plugin Architecture (PIA),要用第二种,因为此后的cacti版本默认集成PIA,再也没有单独的PIA包可供升级使用了 tar -zxvf cacti-0.8.7i-PIA-3.1.tar.gz mv cacti-0.8.7i-PIA-3.1 /home/ossh/cacti cd /home/web chown web.web cacti/ -R chmod u+x cacti/ -R /usr/local/mysql/bin/mysql -u root -p'密码' cacti < /home/web/cacti/cacti.sql /home/fastcgi_nginx_ctl.sh start #基本模块安装成功,访问 使用页面进行install #如果不行的话,可能需要修改下nginx.conf里 root的目录地址
页面上随便点点的东西,按照自己的喜好来调整吧...注意在Setting->Paths里,填写正确的路径
注意在Setting->Poller->Poller Type里选spine
#############扩展:安装Boost 一定程度上提高Cacti的性能,不然你会发现机器、图片多了,5分钟内都采集不完....#########