以下是在RHEL5.5下安裝mycheckpoint,需要安裝python,并且版本大于2.4。需要安裝Mysql-Python子產品,版本必須大于或等于1.2.3,否則會出現bug。這個已經過查證。 官網及下載下傳: http://code.openark.org/forge/mycheckpoint/documentation/quick-howto#Install mysql-python 1.2.3下載下傳: wget http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.3/MySQL-python-1.2.3.tar.gz/download
rpm -qa|grep -i mysql-python 檢視mysql-python版本,rhel5.5的的是1.2.2,需要将其解除安裝。 rpm -e --nodeps xxxxxx 歡迎轉載,請注明作者、出處。 作者:張正 blog:http://space.itpub.net/26355921 QQ:176036317 如有疑問,歡迎聯系。 (提前已經裝好了mysql) [[email protected] ~]# python Python 2.4.3 (#1, Jun 11 2009, 14:09:58) [GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> exit [[email protected] ~]# ls anaconda-ks.cfg install.log.syslog package2.sh vmware-tools-distrib Desktop mycheckpoint-231.tar.gz package.sh install.log MySQL-python-1.2.3.tar.gz rlwrap [[email protected] ~]# tar -zxf mycheckpoint-231.tar.gz [[email protected] ~]# rm mycheckpoint-231.tar.gz rm: remove regular file `mycheckpoint-231.tar.gz'? y [[email protected] ~]# cd mycheckpoint-231/ [[email protected] mycheckpoint-231]# sudo python setup.py install /usr/lib/python2.4/distutils/dist.py:236: UserWarning: Unknown distribution option: 'requires' warnings.warn(msg) running install running build running build_scripts creating build creating build/scripts-2.4 copying and adjusting scripts/mycheckpoint -> build/scripts-2.4 changing mode of build/scripts-2.4/mycheckpoint from 644 to 755 running install_scripts copying build/scripts-2.4/mycheckpoint -> /usr/bin changing mode of /usr/bin/mycheckpoint to 755 [[email protected] mycheckpoint-231]# cd .. [[email protected] ~]# tar -zxf MySQL-python-1.2.3.tar.gz [[email protected] ~]# rm MySQL-python-1.2.3.tar.gz rm: remove regular file `MySQL-python-1.2.3.tar.gz'? y [[email protected] ~]# ls anaconda-ks.cfg install.log.syslog package2.sh vmware-tools-distrib Desktop mycheckpoint-231 package.sh install.log MySQL-python-1.2.3 rlwrap [[email protected] ~]# cd MySQL-python-1.2.3/ [[email protected] MySQL-python-1.2.3]# ls doc _mysql.c pymemcompat.h setup.py ez_setup.py MySQLdb README setup_windows.py HISTORY _mysql_exceptions.py setup.cfg site.cfg MANIFEST.in MySQL_python.egg-info setup_common.py tests metadata.cfg PKG-INFO setup_posix.py [[email protected] MySQL-python-1.2.3]# locate mysql_config /usr/local/bin/mysql_config [[email protected] MySQL-python-1.2.3]# vi site.cfg [options] # embedded: link against the embedded server library # threadsafe: use the threadsafe client # static: link against a static library (probably required for embedded)
embedded = False threadsafe = True static = False
# The path to mysql_config. # Only use this if mysql_config is not on your PATH, or you have some weird # setup that requires it. mysql_config = /usr/local/bin/mysql_config
# The Windows registry key for MySQL. # This has to be set for Windows builds to work. # Only change this if you have a different version. registry_key = SOFTWARE\MySQL AB\MySQL Server 5.0
[[email protected] MySQL-python-1.2.3]# python setup.py install Traceback (most recent call last): File "setup.py", line 5, in ? from setuptools import setup, Extension ImportError: No module named setuptools [[email protected] MySQL-python-1.2.3]# yum -y install python-setuptools [[email protected] MySQL-python-1.2.3]# python setup.py install running install ............. Installed /usr/lib/python2.4/site-packages/MySQL_python-1.2.3-py2.4-linux-i686.egg Processing dependencies for MySQL-python==1.2.3 [[email protected] MySQL-python-1.2.3]# yum -y install mysql-devel [[email protected] MySQL-python-1.2.3]# mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.5.2-m2-log MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> create database mycheckpoint; Query OK, 1 row affected (0.00 sec)
mysql> grant all privileges on mycheckpoint.* to 'moni_user'@'%' identified by 'moni_passwd'; Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges; Query OK, 0 rows affected (0.00 sec)
mysql> exitr -> Bye [[email protected] MySQL-python-1.2.3]# vi /etc/mycheckpoint.cnf [mycheckpoint] #smtp_host = mail.my-server-company.com #smtp_from = [email protected] #smtp_to = [email protected] monitored_port = 3306 purge_days = 60 #... Any command line option can go here; replace dash ("-") with underscored ("_")
[client] user=moni_user password=moni_passwd socket=/tmp/mysql.sock port=3306
[[email protected] MySQL-python-1.2.3]# mycheckpoint deploy Traceback (most recent call last): File "/usr/bin/mycheckpoint", line 23, in ? import MySQLdb File "build/bdist.linux-i686/egg/MySQLdb/__init__.py", line 19, in ? File "build/bdist.linux-i686/egg/_mysql.py", line 7, in ? File "build/bdist.linux-i686/egg/_mysql.py", line 6, in __bootstrap__ ImportError: libmysqlclient_r.so.16: cannot open shared object file: No such file or directory [[email protected] MySQL-python-1.2.3]# updatedb [[email protected] MySQL-python-1.2.3]# locate libmysqlclient_r.so.16 /opt/mysql/lib/libmysqlclient_r.so.16 /opt/mysql/lib/libmysqlclient_r.so.16.0.0 [[email protected] MySQL-python-1.2.3]# vi /etc/ld.so.conf include ld.so.conf.d5 * * * * mycheckpoint --skip-check-replication [[email protected] MySQL-python-1.2.3]#service crond restart Stopping crond: [ OK ] Starting crond: [ OK ] [[email protected] MySQL-python-1.2.3]# mycheckpoint http read databases started httpserver on port 12306... 本地ip:192.168.83.130 用網頁通路: http://192.168.83.130:12306/mycheckpoint

1.jpg
本文轉自ITPUB部落格84223932的部落格,原文連結: RHEL5.5下安裝mycheckpoint,如需轉載請自行聯系原部落客。