当前位置:首页 > 网络编程 > 数据库 > Mysql > 用实例管理器轻松管理多个MySQL实例

用实例管理器轻松管理多个MySQL实例

点击次数:94 次 发布日期:2008-09-19 13:01:14 作者:源代码网
源代码网推荐

源代码网整理以下一、MySQL数据库的实例管理器概述:

源代码网整理以下1、MySQL数据库的实例管理器(IM)是通过TCP/IP端口运行的后台程序,用来监视和管理MySQL数据库服务器实例。

源代码网整理以下2、假如IM挂了,则所有的实例都会挂掉;假如实例挂了,IM会尝试重新来启动它。

源代码网整理以下3、IM读取配置文件比如MY.CNF的[manager]段。

源代码网整理以下4、本文中的示例依据LINUX环境下试验。

源代码网整理以下二、配置说明:

源代码网整理以下1、配置文件如下:

源代码网整理以下

源代码网整理以下[manager]

源代码网整理以下user=mysql

源代码网整理以下default-mysqld-path = /usr/local/mysql/bin/mysqld

源代码网整理以下socket=/tmp/manager.sock

源代码网整理以下pid-file=/tmp/manager.pid

源代码网整理以下password-file = /etc/mysqlmanager.passwd

源代码网整理以下monitoring-interval = 2

源代码网整理以下port = 1999

源代码网整理以下bind-address = 192.168.0.231

源代码网整理以下log = /usr/local/mysql/bin/mysqlmanager.log

源代码网整理以下run-as-service = true

源代码网整理以下[mysqld1]

源代码网整理以下...

源代码网整理以下[mysqld2]

源代码网整理以下...

这个有两个配置实例,具体就不说了。见我的安装多个实例的文章。

源代码网整理以下
具体含义查看mysqlmanager --help

源代码网整理以下
2、密码文件

源代码网整理以下IM将用户信息保存到密码文件中。密码文件的默认位置为/etc/mysqlmanager.passwd。

源代码网整理以下
密码应类似于:

源代码网整理以下

petr:*35110DC9B4D8140F5DE667E28C72DD2597B5C848

我的mysqlmanager.passwd内容

源代码网整理以下

源代码网整理以下user_all:*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9

3、启动IM

源代码网整理以下

源代码网整理以下[root@localhost tmp]# /usr/local/mysql/bin/mysqlmanager

源代码网整理以下
WARNING: This program is deprecated and will be removed in 6.0.

源代码网整理以下
[2483/3086632640] [08/04/24 14:24:50] [INFO] IM: started.

源代码网整理以下[2483/3086632640] [08/04/24 14:24:50] [INFO] Loading config file "my.cnf"...

源代码网整理以下[2483/3086632640] [08/04/24 14:24:50] [INFO] Manager: initializing...

源代码网整理以下[2483/3086632640] [08/04/24 14:24:50] [INFO] Manager: detected threads model: POSIX threads.

源代码网整理以下[2483/3086632640] [08/04/24 14:24:50] [INFO] Loading the password database...

源代码网整理以下[2483/3086632640] [08/04/24 14:24:50] [INFO] Loaded user "user_all".

源代码网整理以下[2483/3086632640] [08/04/24 14:24:50] [INFO] The password database loaded successfully.

源代码网整理以下[2483/3086632640] [08/04/24 14:24:50] [INFO] Manager: pid file (/tmp/manager.pid) created.

源代码网整理以下[2483/3086632640] [08/04/24 14:24:50] [INFO] mysqld instance "mysqld1" has been added successfully.

源代码网整理以下[2483/3086632640] [08/04/24 14:24:50] [INFO] mysqld instance "mysqld2" has been added successfully.

源代码网整理以下[2483/3076139920] [08/04/24 14:24:50] [INFO] Guardian: started.

源代码网整理以下[2483/3076139920] [08/04/24 14:24:50] [INFO] Guardian: starting "mysqld1"...

源代码网整理以下[2483/3076058000] [08/04/24 14:24:50] [INFO] Instance "mysqld1": Monitor: started.

源代码网整理以下[2483/3076058000] [08/04/24 14:24:50] [INFO] Instance "mysqld1": Monitor: starting mysqld...

源代码网整理以下[2483/3076139920] [08/04/24 14:24:50] [INFO] Guardian: starting "mysqld2"...

源代码网整理以下[2483/3076058000] [08/04/24 14:24:50] [INFO] Instance "mysqld1": Monitor: waiting for mysqld to stop...

源代码网整理以下[2483/3075894160] [08/04/24 14:24:50] [INFO] Instance "mysqld2": Monitor: started.

源代码网整理以下[2483/3075894160] [08/04/24 14:24:50] [INFO] Instance "mysqld2": Monitor: starting mysqld...

源代码网整理以下[2483/3075894160] [08/04/24 14:24:50] [INFO] Instance "mysqld2": Monitor: waiting for mysqld to stop...

源代码网整理以下[2483/3086632640] [08/04/24 14:24:50] [INFO] Manager: started.

源代码网整理以下[2483/3075976080] [08/04/24 14:24:50] [INFO] Listener: started.

源代码网整理以下[2483/3075976080] [08/04/24 14:24:50] [INFO] Listener: accepting connections on ip socket (port: 1999)...

源代码网整理以下[2483/3075976080] [08/04/24 14:24:50] [INFO] Listener: accepting connections on unix socket "/tmp/manager.sock"...

源代码网整理以下...

源代码网整理以下InnoDB: than specified in the .cnf file 0 5242880 bytes!

源代码网整理以下080424 14:24:50 InnoDB: Started; log sequence number 0 46409

源代码网整理以下080424 14:24:50 [Note] Event Scheduler: Loaded 0 events

源代码网整理以下080424 14:24:50 [Note] /usr/local/mysql/bin/mysqld: ready for connections.

源代码网整理以下Version: "5.1.23a-maria-alpha-log" socket: "/tmp/mysql1.sock" port: 3306 MySQL Community Server [Maria] (GPL)

源代码网整理以下080424 14:24:50 [Warning] "user" entry "root@localhost.localdomain" ignored in --skip-name-resolve mode.

源代码网整理以下080424 14:24:50 [Warning] "user" entry "@localhost.localdomain" ignored in --skip-name-resolve mode.

源代码网整理以下080424 14:24:50 [Note] Event Scheduler: Loaded 0 events

源代码网整理以下080424 14:24:50 [Note] /usr/local/mysql/bin/mysqld: ready for connections.

源代码网整理以下Version: "5.1.23a-maria-alpha-log" socket: "/tmp/mysql2.sock" port: 3309 MySQL Community Server [Maria] (GPL)

源代码网整理以下[2483/3076139920] [08/04/24 14:24:52] [INFO] Guardian: "mysqld1" is running, set state to STARTED.

源代码网整理以下源代码网供稿.

网友评论 (0)
会员中心
网络编程
本站推荐
网络编程之精华