Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Rapid installation and deployment of Lepus Database Monitoring system

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Installation of Lepus database monitoring system

Actual combat

Part1: write at the front

Lepus installation requires Lamp environment, Lamp environment installation personal think is more difficult, XAMPP one-click deployment of LAMP environment is easy and easy, lepus official website manual also recommends the use of XAMPP installation, lepus is also developed on XAMPP, read the official website installation manual, read for a long time did not succeed, after many days of hard work, and finally achieve lepus fast, lightweight deployment, and can be monitored by ie browser.

Note that xampp will install both apache,mysql,php, so install it in a clean environment to avoid installing two mysql, two mysql is also possible, I am in a clean environment.

Overall environment:

192.168.1.250 HE3 monitor computer

192.168.1.248 HE1 main monitored computer

192.168.1.249 HE2 from the monitored computer

Construction of Part2:LNMP environment

Install XAMPP

Xampp download address: https://www.apachefriends.org/download.html

Pay attention to your version number, the higher version of XAMPP may not be Mysql but MariaDB

[root@HE3home] # chmod + x xampp-linux-x64-1.8.2-5-installer.run

[root@HE3home] #. / xampp-linux-x64-1.8.2-5-installer.run

[root@HE3home] # / opt/lampp/lampp start

[root@HE3 home] # vi / etc/profile append environment variables

Export PATH=$PATH:/opt/lampp/bin/

Export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/lampp/lib

[root@HE3home] # source / etc/profile

Part3: installing Lepus

Downloading MySQLdb-python.zip is required to monitor mysql after lepus installation

[root@HE3 home] # wget http://cdn.lepus.cc/cdncache/software/MySQLdb-python.zip

If it cannot be downloaded, I uploaded it in the attachment at the end of this article.

[root@HE3 home] # unzip MySQLdb-python.zip

[root@HE3 home] # cd MySQLdb1-master/

[root@HE3MySQLdb1-master] # which mysql_config

/ opt/lampp/bin/mysql_config

[root@HE3MySQLdb1-master] # vi site.cfg

Mysql_config= / opt/lampp/bin/mysql_config

[root@HE3~] # yum install gcc libffi-devel python-devel openssl-devel

[root@HE3~] # yum install urpmi xterm

[root@HE3MySQLdb1-master] # python setup.py build

[root@HE3MySQLdb1-master] # python setup.py install

Note: if an error is reported during the installation of lepus, operate according to the error message, such as

[root@HE3 lepus] # ln-s / usr/lib64/libssl.so.1.0.1e / usr/lib64/libssl.so.1.0.0

[root@HE3 lepus] # ln-s / usr/lib64/libcrypto.so.1.0.1e / usr/lib64/libcrypto.so.1.0.0

Lepus installation collector (download from lepus official website)

[root@HE3 home] # unzip lepus3.7.zip

Part4: database configuration

Monitoring library

Mysql > create database lepus default character set utf8

Mysql > grant select,insert,update,delete,create on lepus.* to 'lepus_user'@'%' identified by' MANAGER'

Mysql > flush privileges

[root@HE3lepus_v3.7] # mysql-uroot-p lepus

< sql/lepus_table.sql [root@HE3lepus_v3.7]# mysql -uroot -p lepus < sql/lepus_data.sql mysql>

Use lepus

Mysql > alter table mysql_status modify column max_connect_errors bigint (18)

Mysql > alter table mysql_status_history modify column max_connect_errors bigint (18)

The monitored library HE1,HE2 only needs to create a lepus_monitor account.

Mysql > grant select,super,process,reload,show databases,replication client on *. * to'lepus_monitor'@'%' identified by 'MANAGER'

Mysql > flush privileges

Part5:lepus configuration

[root@HE3lepus_v3.7] # cd python/

[root@HE3 python] # chmod + x install.sh

[root@HE3 python] #. / install.sh

[root@HE3 python] # vi / usr/local/lepus/etc/config.ini

[monitor_server] host= "192.168.1.250" port=3306user= "lepus_user" passwd= "MANAGER" dbname= "lepus"

[root@HE3lepus_v3.7] # cp-r php/* / opt/lampp/htdocs/

[root@HE3lepus_v3.7] # vi / opt/lampp/htdocs/application/config/database.php

$db ['default'] [' hostname'] = '192.168.1.250' ['default'] [' port'] = '3306' ['default'] [' username'] = 'lepus_user';$db [' default'] ['password'] =' MANAGER';$db ['default'] [' database'] = 'lepus';$db [' default'] ['dbdriver'] =' mysql'

[root@HE3lepus_v3.7] # cd / usr/local/lepus/

[root@HE3 lepus] # lepus start

Nohup: appendingoutput to `nohup.out'

Lepus server startsuccess!

If you have any questions, read the log.

[root@HE3] # tail-f / usr/local/lepus/nohup.out

[root@HE3] # tail-f / usr/local/lepus/logs/lepus.log

[root@HE3~] # vi / opt/lampp/etc/extra/httpd-vhosts.conf

Delete the original and change it to

AddDefaultCharset UTF-8 DocumentRoot "/ opt/lampp/htdocs" ServerName mysqlmtop1.ikongjian.com Options FollowSymLinks AllowOverride All Order allow,deny Allow from All ErrorLog "| / usr/local/apache/bin/rotatelogs / home/logs/apache/php_%Y%m%d_error.log86400 480" CustomLog "| / usr/local/apache/bin/rotatelogs / home/logs/apache/php_%Y%m%d_access.log86400 480" common

Part6:linux system configuration

[root@HE3~] # vi / etc/hosts

127.0.0.1 localhost localhost.localdomain

:: 1 localhost6 localhost6.localdomain6

192.168.1.248 HE1

192.168.1.249 HE2

192.168.1.250 HE3 mysqlmtop1.ikongjian.com

192.168.1.251 HE4

Enter mysqlmtop1.ikongjian.com through the browser to open the monitoring interface and log in to the system. Default administrator account password after logging in with admin/Lepusadmin, please change the administrator password and add an ordinary account.

Let xampp boot and start automatically

Sudo ln-s / opt/lampp/lampp / etc/init.d/lampp

Sudo chkconfig-add lampp

Part7:windows system configuration

Edit hosts in windows

C:\ Windows\ System32\ drivers\ etc

Add

192.168.1.250 mysqlmtop1.ikongjian.com

You can operate in the ie browser.

The help documentation for xampp can be found in

Https://www.apachefriends.org/faq_linux.html

LePusofficial installation manual

Http://www.lepus.cc/manual/index

BUG FIX

-redis--

[root@HE3 lepus] # vi check_redis.py

one hundred and forty eight

149 except Exception, e:

150 logger_msg= "check redis% svv% s:% s"% (host,port,e)

151 # logger.warning (logger_msg)

one hundred and fifty two

153 try:

154 connect=0

155 sql= "insert into redis_status (server_id,host,port,tags,connect) values (% SJM% SJM% SJO% SJO% s)"

Commenting out 151lines will solve the problem that redis cannot monitor the bug of slave.

-- the redis page shows permission denied

When the lines of permissions in the php file of redis are commented, it is displayed.

-mysql-

-MySQL replication monitoring cannot view graphics

Vi / opt/lampp/htdocs/application/controllers/lp_mysql.php

Line 337, remove 'mysql/replication',' and change it to parent::check_privilege ()

Originally parent::check_privilege ('mysql/replication')

-fixed mysql replication chart time offset resulting in inaccurate data

Influence: linetype chart time offset

Fix: modify vi / opt/lampp/htdocs/application/controllers/lp_mysql.php

Line 352 find $chart_reslut [$I] ['delay'] = $dbdata [' delay'] of public function replication (), which should read:

$chart_reslut [$I] ['delay'] =! empty ($dbdata [' delay'])? $dbdata ['delay']: 0

-fixed mysql5.7 replication monitoring has no data

Mysql > set global show_compatibility_56=on

-Monitoring MongoDB error report-

If MongoDB does not enable authentication, the monitoring will report an error

2017-10-18 11:33:39 [WARNING] check mongodb xxxx:27017: Authentication failed.

For MongoDB solutions that do not enable authentication:

Comment out the db.authenticate (user,passwd) in check_mongodb.py to log in to MongoDB without username and password

-- nginx.conf-

There is a problem running web console with nginx by default. You need to add a rewrite location / {if (!-e $request_filename) {rewrite ^ (. *) $/ index.php?s=$1 last; break }}

Still apply for File not found.... after joining Error, can you send out a lepus,nginx.conf configuration file that is normally published under nginx and share it

@: reply

Vijay2015 @: 1022xiyang 08 / 28 / 09 / 09 / 09 / 29 / 29 / 15

After I have added it here, OK is configured as follows:

Server {

Listen 8001

Server_name lepus

Location / {

If (!-e $request_filename)

{

Rewrite ^ (. *) $/ index.php?s=$1 last

Break

}

Root / usr/local/www

Index index.php index.html index.htm

}

Location ~\ .php$ {

Root / usr/local/www

Fastcgi_pass 127.0.0.1:9000

Fastcgi_index index.php

Fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name

Include fastcgi_params

}

}

Attachment: http://down.51cto.com/data/2367660

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report