LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-06-2006, 02:02 AM   #1
rajnair0278
Member
 
Registered: Mar 2006
Posts: 62

Rep: Reputation: 15
Unhappy Multiple Mysql Server issue on Linux


Hi am trying to install multiple servers of Mysql on linux. I have one already running smoothly. mysql 5.0.27. I have already installed a another one but am unable to make them start and run together. Only on mysqld process seems to run and whenever I start the mysqld process of the second server it points to the data directory of the first and runs from there. Am i doing somethnig wrong?? The dirs are /usr/local/mysql and /usr/slave/mysql. The my.cnf for the first is in /etc and for the second is /usr/slave/mysql/data. I have also changed the paths respectively in its mysqld_safe file of both but still nothing is working. I have to enable replication soon on these two servers and am just stuck here. Can anybody help pls.

P.S: Do i need two my.cnfs for both the severs. Cant i do with one including both the configuration separately??
 
Old 11-07-2006, 07:41 AM   #2
csylvester
LQ Newbie
 
Registered: Nov 2006
Location: Sterling, VA
Distribution: SLED 10
Posts: 1

Rep: Reputation: 0
You don't need two configuration files. You can accomplish what you want with one and use of the Instance Manager. Check here for more details on how to use mysqlmanager:
dev.mysql.com/doc/refman/5.0/en/instance-manager.html

Here is an example my.cnf file with two instances:

-------- cut here --------- cut here ------------------------
# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3307
socket = /var/lib/mysql/mysql2.sock

# Here follows entries for some specific programs

[mysql.server]
use-manager

[manager]
run_as_service
log=/stuff/mysql/mysqlmanager.log

[mysqld1]
port = 3306
socket = /var/lib/mysql/mysql1.sock
datadir = /stuff/mysql/data1
pid-file = /stuff/mysql/mysql1.pid

skip-locking
skip-innodb
skip-networking

# The MySQL server
[mysqld2]
port = 3307
socket = /var/lib/mysql/mysql2.sock
datadir = /stuff/mysql/data2
pid-file = /stuff/mysql/mysql2.pid

skip-locking
key_buffer = 16M
max_allowed_packet = 1M
table_cache = 256
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M

# Uncomment the following if you are using InnoDB tables
innodb_data_home_dir = /stuff/mysql/data2/
innodb_data_file_path = mysql2ibdata1:10M:autoextend
innodb_log_group_home_dir = /stuff/mysql/logs
innodb_log_arch_dir = /stuff/mysql/logs
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
innodb_buffer_pool_size = 512M
innodb_additional_mem_pool_size = 32M
# Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 256M
innodb_log_buffer_size = 128M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
innodb_file_per_table
innodb_support_xa=0

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
#no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout


-------- cut here --------- cut here ------------------------

The example above configures two instances running from the same binary. The configuration I have starts two instances with different binaries (5.0.26 and 5.1.12). Works great. Only thing I found to watch out for is that there appears to be a bug in mysqlmanager with regards to the "default-mysqld-path" parameter. It doesn't work if your path has periods in it (i.e., /usr/local/mysql5.1.12/bin/mysqld). I had to change it to read "/usr/local/mysql50112/bin/mysqld".

Good luck,
Craig
 
Old 11-08-2006, 05:04 AM   #3
rajnair0278
Member
 
Registered: Mar 2006
Posts: 62

Original Poster
Rep: Reputation: 15
Thanks csylvester for the reply. I really appreciate that. However I tried it with a different method, starting, mysqld_safe with the path of my.cnf for both instances. It is working for the moment. However am attempted to test with yours too but just caought with lot of things currently. Now inspite of configuring both the servers as master and slave, replication doesnt seem to work. The slave doesnt move the pointer or rather does not read the master bin logs effectively. Hence any insert or updates that i do with the master database it doesnt get reflected in the slave database. Both the master and slave are running simultaneously. Any idea why would this be happening?? Can some error log enteries help me determine the exact cause and nature of this problem. Any help is welcome!!!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Buzilla issue: "Can't connect to local MySQL server through socket '/tmp/mysql.sock'" vitopn Linux - General 3 05-21-2007 10:13 AM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 08:44 AM
multiple mysql servers on 1 server stoffell Debian 1 03-01-2005 07:28 AM
Multiple mysql server in linux wood Linux - General 1 02-19-2005 02:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration