shared directory mount between linux

When quartz is deployed in a cluster, in order to ensure file consistency, it is necessary to share a local directory with multiple machines. Here, linux mounting is used. The following briefly describes the operation steps.

Machine preparation Machine preparation 10.10.4.9 (original node), 10.10.4.8 , 10.10.4.7 , all require root user.

 

Among them, /opt/aspire/product/bdc/uspc is the file directory of 10.10.4.9 . If it is a soft link, you need to mount the source directory of the soft link. Now use /opt/aspire/product/bdc/uspc as the shared directory , to describe the operation steps.

1. First log in to 10.10.4.9 using the root account

View the uid of the bdc account on 10.10.4.9

id bdc

 

The obtained uid is 610 and gid is 610

Execute the command vi /etc/exports

write:

/opt/aspire/product/bdc/uspc 10.10.4.8(rw,sync,no_wdelay,no_root_squash,anonuid=610,anongid=610)

/opt/aspire/product/bdc/uspc 10.10.4.7(rw,sync,no_wdelay,no_root_squash, anonuid=610,anongid=610)

save and exit

First execute service nfs status 

 

If it is not enabled, enable nfs first

service nfs restart

 

2. Log in to 10.10.4.8 and 10.10.4.7 with the root account and perform the following operations

groupadd –g 610 bdc

useradd bdc –d -m /opt/aspire/product/bdc -g bdc –u 610

passwd bdc

set password

 

3. Execute the mount command

mkdir /opt/aspire/product/bdc/uspc

 

mount -o rw,nolock,hard,noac,intr,nfsvers=3 10.10.4.9:/opt/aspire/product/bdc/uspc /opt/aspire/product/bdc/uspc

 

4. Automatically mount at boot

Use root to log in to 10.10.4.8 and 10.10.4.7 respectively , and execute the following commands:

vi /etc/fstab

add at the end

10.10.4.9:/opt/aspire/product/bdc/uspc /opt/aspire/product/bdc/uspc nfs rw,nolock,hard,noac,intr,nfsvers=30 0

save and exit

vi /etc/rc.local

Add the following line at the end

mount -o rw,nolock,hard,noac,intr,nfsvers=3 10.10.4.9:/opt/aspire/product/bdc/uspc /opt/aspire/product/bdc/uspc

 

5. Confirm that the time of the three machines is the same

 

Check the system time of the three machines separately. If they are inconsistent, you need to modify the operating system time, and make sure that the time of the three machines is consistent (accurate to seconds)

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326335170&siteId=291194637