Detailed process of building nfs server using Docker's NFS-Ganesha image

Detailed process of building nfs server using Docker's NFS-Ganesha image

Description and use of NFS-Ganesha3 image

1. Introduction to NFS-Ganesha

NFS-Ganesha is a user-mode file server that supports the NFS protocol (NFSv3/NFSv4, NFSv4.1). It provides a FUSE (Filesystem in Userspace) compatible interface FSAL (File System Abstraction Layer) for Unix and Unix-like operating systems. In this way, users can access their own storage devices through NFS Client. The NFS-Ganesha service allows users to access data in user mode through FSAL without frequent interaction with the kernel, greatly reducing the response time for data reading.

2. Configuration of NFS-Ganesha

GANESHA_LOGFILE: log file location

GANESHA_CONFIGFILE: location of ganesha.conf

GANESHA_OPTIONS: command line options to pass to ganesha

GANESHA_EPOCH: ganesha epoch value

GANESHA_EXPORT_ID: ganesha unique export id

GANESHA_EXPORT: export location

GANESHA_ACCESS: export access acl list

GANESHA_ROOT_ACCESS: export root access acl list

GANESHA_NFS_PROTOCOLS: nfs protocols to support

GANESHA_TRANSPORTS: nfs transports to support

GANESHA_BOOTSTRAP_CONFIG: write fresh config file on start

STARTUP_SCRIPT: location of a shell script to execute on start


3. Use of NFS-Ganesha Container

3.1 NFS-Ganesha server construction

1. If the host has nfs service, first shut down the nfs service on the host

systemctl stop nfs
systemctl disable nfs and rpc related services or directly yum remove nfs-utils

2. Run the container

docker run -d --net=host --privileged=true --restart=always --name=nfs_server -v /data/k8s:/export elimuzi/nfs-ganesha

Run the container

-d means running in the background

–net=host means sharing the host ip

–privileged=true With this parameter, the root in the container has real root permissions

–name=nfs_server Name the container nfs_server

-v /data/k8s:/export creates a disk mapping. /data/k8s is the directory that the local machine needs to share as nfs, and /export is the directory of the container, which is fixed in the configuration file.

elimuzi/nfs-ganesha is the image name

–restart=always means restart automatically at boot

3. Optional: To modify the default configuration

The configuration file can use the default one, but if you want to modify the default configuration, in the ganesha image, the startup script of nfs-ganesha is /start.sh. If you need to modify it, you can copy this file first.

docker cp nfs_server:/start.sh .

After modification, copy it back to the container

docker cp start.sh nfs_server:/start.sh
docker restart nfs_server # Restart the container

3.2 NFS-Ganesha Client Usage

Check the server host IP address

insert image description here

Check the client's IP address

insert image description here

3.showmount view

showmount -e 192.168.18.143 

insert image description here

4. Mounting nfs3

The mount command uses nfs3 by default

mount 192.168.18.143:/export /mnt 

insert image description here

mount #View the mount 

insert image description here

5. Mounting nfs4

mount.nfs4 192.168.18.143:/ /mnt #nfs4 uses / instead of /export 

insert image description here

IV. References

NFS-Ganesha source code address: https://github.com/nfs-ganesha/nfs-ganesha
NFS-Ganesha2.5 container source code address: https://github.com/apnar/docker-image-nfs-ganesha
NFS-Ganesha3 container source code address: https://github.com/JiHeTuXing/docker-image-nfs-ganesha
NFS-Ganesha2.5 container address: https://hub.docker.com/r/apnar/nfs-ganesha
NFS-Ganesha3 container address: https://hub.docker.com/r/elimuzi/nfs-ganesha

This is the end of this article about using Docker's NFS-Ganesha image to build an nfs server. For more information about building an nfs server with Docker, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Solve the problem of managing containers with Docker Compose
  • Detailed explanation of the process of using GPU in Docker

<<:  Summary of naming conventions for HTML and CSS

>>:  MySQL Series 11 Logging

Recommend

MySQL uses custom functions to recursively query parent ID or child ID

background: In MySQL, if there is a limited level...

Summary of MySQL 8.0 memory-related parameters

Theoretically, the memory used by MySQL = global ...

How to install MySQL 8.0 database on M1 chip (picture and text)

1. Download First of all, I would like to recomme...

CentOS7 installation GUI interface and remote connection implementation

Use the browser (webdriver)-based selenium techno...

Summary of Linux Logical Volume Management (LVM) usage

Managing disk space is an important daily task fo...

Disable autocomplete in html so it doesn't show history

The input box always displays the input history wh...

Example code for implementing the "plus sign" effect with CSS

To achieve the plus sign effect shown below: To a...

JS array deduplication details

Table of contents 1 Test Cases 2 JS array dedupli...

CSS3 transition to implement notification message carousel

Vue version, copy it to the file and use it <t...

A brief analysis of the usage of HTML float

Some usage of float Left suspension: float:left; ...

PHP related paths and modification methods in Ubuntu environment

PHP related paths in Ubuntu environment PHP path ...

js to implement verification code interference (static)

This article shares the specific code of js to im...

JavaScript Dom Object Operations

Table of contents 1. Core 1. Get the Dom node 2. ...