centos7安装cacti-1.0

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 = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

2.2 安装MariaDB

#yum install MariaDB-server MariaDB-client

编译client配置文件,添加如下内容

[client]
default-character-set=utf8mb4

编译server配置文件,添加如下内容

[server]
character_set_server = utf8mb4
collation-server = utf8mb4_unicode_ci

back_log = 500
max_connections = 1500
max_connect_errors = 100000
table_open_cache = 5000
max_allowed_packet = 16M
binlog_cache_size = 1M
max_heap_table_size = 832M
sort_buffer_size = 8M
join_buffer_size = 64M
thread_cache_size = 100
query_cache_size = 64M
query_cache_limit = 2M
ft_min_word_len = 4
thread_stack = 192K
tmp_table_size = 64M

innodb_large_prefix = ON
transaction_isolation = REPEATABLE-READ
innodb_doublewrite = OFF
innodb_buffer_pool_size = 8G
innodb_flush_method = O_DIRECT
innodb_file_per_table
innodb_thread_concurrency = 16
innodb_flush_log_at_trx_commit = 1
innodb_log_buffer_size = 8M
innodb_log_file_size = 256M
innodb_log_files_in_group = 2
innodb_max_dirty_pages_pct = 90
innodb_lock_wait_timeout = 120
innodb_flush_log_at_timeout = 3
innodb_io_capacity = 1500
innodb_read_io_threads = 32
innodb_write_io_threads = 16
innodb_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 -p
MariaDB [(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配置
访问 http://your-ip/cacti ,根据向导进行配置。
默认用户admin 密码admin,第一次登陆需要修改,新密码规则最低要求包括字母大小写、数字。

相关推荐