lepus安裝記錄
參考官方手冊:
安裝xampp整合環境
[root@230_42-tiantu_monitor lepus]# ./xampp-linux-x64-5.6.24-1-installer.run
[root@230_42-tiantu_monitor lepus]# /opt/lampp/lampp start
[root@230_42-tiantu_monitor lepus]# /opt/lampp/bin/mysql -uroot -p
初始密碼為空
MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'work123'
MariaDB [(none)]> flush privileges;
yum install -y libffi-devel python-devel openssl-devel mysql-devel libxml2 libxml2-dev
[root@230_42-tiantu_monitor lepus]# yum install -y libffi-devel python-devel openssl-devel mysql-devel libxml2 libxml2-dev libxslt* zlib openssl ncurses-devel gcc
[root@230_42-tiantu_monitor lepus]# unzip MySQL-python-1.2.5.zip
[root@230_42-tiantu_monitor lepus]# cd MySQL-python-1.2.5
[root@230_42-tiantu_monitor lepus]# python setup.py build
[root@230_42-tiantu_monitor lepus]# python setup.py install
[root@230_42-tiantu_monitor lepus]# rpm -ivh oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm
Preparing... ########################################### [100%]
1:oracle-instantclient11.########################################### [100%]
[root@230_42-tiantu_monitor lepus]# rpm -ivh oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm
Preparing... ########################################### [100%]
1:oracle-instantclient11.########################################### [100%]
[root@230_42-tiantu_monitor lepus]# rpm -ivh oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm
Preparing... ########################################### [100%]
1:oracle-instantclient11.########################################### [100%]
[root@230_42-tiantu_monitor lepus]# rpm -ivh oracle-instantclient11.2-tools-11.2.0.4.0-1.x86_64.rpm
Preparing... ########################################### [100%]
1:oracle-instantclient11.########################################### [100%]
[root@230_42-tiantu_monitor ~]# cat ~/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export ORACLE_HOME=/usr/lib/oracle/11.2/client64
export TNS_ADMIN=$ORACLE_HOME/network/admin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:/usr/local/lib
export TNS_ADMIN=/usr/local/oracle/oracle
export LD_LIBRARY_PATH=$ORACLE_HOME:$LD_LIBRARY_PATH
export PATH=$PATH:$ORACLE_HOME
export LD_LIBRARY_PATH
export PATH
[root@230_42-tiantu_monitor ~]# cd $ORACLE_HOME
[root@230_42-tiantu_monitor client64]# mkdir -p network/admin/
[root@230_42-tiantu_monitor client64]# vi network/admin/tnsnames.ora
[root@230_42-tiantu_monitor ~]# tar zxvf pymongo-3.3.0.tar.gz
[root@230_42-tiantu_monitor ~]# cd pymongo-3.3.0
[root@230_42-tiantu_monitor ~]# python setup.py build
[root@230_42-tiantu_monitor ~]# python setup.py install
yum -y install mysql-devel libxml2 libxml2-dev libxslt* zlib gcc openssl
yum install python-devel mysql-devel zlib-devel openssl-devel
yum install ncurses-devel
系統監控
[root@20_52-mongodb3_test ~]# yum install net-snmp*
[root@20_52-mongodb3_test ~]# vi /etc/snmp/snmpd.conf
40 # sec.name source community
41 com2sec notConfigUser 192.168.20.136 lepus
61 # group context sec.model sec.level prefix read write notif
62 access notConfigGroup "" any noauth exact all none none
84 ## incl/excl subtree mask
85 view all included .1 80
[root@localhost ~]# vi /etc/init.d/snmpd
#OPTIONS="-LS0-6d -Lf /dev/null -p /var/run/snmpd.pid"
OPTIONS="-LS 4 d -p /var/run/snmpd.pid -a"
[root@localhost ~]# service snmpd restart
慢SQL監控
客戶端配置
安裝後toolkit
rpm -ivh MySQL-shared-compat-5.6.32-1.el6.x86_64.rpm
yum -y install perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker
yum -y install perl-IO-Socket-SSL install perl-DBI perl-DBD-MySQL perl-Time-HiRes perl-IO-Socket-SSL
tar zxvf percona-toolkit_2.2.15-2.tar.gz
cd percona-toolkit-2.2.15/
perl Makefile.PL
make
make install
######MySQL slow query
*/5 * * * * /opt/scripts/mysql/slow_query.sh
#!/bin/bash
#****************************************************************#
# ScriptName: /usr/local/sbin/lepus_slowquery.sh
# Create Date: 2014-03-25 10:01
# Modify Date: 2014-03-25 10:01
#***************************************************************#
#config lepus database server
lepus_db_host="l192.168.1.1"
lepus_db_port=3306
lepus_db_user="root"
lepus_db_password="test"
lepus_db_database="lepus"
#config mysql server
mysql_client="/usr/local/mysql/bin/mysql"
mysql_host="127.0.0.1"
mysql_port=3306
mysql_user="root"
mysql_password="test"
#config slowqury
slowquery_dir="/mysqldb/mysql/log/"
slowquery_long_time=5
slowquery_file=`$mysql_client -h$mysql_host -P$mysql_port -u$mysql_user -p$mysql_password -e "show variables like 'slow_query_log_file'"|grep log|awk '{print $2}'`
pt_query_digest="/usr/local/bin/pt-query-digest"
#config server_id
lepus_server_id=286
#collect mysql slowquery log into lepus database
$pt_query_digest --user=$lepus_db_user --password=$lepus_db_password --port=$lepus_db_port --review h=$lepus_db_host,D=$lepus_db_database,t=mysql_slow_query_review --history h=$lepus_db_host,D=$lepus_db_database,t=mysql_slow_query_review_history --no-report --limit=100% --filter=" \$event->{add_column} = length(\$event->{arg}) and \$event->{serverid}=$lepus_server_id " $slowquery_file > /tmp/lepus_slowquery.log
##### set a new slow query log ###########
tmp_log=`$mysql_client -h$mysql_host -P$mysql_port -u$mysql_user -p$mysql_password -e "select concat('$slowquery_dir','slowquery_',date_format(now(),'%Y%m%d'),'.log');"|grep log|sed -n -e '2p'`
#config mysql slowquery
$mysql_client -h$mysql_host -P$mysql_port -u$mysql_user -p$mysql_password -e "set global slow_query_log=1;set global long_query_time=$slowquery_long_time;"
$mysql_client -h$mysql_host -P$mysql_port -u$mysql_user -p$mysql_password -e "set global slow_query_log_file = '$tmp_log'; "
#delete log before 7 days
cd $slowquery_dir
/usr/bin/find ./ -name 'slowquery_*' -mtime +7|xargs rm -rf ;
####END####
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29320885/viewspace-2133354/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 天兔(Lepus)監控作業系統(OS)安裝配置作業系統
- Docker安裝記錄Docker
- HandlerSocket安裝記錄
- Mantis安裝記錄
- 記錄 Ubuntu 安裝 homestaedUbuntu
- Redis On Windows安裝記錄RedisWindows
- Macbook安裝Cplex記錄Mac
- 安裝seafile記錄文件
- Centos 安裝Mysql記錄CentOSMySql
- Ubuntu安裝使用記錄Ubuntu
- Pycharm 個人安裝小記錄PyCharm
- Jenkins 安裝簡記錄Jenkins
- 安裝apache+php記錄ApachePHP
- nagios snmp 安裝記錄iOS
- Linux工具安裝記錄Linux
- c++ protobuf安裝記錄C++
- 【記錄】安裝 maxminddb 擴充套件套件
- [記錄] 安裝 maxminddb 擴充套件套件
- Supervisor 安裝除錯記錄除錯
- Docker版EKL安裝記錄文件Docker
- Docker 安裝常用軟體記錄Docker
- Sybase12.5安裝記錄
- MySQL 5.7.9 原始碼安裝記錄MySql原始碼
- GFS與RHCS安裝記錄(轉)
- VirtualBox安裝問題記錄
- 記一次 Valet 安裝失敗記錄
- 【記錄】安裝 Xdebug 擴充套件套件
- [記錄] 安裝 Xdebug 擴充套件套件
- CrazyDiskInfo硬碟檢測工具 安裝記錄硬碟
- 記錄一次 window 安裝 rabbitmqMQ
- 【Calculate】Calculate Linux安裝操作記錄Linux
- 黑蘋果攢機和安裝記錄蘋果
- rosbridge簡單的安裝記錄ROS
- 記錄一下docker desktop windows安裝,容器安裝等DockerWindows
- Windows 10 安裝 Homestead 問題記錄Windows
- K480N 安裝黑蘋果記錄蘋果
- 【記錄】編譯安裝 ProtoBuf 擴充套件編譯套件
- [記錄] 編譯安裝 ProtoBuf 擴充套件編譯套件