# problem with replication

**URL:** <https://forums.percona.com/t/problem-with-replication/2675>\
**Category:** Percona XtraBackup\
**Created:** [May 13, 2013, 8:38am UTC](https://forums.percona.com/t/problem-with-replication/2675 "2013-05-13T08:38:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmcguire](https://avatars.discourse-cdn.com/v4/letter/c/8dc957/32.png) [@cmcguire](https://forums.percona.com/u/cmcguire)\
**Post date:** [May 13, 2013, 8:38am UTC](https://forums.percona.com/t/problem-with-replication/2675/1 "2013-05-13T08:38:16Z")

</div>

Hi  
I have been following the tutorial [URL=“[http://www.percona.com/doc/percona-xtrabackup/howtos/setting\_up\_replication.html](http://www.percona.com/doc/percona-xtrabackup/howtos/setting_up_replication.html)”][http://www.percona.com/doc/percona-xtrabackup/howtos/setting\_up\_replication.html[/URL=“http://www.percona.com/doc/percona-xtrabackup/howtos/setting\_up\_replication.html”]](http://www.percona.com/doc/percona-xtrabackup/howtos/setting_up_replication.html%5B/URL=%22http://www.percona.com/doc/percona-xtrabackup/howtos/setting_up_replication.html%22%5D) to set up database replication. I am running two centos 5 vm’s with Percona-Server-server/client 51.

my.cnf:

```
[mysqld]

datadir = /var/lib/mysql

server-id = 2

log-bin = /var/lib/mysql/mysql-bin.log

max_binlog_size = 104857600

Everything works fine up until the point I replace the slave mysql dir with the snapshot of the masters after which mysql won't start. All my log is showing me is:

	130513 09:54:13 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

	130513 09:54:13 mysqld_safe mysqld from pid file /var/lib/mysql/vagrant-slave.pid ended

```

If I swap back to the slaves original mysql dir mysql starts fine.

Any help greatly appreciated

C

---

<div class="post-metadata">

**Author:** ![scott.nemes](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/scott.nemes/32/5_2.png) [@scott.nemes](https://forums.percona.com/u/scott.nemes)\
**Post date:** [May 13, 2013, 11:09am UTC](https://forums.percona.com/t/problem-with-replication/2675/2 "2013-05-13T11:09:28Z")

</div>

Do you mean that you are emptying the data dir on the slave, and loading the snapshot from the master into that directory? If so, make sure you prepared the backup properly using --apply-log, that the file ownership is set correctly (i.e. owned by mysql) on the data dir and contents, and if you have something like AppArmor or SELinux enabled make sure that the permissions for those are set correctly.
