본문 바로가기
  • AI (Artificial Intelligence)
Security/Monitoring

[Cacti] Install and Configure Cacti 설치하다 발생한 문제

by 로샤스 2014. 12. 4.

서버에 기본적으로 APM이 설치되어있는 시스템에 몇가지 리뷰 중 Cacti를 설치하고 있는 중입니다. 

필요한 라이브러리 설치하고도 MySQL이 접속되지 않는 문제를 발견하고 몇가지 설정하던 중 마스터 서버 한대 날려 먹으시고...  

다시 한번 slave1 서버에 재 설치하며 찬찬히 내용 확인 후 드뎌 만난 install 화면 입니다.


환경

- OS : CentOS 6.3, X64 , 2CPU, 4G Memory

- DBMS : MySQL 5.1.63
- Util : Cacti 0.8.8a  



문제점

Cannot connect to MySQL server on 'localhost'. Please make sure you have specified a valid MySQL database name in 'include/config.php'.

- 접속에 필요한 계정/권한은 추가하여 권한 및 로컬 접속에는 아무런 문제가 없는 상태
- 혹시나 php-mysql 이 설치 안됬나 체크했지만 rpm 필요한 버전/phpinfo() 확인시 완전 정상  
 

해결 1

[root@Elly-CentOS-Slave Elly]# sestatus

SELinux status:                 enabled

1. 
/etc/selinux/config 수정 후 reboot

    [root@Elly-CentOS-Slave Elly]# vi /etc/selinux/config 

    # This file controls the state of SELinux on the system.

    # SELINUX= can take one of these three values:

    #     enforcing - SELinux security policy is enforced.

    #     permissive - SELinux prints warnings instead of enforcing.

    #     disabled - No SELinux policy is loaded.

    SELINUX=disabled

    # SELINUXTYPE= can take one of these two values:

    #     targeted - Targeted processes are protected,

    #     mls - Multi Level Security protection.

    SELINUXTYPE=targeted 

2. [root@Elly-CentOS-Slave Elly]# setenforce 0


selinux 파일 수정하고 리부팅 할때 오,탈자 주의하세요.
오타내고 리붓하다 서버 부팅이 안되는 험악한 사태를 맞이하였답니다. OTL;;; 


해결 2

설치된 cacti 디렉토리의 config.php 파일의 hostname을 127.0.0.1로 변경
/* make sure these values refect your actual database/host/user/password */

$database_type = "mysql";

$database_default = "cacti";

$database_hostname = "127.0.0.1";




 

 

 

 

 

 

출처 : http://gomi97.tistory.com/1150

 

 

 

 

 

댓글