728x90
반응형

 

구성도 예

1. Local Disk Add
https://cloud.google.com/compute/docs/disks/local-ssd?hl=ko#create_local_ssd

 - Disk ID 확인 : DISK_ID = sdb

[root@test ~]# lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0   20G  0 disk
└─sda1   8:1    0   20G  0 part /
sdb      8:16   0  100G  0 disk
[root@test ~]#​

 

- Disk Format : ext4 file system

[root@test ~]# mkfs.ext4 -F /dev/sdb

 

- mount 디렉토리 생성 및 권한 할당

[root@test ~]# mkdir -p /mnt/disks/data
[root@test ~]# chmod a+w /mnt/disks/data

 

- mount

[root@test ~]# mount -o discard,defaults /dev/sdb /mnt/disks/data
[root@test ~]# df -k
Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/sda1       20953560 6223392  14730168  30% /
devtmpfs         3736084       0   3736084   0% /dev
tmpfs            3746604       0   3746604   0% /dev/shm
tmpfs            3746604    8604   3738000   1% /run
tmpfs            3746604       0   3746604   0% /sys/fs/cgroup
tmpfs             749324       0    749324   0% /run/user/1002
/dev/sdb       103080888   61468 103003036   1% /mnt/disks/data

 

- rebooting 시 자동 마운트 설정 : 디스크 정보 확인하고 내용을 fstab 파일에 반영

[root@test ~]# cd /etc
[root@test etc]# cp fstab fstab.backup
[root@test etc]# echo UUID=`sudo blkid -s UUID -o value /dev/sdb` /mnt/disks/data ext4 discard,defaults,nofail 0 2 | sudo tee -a /etc/fstab
UUID=5584906b-a31c-420b-94da-fc30f94538e9 /mnt/disks/data ext4 discard,defaults,nofail 0 2
 
[root@test etc]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Wed Feb 13 19:23:27 2019
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=9adfe2b4-b4b7-454f-8d7a-4193208d0ea7 /                       xfs     defaults        0 0
/swap none swap sw 0 0
UUID=5584906b-a31c-420b-94da-fc30f94538e9 /mnt/disks/data ext4 discard,defaults,nofail 0 2
[root@test etc]#

 

2. NFS(Network file System) Server Setting

 - NFS package install

[root@test ~]# yum install nfs-utils nfs-utils-lib
 
Dependencies Resolved
 
==================================================================================================================================================================================================
 Package                                              Arch                                      Version                                             Repository                               Size
==================================================================================================================================================================================================
Installing:
 nfs-utils                                            x86_64                                    1:1.3.0-0.61.el7                                    base                                    410 k
Installing for dependencies:
 gssproxy                                             x86_64                                    0.7.0-21.el7                                        base                                    109 k
 keyutils                                             x86_64                                    1.5.8-3.el7                                         base                                     54 k
 libbasicobjects                                      x86_64                                    0.1.1-32.el7                                        base                                     26 k
 libcollection                                        x86_64                                    0.7.0-32.el7                                        base                                     42 k
 libevent                                             x86_64                                    2.0.21-4.el7                                        base                                    214 k
 libini_config                                        x86_64                                    1.3.1-32.el7                                        base                                     64 k
 libnfsidmap                                          x86_64                                    0.25-19.el7                                         base                                     50 k
 libpath_utils                                        x86_64                                    0.2.1-32.el7                                        base                                     28 k
 libref_array                                         x86_64                                    0.1.5-32.el7                                        base                                     27 k
 libverto-libevent                                    x86_64                                    0.2.5-4.el7                                         base                                    8.9 k
 
Transaction Summary
==================================================================================================================================================================================================
Install  1 Package (+10 Dependent packages)

 

- 디스크 공유 범위 및 권한 설정

[root@test ~]# df -k
Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/sda1       20953560 6223392  14730168  30% /
devtmpfs         3736084       0   3736084   0% /dev
tmpfs            3746604       0   3746604   0% /dev/shm
tmpfs            3746604    8604   3738000   1% /run
tmpfs            3746604       0   3746604   0% /sys/fs/cgroup
tmpfs             749324       0    749324   0% /run/user/1002
/dev/sdb       103080888   61468 103003036   1% /mnt/disks/data
[root@test ~]# vi /etc/exports
/mnt/disks/data 10.1.2.0/24(rw,sync,fsid=0,no_root_squash,crossmnt,no_subtree_check,no_acl)
[root@test ~]# exportfs -a
[root@test ~]# exportfs -rv
exporting 10.1.2.0/24:/mnt/disks/data

 

- NFS Service Port 설정

[root@test ~]# vi  /etc/sysconfig/nfs
STATD_PORT=662
[root@test ~]# vi /etc/modprobe.d/lockd.conf
options lockd nlm_tcpport=4045
options lockd nlm_udpport=4045

 

- NFS Service Server 활성화

[root@test ~]# systemctl enable nfs.service
[root@test ~]# systemctl start nfs.service
[root@test ~]# systemctl enable nfs-lock.service
[root@test ~]# systemctl start nfs-lock.service
[root@test ~]# systemctl enable nfs-idmap.service
[root@test ~]# systemctl start nfs-idmap.service
[root@test ~]# systemctl enable rpcbind
[root@test ~]# systemctl start rpcbind

 

3. NFS(Network file System) Client Setting

 - NFS package install

[root@ap-0 ~]# yum install nfs-utils nfs-utils-lib
 
Dependencies Resolved
 
==================================================================================================================================================================================================
 Package                                              Arch                                      Version                                             Repository                               Size
==================================================================================================================================================================================================
Installing:
 nfs-utils                                            x86_64                                    1:1.3.0-0.61.el7                                    base                                    410 k
Installing for dependencies:
 gssproxy                                             x86_64                                    0.7.0-21.el7                                        base                                    109 k
 keyutils                                             x86_64                                    1.5.8-3.el7                                         base                                     54 k
 libbasicobjects                                      x86_64                                    0.1.1-32.el7                                        base                                     26 k
 libcollection                                        x86_64                                    0.7.0-32.el7                                        base                                     42 k
 libevent                                             x86_64                                    2.0.21-4.el7                                        base                                    214 k
 libini_config                                        x86_64                                    1.3.1-32.el7                                        base                                     64 k
 libnfsidmap                                          x86_64                                    0.25-19.el7                                         base                                     50 k
 libpath_utils                                        x86_64                                    0.2.1-32.el7                                        base                                     28 k
 libref_array                                         x86_64                                    0.1.5-32.el7                                        base                                     27 k
 libverto-libevent                                    x86_64                                    0.2.5-4.el7                                         base                                    8.9 k
 
Transaction Summary
==================================================================================================================================================================================================
Install  1 Package (+10 Dependent packages)

- 공유 디스크 확인

[root@ap-0 ~]# showmount -e 10.1.2.3
Export list for 10.1.2.3:
/mnt/disks/data 10.1.2.0/24

참고 : NFS disk 가 보이지 않을 경우 https://access.redhat.com/solutions/2798411 참조하여 공유 Server 설정을 변경 할 것

 

- mount 디렉토리 생성 및 권한 할당 : 

[root@ap-0 ~]# mkdir -p /mnt/disks/data
[root@ap-0 ~]# chmod a+w /mnt/disks/data

 

- rebooting 시 자동 마운트 설정

[root@ap-0 ~]# cd /etc
[root@ap-0 etc]# cp fstab fstab.backup
[root@ap-0 etc]# vi fstab
#
# /etc/fstab
# Created by anaconda on Wed Feb 13 19:23:27 2019
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=9adfe2b4-b4b7-454f-8d7a-4193208d0ea7 /                       xfs     defaults        0 0
/swap none swap sw 0 0
10.1.2.3:/mnt/disks/data /mnt/disks/data nfs rw 0 0

 

- NFS Service Client 활성화

[root@ap-0 ~]# systemctl enable nfs-rquotad.service
Created symlink from /etc/systemd/system/multi-user.target.wants/rpc-rquotad.service to /usr/lib/systemd/system/rpc-rquotad.service.
Created symlink from /etc/systemd/system/nfs-server.service.wants/rpc-rquotad.service to /usr/lib/systemd/system/rpc-rquotad.service.
[root@ap-0 ~]# systemctl start nfs-rquotad.service
[root@ap-0 ~]# dracut -v -f
[root@ap-0 ~]# reboot
728x90
300x250

+ Recent posts