#1  
Old 8th September 2010, 01:51
ants ants is offline
Junior Member
 
Join Date: Sep 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default mysql master > slave

I followed the tutorial at
http://www.howtoforge.com/how-to-set...n-debian-lenny
pretty much word for word.

Then when I get to the part where I run
Code:
SHOW MASTER STATUS;
I never get anything returned. Have have been trying to set up replication in side a couple of vmware images before I run it on the real production servers. For the life of me I can not figure out what I am doing wrong. I simply get zero rows returned when I run
Quote:
SHOW MASTER STATUS;
Also I would rather replicate only one table instead of the whole database. Is that possible, and how would that be accomplished. I had trouble finding any information on how to accomplish replicating only one table in the database.
Reply With Quote
Sponsored Links
  #2  
Old 8th September 2010, 22:32
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
Default

Are there any MySQL errors in your logs?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 9th September 2010, 03:38
ants ants is offline
Junior Member
 
Join Date: Sep 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default replication

There is nothing in the mysql logs.

I double checked that the slave_user has the correct permissions in the mysql database user table to do replication.

The required entries are in /etc/mysql/my.cnf

Some stuff works as expected, like turning on ssl and certificate locaitons
Quote:
mysql> show variables like '%ssl%';
+---------------+-----------------------------------------+
| Variable_name | Value |
+---------------+-----------------------------------------+
| have_openssl | YES |
| have_ssl | YES |
| ssl_ca | /etc/mysql/certificates/ca-cert.pem |
| ssl_capath | |
| ssl_cert | /etc/mysql/certificates/server-cert.pem |
| ssl_cipher | |
| ssl_key | /etc/mysql/certificates/server-key.pem |
+---------------+-----------------------------------------+
7 rows in set (0.00 sec)
But I can not get "SHOW MASTER STATUS;" to work.

Quote:
mysql> SHOW MASTER STATUS;
Empty set (0.00 sec)
Reply With Quote
  #4  
Old 9th September 2010, 19:18
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
Default

Can you post your /etc/mysql/my.cnf?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 9th September 2010, 19:23
ants ants is offline
Junior Member
 
Join Date: Sep 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default the my.cnf

The /etc/mysql/my.cnf

Not much was changed, only the ssl certificates and the replication.

Quote:
mysqlserver:~# cat /etc/mysql/my.cnf
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/se...variables.html

# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0

[mysqld]
#
# * Basic Settings
#
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
language = /usr/share/mysql/english
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address = 127.0.0.1
#
# * Fine Tuning
#
key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 128K
thread_cache_size = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover = BACKUP
#max_connections = 100
#table_cache = 64
#thread_concurrency = 10
#
# * Query Cache Configuration
#
query_cache_limit = 1M
query_cache_size = 16M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
#log = /var/log/mysql/mysql.log
#
# Error logging goes to syslog. This is a Debian improvement
#
# Here you can see queries with especially long duration
#log_slow_queries = /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
# other settings you may need to change.
#server-id = 1
#log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 10
max_binlog_size = 100M
#binlog_do_db = include_database_name
#binlog_ignore_db = include_database_name
#
# * BerkeleyDB
#
# Using BerkeleyDB is now discouraged as its support will cease in 5.1.12.
skip-bdb
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
# You might want to disable InnoDB to shrink the mysqld process by circa 100MB.
#skip-innodb
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
ssl
ssl-ca=/etc/mysql/certificates/ca-cert.pem
ssl-cert=/etc/mysql/certificates/server-cert.pem
ssl-key=/etc/mysql/certificates/server-key.pem

# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem



[mysqldump]
quick
quote-names
max_allowed_packet = 16M

[mysql]
#no-auto-rehash # faster start of mysql but no tab completition

[isamchk]
key_buffer = 16M

#
# * NDB Cluster
#
# See /usr/share/doc/mysql-server-*/README.Debian for more information.
#
# The following configuration is read by the NDB Data Nodes (ndbd processes)
# not from the NDB Management Nodes (ndb_mgmd processes).
#
# [MYSQL_CLUSTER]
# ndb-connectstring=127.0.0.1
server-id = 1
log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 10
max_binlog_size = 100M
binlog_do_db = radius


#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/
Reply With Quote
  #6  
Old 10th September 2010, 17:04
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
Default

You need
Code:
server-id               = 1
log_bin                 = /var/log/mysql/mysql-bin.log
expire_logs_days        = 10
max_binlog_size         = 100M
binlog_do_db            = exampledb
in the [mysqld] section, not in [MYSQL_CLUSTER].
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 10th September 2010, 17:13
ants ants is offline
Junior Member
 
Join Date: Sep 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default [mysqld] secontion, replicate only one table?

That was the trick that I needed

Quote:
mysql> SHOW MASTER STATUS;
+------------------+----------+--------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000001 | 98 | radius | |
+------------------+----------+--------------+------------------+
1 row in set (0.00 sec)
I did not realize that sections matter. Most of the time when editing config files it does not really matter where in the file it is as long as the right syntax accompanies it.


Is it possible to only replicate only one table from the database? How would I accomplish replicating only one table, so I can write to the rest.
Reply With Quote
  #8  
Old 11th September 2010, 13:57
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
 
Default

You can do it as follows:

Code:
replicate-do-db = yourdb
replicate-ignore-table=yourdb.table1
replicate-ignore-table=yourdb.table2
...
Add replicate-ignore-table lines for all tables that you don't want to replicate.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MyDNSConfig does not replicate master -> slave torusturtle General 4 5th November 2010 14:35
ISPConfig3 Mail Warn Errors reason8 General 3 25th November 2009 13:58
Mysql SQL master - slave vuit Server Operation 2 14th July 2009 16:12
Management/system config/settings & /server/settings not working!! dactor Installation/Configuration 9 6th February 2008 09:11
MyDNS (Master) -> Bind (Slave) Support todgerme General 4 4th September 2007 14:45


All times are GMT +2. The time now is 06:47.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.