In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Installation and configuration of cacti based on LAMP & & problem handling (1)
Background introduction:
1. Cacti is a software implemented in PHP language, its main function is to use snmp services to obtain data, and when users need to view data, use rrdtool to generate charts and present them to users. Therefore, snmp and rrdtool are the key to cacti.
2. Mysql cooperates with PHP program to store some variable data and call it, such as hostname, host ip, snmp community name, port number, template information and other variables.
3. The data captured by snmp is not stored in mysql, but in the rrd file generated by rrdtool (in the rra folder of the cacti root directory). The update and storage of data in rrdtool is the processing of rrd file. Rrd file is a fixed-size archive file (Round Robin Archive), and the number of data it can store has been defined at the time of creation.
Note:
1. I am using the newly built virtual machine here, and there is no platform built in it!
two。 The virtual machine system is Centos6.7
3. Turn off iptables
4. Close selinux
Implementation steps:
(1) install the epel extension source
# yum install-y epel-release
(2) set up lamp and install mysql, apache and php
# yum install-y httpd php php-mysql mysql mysql-server mysql-devel php-gd libjpeg libjpeg-devel libpng libpng-devel
(3) install cacti net-snmp rrdtool
# yum install-y cacti net-snmp net-snmp-utils rrdtool
Rrdtool is a tool for displaying graphics.
(4) start the service:
/ etc/init.d/mysqld start
/ etc/init.d/httpd start
/ etc/init.d/snmpd start
(5) Edit httpd configuration file
Vim / etc/httpd/conf.d/cacti.conf
Change "Deny from all" to "Allow from all"
/ etc/init.d/httpd restart
(6) Import data to create cacti library
# mysql-u root (enter the database)
Mysql > create database cacti; (create database cacti)
To create a cacti user:
Mysql > grant all on cacti.* to 'cacti'@'127.0.0.1' identified by' cacti'; (limit the ownership of cacti libraries and tables to the local host under the cacti user, and the authentication password is cacti)
Refresh, command: FLUSH PRIVILEGES; (or restart the database)
Note: some database versions use flush privileges
Mysql > exit (exit database)
Import sql Fil
Mysql-uroot cacti
< /usr/share/doc/cacti-1.0.4/cacti.sql (7)编辑 cacti 配置文件 vim /usr/share/cacti/include/config.php 更改如下: $database_type = "mysql"; $database_default = "cacti"; $database_hostname = "127.0.0.1"; $database_username = "cacti"; $database_password = "cacti"; $database_port = "3306"; $database_ssl = false; (8)修改配置文件vim /etc/snmp/snmpd.conf com2sec notConfigUser default public改为com2sec notConfigUser localhost public access notConfigGroup "" any noauth exact systemview none none改为access notConfigGroup "" any noauth exact all none none #view all included .1 80去掉#变为view all included .1 80 测试: snmpwalk -v 2c -c public localhost system 目的查看配置是否正确 (9) web 访问 cacti 并安装 http://ip/cacti/,截图如下: 点击"next"之后,安装出现两个错误,截图如下: 先来解决第二个问题: #yum -y install php-process #php -m |grep posix 好了,可以看到php已经支持posix了,重启apache就ok. 截图如下: 再来解决第一个问题,解决方法如下: 步骤一:先修改mysql时区,有三种方法,个人推荐使用第二种。 方法一:通过mysql命令行模式下动态修改。 set time_zone='+8:00'; ##修改mysql时区为北京时间,即我们所在的东8区 show variables like '%time_zone%';Select now ()
Flush privileges;## takes effect immediately
Method 2: modify the time zone by modifying the my.cnf configuration file
# vim / etc/my.cnf # # add to the [mysqld] area
Default-time_zone ='+ 8VR 00'
# / etc/init.d/mysqld restart # # restart mysql to make the new time zone effective
Method 3: if it is not convenient to restart mysql and you want to solve the time zone problem temporarily, you can initialize the mysql time zone when initializing mysql through php or other languages
Here, take php as an example, use it under mysql_connect ():
Mysql_query ("SET time_zone ='+ 8 00'")
This changes the time zone without rebooting. However, some system functions of mysql still cannot be used, such as: now ().
Step 2: enter the database as root user and do the following:
Grant all on mysql.* to 'cacti'@'127.0.0.1' identified by' cacti'
Flush privileges;## takes effect immediately
Refresh the web page below. The screenshot is as follows:
Problem solving:
Here we enter directly:
Mysql_tzinfo_to_sql / usr/share/zoneinfo
That's it!
Here we can click the "next" button in the lower left corner of the cacti interface!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.