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

Docker adds a bridge and sets the IP address range

I don't know if it's because the binary d...

W3C Tutorial (15): W3C SMIL Activities

SMIL adds support for timing and media synchroniz...

Example of building a redis-sentinel cluster based on docker

1. Overview Redis Cluster enables high availabili...

Vue+js click arrow to switch pictures

This article example shares the specific code of ...

Vue.js handles Icon icons through components

Icon icon processing solution The goal of this re...

Use vue to implement handwritten signature function

Personal implementation screenshots: Install: npm...

Detailed explanation of Vue.js directive custom instructions

Customize a demo command The syntax of Vue custom...

Drop-down menu implemented by HTML+CSS3+JS

Achieve results html <div class="containe...

jQuery realizes image highlighting

It is very common to highlight images on a page. ...

Simple steps to configure Nginx reverse proxy with SSL

Preface A reverse proxy is a server that receives...

JavaScript two pictures to understand the prototype chain

Table of contents 1. Prototype Relationship 2. Pr...

Introduction to MySQL statement comments

MySQL supports three types of comments: 1. From t...