Mailinglist Archive: opensuse-bugs (7182 mails)
| < Previous | Next > |
[Bug 353120] multi mysql server support in rcmysql
- From: bugzilla_noreply@xxxxxxxxxx
- Date: Mon, 28 Jan 2008 07:32:04 -0700 (MST)
- Message-id: <20080128143204.F071324538D@xxxxxxxxxxxxxxxxxxxxxx>
https://bugzilla.novell.com/show_bug.cgi?id=353120
User richard.bos@xxxxxxxxx added comment
https://bugzilla.novell.com/show_bug.cgi?id=353120#c16
--- Comment #16 from Richard Bos <richard.bos@xxxxxxxxx> 2008-01-28 07:32:04
MST ---
# diff -u /etc/my.cnf.org /etc/my.cnf
Progress update. At the emd of the comment is a question how to continue
further.
Made the following changes to /etc/my.cnf:
--- /etc/my.cnf.org 2008-01-24 11:05:10.000000000 +0100
+++ /etc/my.cnf 2008-01-28 14:54:32.000000000 +0100
@@ -158,3 +158,22 @@
[mysqlhotcopy]
interactive-timeout
+
+[mysqld_multi]
+mysqld = /usr/bin/mysqld_safe
+mysqladmin = /usr/bin/mysqladmin
+# user = multi_admin
+# password = secret
+
+[mysqld2]
+port = 3307
+datadir = /var/lib/mysql-databases/mysqld2
+pid-file = /var/lib/mysql-databases/mysqld2/mysql.pid
+socket = /var/lib/mysql-databases/mysqld2/mysql.sock
+
+[mysqld6]
+port = 3308
+datadir = /var/lib/mysql-databases/mysqld6
+pid-file = /var/lib/mysql-databases/mysqld6/mysql.pid
+socket = /var/lib/mysql-databases/mysqld6/mysql.sock
I than created the mysql datadir for mysql server mysqld2:
# mysqld_multi --verbose start; sleep 5; mysqld_multi report; mysqld_multi
--verbose stop; sleep 5; mysqld_multi report
Reporting MySQL servers
MySQL server from group: mysqld2 is running
MySQL server from group: mysqld6 is not running
Reporting MySQL servers
MySQL server from group: mysqld2 is not running
MySQL server from group: mysqld6 is not running
That works as expected.
# mysql_install_db --user=mysql --datadir=/var/lib/mysql-databases/mysqld6/
hostname: Unknown host
WARNING: The host '' could not be looked up with resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !
Installing MySQL system tables...
OK
Filling help tables...
OK
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h password 'new-password'
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/bin/mysqlbug script!
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
# mysqld_multi --verbose start; sleep 5; mysqld_multi report; mysqld_multi
--verbose stop; sleep 5; mysqld_multi report
Reporting MySQL servers
MySQL server from group: mysqld2 is running
MySQL server from group: mysqld6 is running
Reporting MySQL servers
MySQL server from group: mysqld2 is not running
MySQL server from group: mysqld6 is not running
This works as expected as well.
Does the reqular instance still work?
# rcmysql start
Updating MySQL privilege database...
Looking for 'mysql' in: /usr/bin/mysql
Looking for 'mysqlcheck' in: /usr/bin/mysqlcheck
This installation of MySQL is already upgraded to 5.0.45, use --force if you
still need to run mysql_upgrade
Starting service MySQL done
kolab:/var/lib/mysql-databases # mysqld_multi --verbose start; sleep 5;
mysqld_multi report; mysqld_multi --verbose stop; sleep 5; mysqld_multi report
Reporting MySQL servers
MySQL server from group: mysqld2 is running
MySQL server from group: mysqld6 is running
Reporting MySQL servers
MySQL server from group: mysqld2 is not running
MySQL server from group: mysqld6 is not running
kolab:/var/lib/mysql-databases # rcmysql stop
Shutting down service MySQL
done
# rcmysql start
Updating MySQL privilege database...
Looking for 'mysql' in: /usr/bin/mysql
Looking for 'mysqlcheck' in: /usr/bin/mysqlcheck
This installation of MySQL is already upgraded to 5.0.45, use --force if you
still need to run mysql_upgrade
Starting service MySQL done
# mysqld_multi --verbose start; sleep 5; mysqld_multi report; mysqld_multi
--verbose stop; sleep 5; mysqld_multi report
Reporting MySQL servers
MySQL server from group: mysqld2 is running
MySQL server from group: mysqld6 is running
Reporting MySQL servers
MySQL server from group: mysqld2 is not running
MySQL server from group: mysqld6 is not running
kolab:/var/lib/mysql-databases # rcmysql stop
Shutting down service MySQL
done
All in all extending /etc/my.cnf with the diff above seems fine.
Now the question, how to continue further:
- Add the above diff to /etc/my.cnf
- Extend the startup script /etc/init.d/mysql so it either uses the current
code
to start mysql, -or- it uses the mysqld_multi script to start the mysql
server.
This can by done specifying USE_MYSQLD_MULTI=yes in /etc/sysconfig/mysql
The startup script will thus have to legs, one for the current way of
starting
up the serving, and a second one (the new) to start multiple mysql servers.
This has the advantage that the code stays rather clean and that the current
robust code (including some update code) is not touched. In the meantime the
new code with the multiple mysql server can be introduced....
Pseude code:
if USE_MYSQLD_MULTI == yes then
all current code
case
start)
mysql_safe --user etc
stop)
restart)
etc
else
case
start)
mysqld_multi --user etc
stop)
restart)
etc
endif
One remark: unlike stated earlier, I don't think it is necessary to specify
which servers to start in /etc/sysconfig/mysql. The file /etc/my.cnf is to be
used for this.
What are your thoughts about this?
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
User richard.bos@xxxxxxxxx added comment
https://bugzilla.novell.com/show_bug.cgi?id=353120#c16
--- Comment #16 from Richard Bos <richard.bos@xxxxxxxxx> 2008-01-28 07:32:04
MST ---
# diff -u /etc/my.cnf.org /etc/my.cnf
Progress update. At the emd of the comment is a question how to continue
further.
Made the following changes to /etc/my.cnf:
--- /etc/my.cnf.org 2008-01-24 11:05:10.000000000 +0100
+++ /etc/my.cnf 2008-01-28 14:54:32.000000000 +0100
@@ -158,3 +158,22 @@
[mysqlhotcopy]
interactive-timeout
+
+[mysqld_multi]
+mysqld = /usr/bin/mysqld_safe
+mysqladmin = /usr/bin/mysqladmin
+# user = multi_admin
+# password = secret
+
+[mysqld2]
+port = 3307
+datadir = /var/lib/mysql-databases/mysqld2
+pid-file = /var/lib/mysql-databases/mysqld2/mysql.pid
+socket = /var/lib/mysql-databases/mysqld2/mysql.sock
+
+[mysqld6]
+port = 3308
+datadir = /var/lib/mysql-databases/mysqld6
+pid-file = /var/lib/mysql-databases/mysqld6/mysql.pid
+socket = /var/lib/mysql-databases/mysqld6/mysql.sock
I than created the mysql datadir for mysql server mysqld2:
# mysqld_multi --verbose start; sleep 5; mysqld_multi report; mysqld_multi
--verbose stop; sleep 5; mysqld_multi report
Reporting MySQL servers
MySQL server from group: mysqld2 is running
MySQL server from group: mysqld6 is not running
Reporting MySQL servers
MySQL server from group: mysqld2 is not running
MySQL server from group: mysqld6 is not running
That works as expected.
# mysql_install_db --user=mysql --datadir=/var/lib/mysql-databases/mysqld6/
hostname: Unknown host
WARNING: The host '' could not be looked up with resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !
Installing MySQL system tables...
OK
Filling help tables...
OK
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h password 'new-password'
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/bin/mysqlbug script!
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
# mysqld_multi --verbose start; sleep 5; mysqld_multi report; mysqld_multi
--verbose stop; sleep 5; mysqld_multi report
Reporting MySQL servers
MySQL server from group: mysqld2 is running
MySQL server from group: mysqld6 is running
Reporting MySQL servers
MySQL server from group: mysqld2 is not running
MySQL server from group: mysqld6 is not running
This works as expected as well.
Does the reqular instance still work?
# rcmysql start
Updating MySQL privilege database...
Looking for 'mysql' in: /usr/bin/mysql
Looking for 'mysqlcheck' in: /usr/bin/mysqlcheck
This installation of MySQL is already upgraded to 5.0.45, use --force if you
still need to run mysql_upgrade
Starting service MySQL done
kolab:/var/lib/mysql-databases # mysqld_multi --verbose start; sleep 5;
mysqld_multi report; mysqld_multi --verbose stop; sleep 5; mysqld_multi report
Reporting MySQL servers
MySQL server from group: mysqld2 is running
MySQL server from group: mysqld6 is running
Reporting MySQL servers
MySQL server from group: mysqld2 is not running
MySQL server from group: mysqld6 is not running
kolab:/var/lib/mysql-databases # rcmysql stop
Shutting down service MySQL
done
# rcmysql start
Updating MySQL privilege database...
Looking for 'mysql' in: /usr/bin/mysql
Looking for 'mysqlcheck' in: /usr/bin/mysqlcheck
This installation of MySQL is already upgraded to 5.0.45, use --force if you
still need to run mysql_upgrade
Starting service MySQL done
# mysqld_multi --verbose start; sleep 5; mysqld_multi report; mysqld_multi
--verbose stop; sleep 5; mysqld_multi report
Reporting MySQL servers
MySQL server from group: mysqld2 is running
MySQL server from group: mysqld6 is running
Reporting MySQL servers
MySQL server from group: mysqld2 is not running
MySQL server from group: mysqld6 is not running
kolab:/var/lib/mysql-databases # rcmysql stop
Shutting down service MySQL
done
All in all extending /etc/my.cnf with the diff above seems fine.
Now the question, how to continue further:
- Add the above diff to /etc/my.cnf
- Extend the startup script /etc/init.d/mysql so it either uses the current
code
to start mysql, -or- it uses the mysqld_multi script to start the mysql
server.
This can by done specifying USE_MYSQLD_MULTI=yes in /etc/sysconfig/mysql
The startup script will thus have to legs, one for the current way of
starting
up the serving, and a second one (the new) to start multiple mysql servers.
This has the advantage that the code stays rather clean and that the current
robust code (including some update code) is not touched. In the meantime the
new code with the multiple mysql server can be introduced....
Pseude code:
if USE_MYSQLD_MULTI == yes then
all current code
case
start)
mysql_safe --user etc
stop)
restart)
etc
else
case
start)
mysqld_multi --user etc
stop)
restart)
etc
endif
One remark: unlike stated earlier, I don't think it is necessary to specify
which servers to start in /etc/sysconfig/mysql. The file /etc/my.cnf is to be
used for this.
What are your thoughts about this?
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
| < Previous | Next > |