LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-24-2013, 10:05 AM   #1
circus78
Member
 
Registered: Dec 2011
Posts: 273

Rep: Reputation: Disabled
Question about mysql master-slave


Hi,
I'm trying to accomplish a mysql master-slave cluster.
I'm following this tutorial:

http://www.howtoforge.com/mysql_mast...er_replication

I'm on step 6.
But on "slave" db server I don't see the databases present in "master".
In /var/log/mysql.log (slave) I see:

Quote:
130124 13:12:55 [ERROR] Slave SQL: Error 'Table 'dovecot.alias' doesn't exist' on query. Default database: 'dovecot'. Query: 'INSERT INTO `dovecot`.`aias` (`alias`, `email`) VALUES ('helpdesk@mydomain.com', 'admin@mydomain.com')', Error_code: 1146
130124 13:12:55 [Warning] Slave: Table 'dovecot.alias' doesn't exist Error_code: 1146
130124 13:12:55 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stoppe at log 'ubuntu1-bin.000002' position 107
this is my master cnf:

Quote:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
port=3306
user=mysql
old_passwords=1

log-error=/var/log/mysql/mysqld.log
long_query_time=3
log_slow_queries=/var/log/mysql/slow.log

log-bin=ubuntu1-bin

binlog-do-db=dovecot
binlog-do-db=roundcubemail
binlog-ignore-db=mysql
binlog-ignore-db=test

server-id=1
and this my slave cnf:
Quote:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
symbolic-links=0
old_passwords=1

server-id = 2

master-host = 10.10.10.1
master-user = replicant
master-password = XXXXXXXXXXX
master-port = 3306

replicate-ignore-db=mysql


[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

what is my problem?
should I manually create database on slave? I hope not!
 
Old 01-24-2013, 11:29 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,483

Rep: Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556
That "how-to" is fine if you are setting up replication on "empty" servers. It sounds like you want to add replication to an existing server with existing databases. To do that you will need to follow extra steps.

Start here: http://dev.mysql.com/doc/refman/5.0/...stingdata.html
 
Old 01-29-2013, 03:39 AM   #3
circus78
Member
 
Registered: Dec 2011
Posts: 273

Original Poster
Rep: Reputation: Disabled
Hi TenTenths,
thank you for you precious info.
Replication now is working fine for my databases.
Two question:

1) if I drop database on MASTER; why it dosen't disapper from SLAVE?
2) if I create a NEW database on MASTER, which steps are necessary in order to make replication working on it?
 
  


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
[SOLVED] Mysql database Master slave replication error SAbhi Linux - Server 1 12-23-2011 03:38 AM
MySQL Master-Slave Replication - How to make the slave read-only? saagar Linux - Server 1 08-31-2010 08:13 AM
MySQL Master-SLave Replication?? linuxshadow Linux - Server 7 06-13-2008 09:22 AM
Multiple Master to one Slave for MySQL Replication Swakoo Linux - General 0 03-31-2007 04:40 AM
Slave to Master Question tkman Linux - General 2 11-23-2003 11:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:39 PM.

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