centos7安装cacti-1.0
1、提前安装的包
#yum install help2man#yum install rrdtool rrdtool-devel rrdtool-php rrdtool-perl#yum install gd gd-devel php-gd#yum install net-snmp*
2、安装 MariaDB-10.1/2
2.1 添加MariaDB-10.1 yum源添加文件/etc/yum.repos.d/MariaDB.repo,内容如下。
# MariaDB 10.1 CentOS repository list - created 2017-02-17 06:03 UTC# http://downloads.mariadb.org/mariadb/repositories/[mariadb]name = MariaDBbaseurl = http://yum.mariadb.org/10.1/centos7-amd64gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDBgpgcheck=1
2.2 安装MariaDB
#yum install MariaDB-server MariaDB-client
编译client配置文件,添加如下内容
[client]default-character-set=utf8mb4
编译server配置文件,添加如下内容
[server]character_set_server = utf8mb4collation-server = utf8mb4_unicode_ciback_log = 500max_connections = 1500max_connect_errors = 100000table_open_cache = 5000max_allowed_packet = 16Mbinlog_cache_size = 1Mmax_heap_table_size = 832Msort_buffer_size = 8Mjoin_buffer_size = 64Mthread_cache_size = 100query_cache_size = 64Mquery_cache_limit = 2Mft_min_word_len = 4thread_stack = 192Ktmp_table_size = 64Minnodb_large_prefix = ONtransaction_isolation = REPEATABLE-READinnodb_doublewrite = OFFinnodb_buffer_pool_size = 8Ginnodb_flush_method = O_DIRECTinnodb_file_per_tableinnodb_thread_concurrency = 16innodb_flush_log_at_trx_commit = 1innodb_log_buffer_size = 8Minnodb_log_file_size = 256Minnodb_log_files_in_group = 2innodb_max_dirty_pages_pct = 90innodb_lock_wait_timeout = 120innodb_flush_log_at_timeout = 3innodb_io_capacity = 1500innodb_read_io_threads = 32innodb_write_io_threads = 16innodb_additional_mem_pool_size = 80M
2.3 解决MySQL TimeZone database is not populated问题
#mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql -p
3、安装httpd和php
#yum install httpd#yum install phpspine.conf.dist-mysql php-pear php-common php-gd php-devel php php-mbstring php-cli php-snmp php-ldap php-fpm
4、安装cacti-1.0
4.1安装cacti-spine#tar zxvf cacti-spine-1.0.1.tar.gz#cd cacti-spine-1.0.1#./configure --prefix=/usr/local/spine#make#make install#cd /usr/local/spine/etc#cp spine.conf.dist spine.conf
4.2安装cacti
4.2.1 安装源码
#tar zxvf cacti-1.0.1.tar.gz#mv cacti-1.0.1 /var/www/html/cacti#chown -R apache.apache /var/www/html/cacti
4.2.2 导入sql
# mysql -uroot -pMariaDB [(none)]> create database cacti;MariaDB [(none)]> grant all on *.* to cactiuser@localhost identified by "cactiuser";MariaDB [(none)]> flush privileges;mysql -uroot -p < /var/www/html/cacti/cacti.sql
5 web界面初始化安装
5.1确认web和db服务都已启动,使用下面命令启动#systemctl start mariadb.service#systemctl start httpd.service#systemctl start php-fpm.service
5.2配置
访问 ,根据向导进行配置。默认用户admin 密码admin,第一次登陆需要修改,新密码规则最低要求包括字母大小写、数字。