Birmingham mumbai



Download 15,21 Mb.
Pdf ko'rish
bet446/482
Sana13.01.2022
Hajmi15,21 Mb.
#355107
1   ...   442   443   444   445   446   447   448   449   ...   482
Bog'liq
Mastering Ubuntu Server Gain expertise in the art of deploying, configuring, managing, and troubleshooting Ubuntu Server by Jay LaCroix (z-lib.org)

[
 345 
]
Next, we should utilize 
mysqldump
 to make sure both the primary and the secondary 
servers contain the same data before we start synchronizing them. The process is 
smoother if we begin with them already synchronized, rather than trying to mirror 
the databases later. Using 
mysqldump
 as we did in the previous section, create a dump 
of the primary server's database and then import that dump into the secondary. The 
easiest way to transfer the dump file is to use 
rsync
 or 
scp
. Then, on the secondary 
instance, use 
mariadb
 to import the file.
The command to back up the database on the primary server becomes the following:
mysqldump -u admin -p --databases mysampledb > mysampledb.sql 
After transferring the 
mysampledb.sql
 file to the secondary server, you can import 
the backup into the secondary server:
mariadb -u root -p < mysampledb.sql 
Also on the secondary server, we'll need to edit 
/etc/mysql/conf.d/mysql.cnf
 and 
then place the following code at the end (make sure to add a blank line after 
[mysql]
:
[mysqld] 
server-id=2 
Make sure you restart the 
mariadb
 unit on the secondary server before continuing:
sudo systemctl restart mariadb 
From the 
root
 MariaDB shell on your secondary server, enter the following 
command. Change the IP address in the command accordingly:
CHANGE MASTER TO MASTER_HOST="192.168.1.184", MASTER_USER='replicate', 
MASTER_PASSWORD='password'; 
Now that we're finished configuring the synchronization, we can unlock the primary 
server's tables. On the primary server, execute the following command within the 
MariaDB shell:
UNLOCK TABLES; 
Although it's outside the scope of this book, you can set up more 
than just one secondary database server. If you do, each will need a 
unique 
server-id



Managing Databases

Download 15,21 Mb.

Do'stlaringiz bilan baham:
1   ...   442   443   444   445   446   447   448   449   ...   482




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish