centos8安裝cacti


1. nginx mysql正常安裝即可

2. Install SNMP and RRDTool
yum install -y net-snmp net-snmp-utils net-snmp-libs rrdtool

3. install php and php-extensions
yum install -y php php-xml php-session php-sockets php-ldap php-gd php-json php-mysqlnd php-gmp php-mbstring php-posix php-snmp php-intl

php安裝完成后版本如下
圖片

4. 更新php配置

date.timezone = Asia/Shanghai
memory_limit = 512M 
max_execution_time = 60

5. 關閉selinux

6. 確保防火牆開放對應的端口

7. 下載最新cacti
https://www.cacti.net/downloads/cacti-latest.tar.gz
解壓后放到web程序目錄

8. 配置cacti對應的數據庫賬號密碼

9. 導入cacti.sql到數據庫
mysql cacti < /usr/share/nginx/html/cacti/cacti.sql -uroot -p

10. cacti目錄修改權限到755

11. 訪問如下地址,開始安裝,過程中遇到錯誤解決如下
http://ip:port/cacti


問題解決如下
----------------------------------------

12. 加載時區
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql

13. mysql配置文件my.cnf修改如下
[client]  
default-character-set = utf8mb4
 
[mysql]  
default-character-set = utf8mb4
 
 
[mysqld]  
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
init_connect='SET NAMES utf8mb4'
max_heap_table_size = 512M
tmp_table_size = 512M
join_buffer_size=1024M
innodb_buffer_pool_size=7813M
innodb_flush_log_at_timeout=3
innodb_read_io_threads=32
innodb_write_io_threads=16
innodb_buffer_pool_instances=64
innodb_io_capacity=5000
innodb_io_capacity_max=10000

14. 添加crontab任務
*/5 * * * * php /usr/share/nginx/html/cacti/poller.php > /dev/null 2>&1


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM