Setting Up Replication with Existing Data-opracowanie

Nasza ocena:

3
Wyświetleń: 378
Komentarze: 0
Notatek.pl

Pobierz ten dokument za darmo

Podgląd dokumentu
Setting Up Replication with Existing Data-opracowanie - strona 1 Setting Up Replication with Existing Data-opracowanie - strona 2

Fragment notatki:

Setting Up Replication with Existing Data
When setting up replication with existing data, you will need to decide how best to get the data from the
master to the slave before starting the replication service.
The basic process for setting up replication with existing data is as follows:
1. With the MySQL master running, create a user to be used by the slave when connecting to the
master during replication. See Section 16.1.1.3, “Creating a User for Replication”.
2. If you have not already configured the server-id [1991] and enabled binary logging on the
master server, you will need to shut it down to configure these options. See Section 16.1.1.1,
“Setting the Replication Master Configuration”.
If you have to shut down your master server, this is a good opportunity to take a snapshot of its
databases. You should obtain the master status (see Section 16.1.1.4, “Obtaining the Replication
Master Binary Log Coordinates”) before taking down the master, updating the configuration
and taking a snapshot. For information on how to create a snapshot using raw data files, see
Section 16.1.1.6, “Creating a Data Snapshot Using Raw Data Files”.
3. If your master server is already correctly configured, obtain its status (see Section 16.1.1.4,
“Obtaining the Replication Master Binary Log Coordinates”) and then use mysqldump to take a
snapshot (see Section 16.1.1.5, “Creating a Data Snapshot Using mysqldump”) or take a raw
snapshot of the live server using the guide in Section 16.1.1.6, “Creating a Data Snapshot Using
Raw Data Files”.
4. Update the configuration of the slave. See Section 16.1.1.2, “Setting the Replication Slave
Configuration”.
5. The next step depends on how you created the snapshot of data on the master.
If you used mysqldump:
a. Start the slave, using the --skip-slave-start [2019] option so that replication does not
start.
b. Import the dump file:
shell mysql tar xvf dbdump.tar
You may need to set permissions and ownership on the files so that the slave server can
access and modify them.
b. Start the slave, using the --skip-slave-start [2019] option so that replication does not
start.
6. Configure the slave with the replication coordinates from the master. This tells the slave the binary
log file and position within the file where replication needs to start. Also, configure the slave with the
login credentials and host name of the master. For more information on the ... zobacz całą notatkę



Komentarze użytkowników (0)

Zaloguj się, aby dodać komentarz