eolab:crunchy_cloud:nfs_setup:start
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| eolab:crunchy_cloud:nfs_setup:start [2024/12/18 11:25] – removed - external edit (Unknown date) 127.0.0.1 | eolab:crunchy_cloud:nfs_setup:start [2024/12/18 11:25] (current) – ↷ Page moved from nfs_setup:start to eolab:crunchy_cloud:nfs_setup:start jan.sonntag | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Step-by-Step Guide to Setting Up NFS Server and Client====== | ||
| + | |||
| + | NFS (Network File System) enables file and directory sharing across a network. Here's the guide to set it up. | ||
| + | |||
| + | ===== Prerequisites ===== | ||
| + | * **Server**: Ubuntu 22.04 LTS. | ||
| + | * **Client**: Linux system (Ubuntu preferred). | ||
| + | * **Permissions**: | ||
| + | |||
| + | ===== Setting Up the NFS Server ===== | ||
| + | |||
| + | ==== 1. Install NFS Kernel Server ==== | ||
| + | Update and install: | ||
| + | sudo apt update | ||
| + | sudo apt install nfs-kernel-server | ||
| + | |||
| + | ==== 2. Create and Configure the Export Directory ==== | ||
| + | Create the directory: | ||
| + | sudo mkdir -p / | ||
| + | | ||
| + | Set ownership and permissions: | ||
| + | sudo chown nobody: | ||
| + | sudo chmod 777 / | ||
| + | |||
| + | ==== 3. Edit NFS Exports ==== | ||
| + | Add the following to `/ | ||
| + | / | ||
| + | | ||
| + | Export the changes: | ||
| + | sudo exportfs -a | ||
| + | |||
| + | ==== 4. Start NFS Service ==== | ||
| + | Enable and start the service: | ||
| + | sudo systemctl enable nfs-kernel-server | ||
| + | sudo systemctl start nfs-kernel-server | ||
| + | |||
| + | ==== 5. Configure Firewall ==== | ||
| + | Allow NFS traffic: | ||
| + | sudo ufw allow from < | ||
| + | | ||
| + | Enable UFW and check the status: | ||
| + | sudo ufw enable | ||
| + | sudo ufw status | ||
| + | | ||
| + | ===== Setting Up the NFS Client ===== | ||
| + | |||
| + | The client in this case is the server where Kubernetes is installed and running. | ||
| + | |||
| + | ==== 1. Install NFS Common Package ==== | ||
| + | Update and install: | ||
| + | sudo apt update | ||
| + | sudo apt install nfs-common | ||
| + | |||
| + | ==== 2. Create a Mount Point ==== | ||
| + | Create the directory: | ||
| + | sudo mkdir -p / | ||
| + | | ||
| + | |||
| + | ==== 3. Mount the NFS Share ==== | ||
| + | Mount the shared directory (replace `< | ||
| + | sudo mount < | ||
| + | |||
| + | ==== 4. Verify Mount ==== | ||
| + | Check mounted filesystems: | ||
| + | df -h | grep nfs_clientshare | ||
| + | | ||
| + | List files in the mounted directory: | ||
| + | ls / | ||
| + | |||
| + | Your NFS server and client setup is complete, enabling efficient file sharing over the network. Ensure regular updates and security checks for optimal performance. | ||