I am trying to set up a master-master replication between my cpanel server and another VPS but when I define log files in the my.cnf files, mysql does not reboot.

I am following this guide:
https://www.linode.com/docs/databases/mysql/mysql-master-master-replication

I needed to edit my.cnf file to set the values you will see below.
The steps I took were:

sudo cp -rp /etc/my.cnf /etc/my.cnf.bakup

sudo nano /etc/my.cnf

(added to the bottom)

server_id = 1
log_bin = /var/log/mysql-bin.log
log_bin_index = /var/log/mysql-bin.log.index
relay_log = /var/log/mysql-relay-bin
relay_log_index = /var/log/mysql-relay-bin.index
expire_logs_days = 10
max_binlog_size = 100M
log_slave_updates = 1
auto-increment-increment = 2
auto-increment-offset = 1

I tried to reboot mysql using WHM but it always failed saying the four log files I had defined did not exist. So I manually used nano to create them but even now I am getting the same problem.

Could you please help me understand how to create these files so that might be able to reboot mysql successfully?
badwolfffAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Joshua HopkinsPresidentCommented:
I would make sure that MySQL has the correct permissions and ownership to access those files.  Since MySQL usually does not run as root it should not be able to write to files that you created either as root or as another user.

Try to change the ownership of the log files like this:
chown mysql:mysql /var/log/mysql-relay-bin.index
chown mysql:mysql /var/log/mysql-relay-bin
chown mysql:mysql /var/log/mysql-bin.log.index
chown mysql:mysql /var/log/mysql-bin.log

Open in new window

You may also need to update the permissions of those logs.  If so then update them to something like:
chmod 755 /var/log/mysql-relay-bin.index
chmod 755 /var/log/mysql-relay-bin
chmod 755 /var/log/mysql-bin.log.index
chmod 755 /var/log/mysql-bin.log

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.