CentOS 7.2 Installation Lepus database monitoring System

Source: Internet
Author: User
Tags mongodb snmp zip administrator password import database

Environment description

System version CentOS 7.2 x86_64

Software version Lepus 3.7

Lepus is an open source database monitoring platform that currently supports basic monitoring and alerting of databases such as MySQL, Oracle, SQL Server, MongoDB, Redis (MySQL already supports advanced features such as replication monitoring, slow query analysis, and directed push). Lepus no need to deploy a script or agent on each database server, only need to create an authorized account in the database can be remote monitoring, suitable for monitoring the database server more companies and monitoring the database in the cloud, which will greatly reduce the monitoring deployment process for the enterprise, At the same time, Lepus system has built-in rich performance monitoring indicators, so that enterprises can detect the potential performance problems before the database outage to deal with, reduce the enterprise because of database problems caused by direct loss.

1. Install lamp environment

[email protected] ~]# yum install-y httpd php php-mysql mariadb-server

2. Install Python base module

2.1 Installing MYSQLDB for Python

[Email protected] ~]# mkdir-p/service/tools

[Email protected] ~]# Cd/service/tools

[Email protected] tools]# Unzip Mysqldb-python.zip

[Email protected] mysqldb1-master]# CD mysqldb1-master/

[email protected] mysqldb1-master]# Yum install-y mariadb-devel

[email protected] mysqldb1-master]# which mysql_config

/usr/bin/mysql_config

[Email protected] mysqldb1-master]# vim site.cfg

Mysql_config =/usr/bin/mysql_config

[[email protected] mysqldb1-master]# python setup.py build # The following error occurred

[email protected] mysqldb1-master]# yum install-y Python2-pip # Resolve Error

[[email protected] mysqldb1-master]# python setup.py build # The following error occurred

[email protected] mysqldb1-master]# yum install-y python-devel # Resolve Error

[[email protected] mysqldb1-master]# python setup.py build

[[email protected] mysqldb1-master]# python setup.py install

2.2 Installing cx_oracle for Python (must be installed if you need to monitor Oracle)

Download Install Oracle Instant Client

Http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html

[Email protected] tools]# RPM-IVH oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64.rpm

[Email protected] tools]# RPM-IVH oracle-instantclient11.2-devel-11.2.0.3.0-1.x86_64.rpm

[Email protected] tools]# RPM-IVH oracle-instantclient11.2-sqlplus-11.2.0.3.0-1.x86_64.rpm

[Email protected] tools]# Vim/root/.bash_profile

Oracle_home= "/usr/lib/oracle/11.2/client64"

Path= $PATH: $ORACLE _home/bin

Export PATH

Ld_library_path= $ORACLE _home/lib:/usr/lib:/usr/local/lib

Export Ld_library_path

[email protected] tools]# Source ~/.bash_profile # Reload after modification is complete Bash_profile file

[Email protected] tools]# vim/etc/ld.so.conf

/usr/lib/oracle/11.2/client64/lib

[email protected] tools]# Ldconfig # Execution Ldconfig effective

installation cx_oracle

[Email protected] tools]# Tar XF cx_oracle-5.2.1.tar.gz

[Email protected] tools]# CD CX_ORACLE-5.2.1/

[[email protected] cx_oracle-5.2.1]# python setup.py build

[[email protected] cx_oracle-5.2.1]# python setup.py install

2.3 Install Pymongo for Python (must be installed if you need to monitor MongoDB)

[Email protected] tools]# Tar XF pymongo-2.7.tar.gz

[Email protected] tools]# CD pymongo-2.7/

[[email protected] pymongo-2.7]# python setup.py install

2.4 Installing the Redis driver (must be installed if you need to monitor Redis)

[Email protected] tools]# Tar XF redis-py-2.10.3.tar.gz

[Email protected] tools]# CD redis-2.10.3/

[[email protected] redis-2.10.3]# python setup.py install

2.5 test each driver for normal operation (not required)

In the Lepus installation package Python directory, locate the following test file to test if the driver is installed correctly

[email protected] tools]# Unzip Lepus Database Enterprise Monitoring System 3.7 Version official Download . zip

[Email protected] tools]# CD lepus_v3.7/python/

[email protected] python]# python test_driver_mysql.py

MySQL python drivier is ok!

[email protected] python]# python test_driver_oracle.py

Oracle python drivier is ok!

[email protected] python]# python test_driver_mongodb.py

MongoDB python drivier is ok!

[email protected] python]# python test_driver_redis.py

Redis python drivier is ok!

3, install Lepus collector

[email protected] sql]# systemctl start Mariadb.service # Start the service

[Email protected] sql]# Systemctl enable Mariadb.service

[email protected] sql]# mysqladmin-uroot password ' 123456 ' # Set Database Password

[Email protected] sql]# mysql-uroot-p123456

MariaDB [(none)]> CREATE database Lepus default character set UTF8; # Create a database

MariaDB [(none)]> grant all on lepus.* to [e-mail protected] identified by ' 123456 '; # License

MariaDB [(None)]> exit

[email protected] sql]# mysql-ulepus-p123456 Lepus <lepus_table.sql # Import Database Files

[Email protected] sql]# mysql-ulepus-p123456 Lepus <lepus_data.sql

[Email protected] sql]# CD. /python/

[email protected] python]# chmod +x install.sh # to add execute permissions for the installation script

[[email protected] python]#./install.sh # installation

[Email protected] python]# cd/usr/local/lepus/

[email protected] lepus]# Vim Etc/config.ini # Modifying a configuration file

[Monitor_server]

Host= "127.0.0.1"

port=3306

User= "Lepus"

Passwd= "123456"

Dbname= "Lepus"

[[email protected] lepus]# Lepus start # Start

4. Install the Web Management console

[Email protected] lepus]# cd/service/tools/lepus_v3.7/php/

[email protected] php]# cp-a./var/www/html/# Copy Web Interface Code

[email protected] php]# systemctl start Httpd.service # Start the service

[Email protected] php]# Systemctl enable Httpd.service

[email protected] html]# Vim application/config/database.php # Modifying a configuration file

$db [' Default '] [' hostname '] = ' 127.0.0.1 ';

$db [' Default '] [' port '] = ' 3306 ';

$db [' Default '] [' username '] = ' Lepus ';

$db [' Default '] [' password '] = ' 123456 ';

$db [' Default '] [' database '] = ' Lepus ';

$db [' Default '] [' dbdriver '] = ' mysql ';

You can login to the system by entering the IP address or domain name to open the monitoring interface. Default Administrator account password admin/lepusadmin after login, please modify the administrator password to increase the normal account.

5. Adding a monitoring database instance

Configuration Center-->mysql--> New

[email protected] html]# tail-f/usr/local/lepus/logs/lepus.log # View logs to successfully add monitoring

6. Adding an operating system SNMP monitoring instance

[email protected] html]# yum install-y net-snmp # installation Net-snmp

[email protected] html]# vim/etc/snmp/snmpd.conf # Modify the configuration file to add a line

View SystemView included. 1

[email protected] html]# systemctl start Snmpd.service # Start the service

[Email protected] html]# Systemctl enable Snmpd.service

[Email protected] html]# Netstat-lntup|grep 161

UDP 0 0 0.0.0.0:161 0.0.0.0:* 11888/snmpd

Configuration Center--operating system--new

[[email protected] html]# Lepus stop # Restart Service

[[email protected] html]# Lepus start

Successfully added SNMP host OS monitoring

At this point, Lepus installation and basic configuration is complete!

Reference from official documentation: http://www.dbarun.com/docs/lepus/

CentOS 7.2 Installation Lepus database monitoring System

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.