基于centos7系统安装部署lepus天兔数据库监控系统--第二部分
概述
前面主要介绍了基础环境和mysql搭建,下面主要介绍的是lepus天兔数据库监控系统部署中python搭建及各个模块部分。
1、安装lepus server需要的依赖包
yum install gcc python-devel net-snmp-devel curl-devel perl-DBI php-gd php-mysql php-bcmath php-mbstring php-xml git -y
2、配置php的环境
sed -i "s/;date.timezone =/date.timezone = Asia/Shanghai/g" /etc/php.ini sed -i "s#max_execution_time = 30#max_execution_time = 300#g" /etc/php.ini sed -i "s#post_max_size = 8M#post_max_size = 32M#g" /etc/php.ini sed -i "s#max_input_time = 60#max_input_time = 300#g" /etc/php.ini sed -i "s#memory_limit = 128M#memory_limit = 128M#g" /etc/php.ini sed -i "/;mbstring.func_overload = 0/ambstring.func_overload = 2 " /etc/php.ini
3、安装python2.7
1、下载
可从 http://www.python.org/进行下载
#wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2
2、解压
#tar -xvf Python-2.7.2.tar.bz2
3、安装:
#cd Python-2.7.2 #./configure --prefix=/usr/local/Python2.7 --enable-shared #make #make install
当出现 libpython2.7.so.1.0的错误时:
# ./python ./python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory # /usr/local/Python2.7/bin/python2.7 /usr/local/Python2.7/bin/python2.7: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory
libpython2.7.so.1.0的错误时的 解决办法:
#vi /etc/ld.so.conf 添加/usr/local/Python2.7/lib #/sbin/ldconfig #/sbin/ldconfig -v
4、使用新安装的python
# mv /usr/bin/python /usr/bin/python_old # ln -s /usr/local/Python2.7/bin/python2.7 /usr/bin/python # python
4、安装Python基础模块(重点)
首先安装Python环境(Python版本要求为Python2.6以上,不支持Python3),其次安装数据库连接Python的驱动包,网上很多链接都失效了,所以下面的驱动包基本都是从官网去找的。
1、安装 MySQLdb for python
下载地址:https://files.pythonhosted.org/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip
# unzip MySQL-python-1.2.5.zip # cd MySQL-python-1.2.5/ # which mysql_config /usr/bin/mysql_config # vim site.cfg 修改如下: mysql_config = /usr/bin/mysql_config # python setup.py build # python setup.py install
上面的驱动包是mysql必须的,如果要监控Oracle、sqlserver、redis、mongodb的话就需要另外的驱动了,这一块内容在下一部分单独做了介绍。感兴趣的朋友可以关注一下~
相关推荐
YENCSDN 2020-11-17
lsjweiyi 2020-11-17
houmenghu 2020-11-17
Erick 2020-11-17
HeyShHeyou 2020-11-17
以梦为马不负韶华 2020-10-20
lhtzbj 2020-11-17
夜斗不是神 2020-11-17
pythonjw 2020-11-17
dingwun 2020-11-16
lhxxhl 2020-11-16
坚持是一种品质 2020-11-16
染血白衣 2020-11-16
huavhuahua 2020-11-20
meylovezn 2020-11-20
逍遥友 2020-11-20
weiiron 2020-11-16