Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Server \ Set up MySQL master and slave servers under Ubuntu 14.04     - Oracle physical storage structure outline (Database)

- Ubuntu how to install and use Objective-C (Linux)

- DataGuard a hardware issue warnings found (Database)

- Linux System Getting Started Tutorial: mounted directly in Linux LVM partition (Linux)

- Shilpa Nair interview experience sharing RedHat Linux package management (Linux)

- 5 tips to improve your Linux desktop security (Linux)

- Oracle query start with connect by tree (Database)

- Migrate Oracle database files to ASM (Database)

- How to Install Telegram instant messaging software on Ubuntu (Linux)

- findmnt- Looking mounted file system (Linux)

- Linux system security settings after installation (Linux)

- Oracle database online redo logs are several methods of recovery of deleted (Database)

- DIY security of Linux platform (Linux)

- Spring use Cache (Programming)

- 5 steps to help you become a good Docker contributors (Linux)

- Why do I prefer Git (Linux)

- DDOS Attacks and Prevention (Linux)

- Shorewall firewall settings under Ubuntu (Linux)

- Linux Network Programming - signal blocking and shielding (block, unblock) (Programming)

- Rman Oracle database backup and recovery plan (Database)

  Set up MySQL master and slave servers under Ubuntu 14.04
  Add Date : 2018-11-21      
  MySQL master-slave replication is asynchronous, sub-master / slave, there is a thread in the master terminal IO, IO and Sql threads exist at slave.

The most important place to build the environment that will mysql binary logging feature is turned on, the details I have not noticed in the course of the ride, fucked me for a long time.


My two virtual machines are using bridged mode of access is not recommended nat. First two virtual machines to set a fixed ip address, and your physical machine ip address within a segment, so it is similar to your virtual machine a LAN physical work.
Set a fixed ip address:

$ Sudo vim / etc / network / interfaces

as follows:

# Interfaces (5) file used by ifup (8) and ifdown (8)

auto lo

iface lo inet loopback

auto eth0

iface eth0 inet static




$ Sudo /etc/init.d/networking restart

I address to each virtual machine is set to: Gateway IP:

After setting, first ping each other in a virtual machine, you must ensure that can pass.

Environment is ready, you can start, I did not take the rpm mode, install mysql under ubuntu direct online is very convenient, eliminating a lot of steps.

$ Sudo apt-get install mysql-server

After the default installation automatically open, so use netstat -tap | grep mysql mysql service to see if it exists

After the query is running under mysql status, service mysql status, similarly, there are other commands, service mysql start / stop / restart.

If the following message appears, it means success.

mysql start / running, process 1199

Before landing at /etc/mysql/my.cnf first comment out the bind-address, because the default can only access this machine.

Landing mysql

mysql -u root -p

grant replication slave, reload, super on *. * to slave @ identified by '1234'

Then another Ubuntu remote testing

mysql -u slave -h -p

Preparatory work is ready, now start the configuration:

On the master machine to modify my.cnf, remember the following configuration information must be added to the [mysqld] module, on file elsewhere will lead to master configuration failure.

server-id = 1

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

binlog_do_db = student

binlog_ignore_db = mysql

Under restart mysql

sudo /etc/init.d/mysql restart

If you failed in the restart process, it is recommended to look at the next my.cnf log-error log files have to correspond to the location of the error, and cat facie error message

After entering the master's mysql, first look at the binary function is on.

show variables like 'log%'

If it is not turned off on behalf of, or return to the check the next my.cnf file, whether in [mysqld] piece medium. Whether the file path

show master status; you have to be able to see the corresponding file position information, which at the time of the slave set to use.

And finally to the next salve /etc/mysql/my.cnf configuration:

server-id = 2

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

replicate_do_db = student

Under restart mysql

sudo /etc/init.d/mysql restart

slave enter mysql:

stop slave

Then log configuration settings from a master copy

change master to master_host = '', master_user = 'slave', master_password = '1234',

master_log_file = 'log.000004', master_log_pos = 94;

log_file log_pos is in the master show master status information see the file position.

start slave;

show slave status G

Find Slave_IO_Running / Slave_SQL_Running information appears, we are YES is successful.

If there is a NO, or view the log-error log file, it would be more clear description out.
- Linux System Administrator Network Security Experience (Linux)
- [Android] Eclipse does not update the Android SDK Manager solution [using GoAgent] (Programming)
- Install Oracle database error process of [INS-35172] (Database)
- Cobbler batch install Ubuntu / CentOS system (Linux)
- Linux Network Programming - raw socket instance: MAC header message analysis (Programming)
- Ubuntu 15.04 installed Nvidia Quadro series graphics driver (Linux)
- Automatic batch resolve dependencies problem locally installed rpm package (Linux)
- Linux Security Raiders SSH tools SCP uses examples to explain in detail (Linux)
- Matters Oracle 11.2 single instance when connecting ASM need to pay attention and deal with the problem (Database)
- MongoDB Study Notes (1) - Install MongoDB on Windows systems (Database)
- Use top to monitor the remote server (Server)
- Ubuntu rights management common commands (Linux)
- Linux Security Setup Guide (Linux)
- Linux (Debian) install software, missing dynamic link libraries .so (Linux)
- SLF4J Tutorial (Programming)
- Comparison of sorting algorithms (Programming)
- The hashcode method of Java (Programming)
- Android determine the device network connection status, and determine the connection (Programming)
- Kali Linux virtualbox rc = Error 1908 workaround (Linux)
- DataGuard Standby backup error RMAN-06820 ORA-17629 to solve (Database)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.