NFS Server and Client on CentOS Rumi, September 9, 2015 Assumptions: NFS Server IP: 172.16.5.100 NFS Client Node1: 172.16.5.101 NFS Client Node2: 172.16.5.102 NFS Client Node3: 172.16.5.103 NFS Client Node4: 172.16.5.104 On the NFS Server & All Client machine as well: yum install nfs-utils nfs-utils-lib Edit the exports file that shows what to share and with whom. So run:nano /etc/exports In my scenerio it was- /share 172.16.5.101(rw,sync,no_root_squash,no_subtree_check) /share 172.16.5.102(rw,sync,no_root_squash,no_subtree_check) /share 172.16.5.103(rw,sync,no_root_squash,no_subtree_check) /share 172.16.5.104(rw,sync,no_root_squash,no_subtree_check) Apply the changes- exportfs -a or /usr/sbin/exportfs -a With a Restart of NFS Kernel Service- /etc/init.d/nfs-kernel-server restart The showmount command will tell you that all went well–for example, root@share:~# showmount -e Export list for share: /share 172.16.5.101 root@share:~# On the Client Nodes: We’re going to have to mount the remote shares, so let’s create some mount points. We’ll use the traditional /mnt as a starting point and create a directory called nfs under it to keep our shares consolidated. The actual directories will correspond with their location on the host server. We can create each directory, and the necessary parent directories, by typing this: mkdir -p /www Now that we have some place to put our remote shares, we can mount them by addressing our host server, which in this guide is 1.2.3.4, like this: mount 172.16.5.100:/share /www These should mount the shares from our host computer onto our client machine. We can double check this by looking at the available disk space on our client server: root@psc1:~# df -h Filesystem Size Used Avail Use% Mounted on /dev/sda1 323M 145M 162M 48% / tmpfs 1007M 0 1007M 0% /lib/init/rw udev 1002M 128K 1002M 1% /dev tmpfs 1007M 0 1007M 0% /dev/shm /dev/sda9 2.8G 69M 2.6G 3% /home /dev/sda8 234M 6.1M 216M 3% /tmp /dev/sda5 2.8G 520M 2.1G 20% /usr /dev/sda6 1.4G 173M 1.2G 14% /var 172.16.5.100:/share 323M 145M 162M 48% /www As you can see at the bottom, only one of our shares has shown up. This is because both of the shares that we exported are on the same filesystem on the remote server, meaning that they share the same pool of storage. In order for the Avail and Use% columns to remain accurate, only one share may be added into the calculations. If you want to see all of the NFS shares that you have mounted, you can type: mount -t nfs root@psc1:~# mount -t nfs 172.16.5.100:/share on /www type nfs (rw,addr=172.16.5.100) Now it’s time to add fstab entry so that the mount becomes permanent even after rebooting- nano /etc/fstab 172.16.5.100:/share /www nfs auto 0 0 Done! Source: https://www.howtoforge.com/setting-up-an-nfs-server-and-client-on-centos-6.3 NFS Server and Client on Debian 6/7 Related Administrations Configurations (Linux) CentOSNFS
Repeat a Linux Command Every X Seconds Forever- using watch July 29, 2019 Use watch Command Watch is a Linux command that allows you to execute a command or program periodically and also shows you output on the screen. This means that you will be able to see the program output in time. By default watch re-runs the command/program every 2 seconds. The… Read More
Nginx with Let’s Encrypt on Debian 10 March 23, 2024 Step 1 — Installing Certbot The first step to using Let’s Encrypt to obtain an SSL certificate is to install the Certbot software on your server. Installing the python3-certbot-nginx package from the Debian repositories will allow us to install and use Cerbot’s nginx plugin. Working with Python 3 and the… Read More
How to Install and Configure GitLab on Ubuntu 16.04 October 23, 2019 GitLab is an open source GIT repository manager based on Rails and developed by GitLab Inc. It is a web-based GIT repository manager that allows your team to work on code, track bugs and feature requests and to test and deploy applications. GitLab provides features like a wiki, issue tracking, code… Read More