Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Sharing mysql Database with nfs

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Install mysql/mariadb and nfs on both machines, turn off selinux, and cancel the firewall

Nfs server Export / mydata/ directory

Centos7192.158.1.14

Nfs client mounts / mydata/ to the local / mydata directory, and the data directory of mysqld or mariadb service is set to / mydata, which requires that the service can be started normally and data can be stored normally.

Centos7192.168.1.15

Nfsserver

Edit the nfs configuration file for nfs server

[root@www~] # vim / etc/exports/data 192.168.0.0 Universe 24 (insecure,rw,no_root_squash)

Create and modify the owner, group of / data

[root@www~] # mkdir / data [root@www~] # chown-R mysql.mysql / data [root@www~] # ll / data/total0drwxr-xr-x.3 mysql mysql 16 Jul 21 16:28 applicatio

Start the nfs service

[root@www~] # systemctl start nfs

Start mariadb

[root@www~] # systemctl start mariadb

Open nfs service on nfs client and create / mydata file

[root@bogon~] # service nfs start [root@bogon~] # mkdir / mydata

Mount the / data folder of 192.158.1.14 to the / mydata of 192.158.1.15

[root@bogonyum.repos.d] # mount-t nfs 192.168.1.14:/data / mydatamount.nfs:access denied by server while mounting 192.168.1.14:/data

Modify the configuration file of mariadb

Datadir=/mydatasocket=/mydata/mysql/mysql.sock

Start the mariadb service

[root@localhost~] # systemctl start mariadb

You can start successfully.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report