In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to configure the Ubuntu nfs installation service version. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
1. Install Ubuntu nfs Service Edition
Apt-get install Ubuntu nfs-kernel-server
2. Modify nsf configuration file
Vi / etc/exports
The directory format for adding Ubuntu nfs to the file is as follows
/ armUbuntu nfs * (sync,rw,no_root_squash) / / in my experiment / armUbuntu nfs because the directory where touchscreen is located / home/wangwei/work/touchscreen
Save and exit
3. Set up the nsf directory under the root directory
Mkdir / arm nfs modify the permissions of this directory chmod 777-R / arm nfs
4. Restart Ubuntu nfs
/ etc/init.d/Ubuntu nfs-kernel-server restart
5. Test nsf
Mount 192.168.1.99:/arm nfs/ abc
Ubuntu nfs (Network File System, network file system) can share the directory of different hosts (different OS) over the network-you can mount the directory of the remote host through Ubuntu nfs, and access the directory as if it were a local directory!
Generally speaking, sharing among unix-like systems can be easily realized by using Ubuntu nfs. But if you need to share between unix-like and windows systems, you have to use samba!
Ubuntu nfs runs on the basis of SUN's RPC (Remote Procedure Call, remote procedure call). RPC defines a system-independent method to realize inter-process communication. Therefore, Ubuntu nfs server can also be regarded as RPC server.
Because Ubuntu nfs is a RPC service program, before using it, you must map the port-- set through portmap. For example, when a Ubuntu nfs client initiates a Ubuntu nfs service request, it needs to get a port first. So it first gets port number through portmap. (not only Ubuntu nfs, but all RPC service programs need to be set up before starting.)
Several files related to Ubuntu nfs, commands
1, / etc/exports
Access to Ubuntu nfs volumes is approved by exports, which enumerates several hostnames that have access to file systems on Ubuntu nfs servers.
2, / sbin/exportfs
Maintain Ubuntu nfs resource sharing. You can use it to reset the shared directory of / etc/exports, uninstall the shared directory of Ubuntu nfs Server, or re-share.
3, / usr/sbin/showmount
It is used on the Ubuntu nfs Server side, while showmount is mainly used on the Client side. Showmount can be used to view directory resources shared by Ubuntu nfs.
4, / var/lib/Ubuntu nfs/xtab
Ubuntu nfs record document: it allows you to see which Client is connected to the Ubuntu nfs host.
The following are not directly responsible for Ubuntu nfs, in fact they are responsible for all RPC
5, / etc/default/portmap
In fact, portmap is responsible for mapping all RPC service ports, and its content is very simple (more on this later).
6, / etc/hosts.deny
Set the host that denies portmap service
7, / etc/hosts.allow
Set the hosts that allow portmap services
Install Ubuntu nfs
There is no Ubuntu nfs server installed by default on Debian/Ubuntu. First, install the Ubuntu nfs service program:
$sudo apt-get install nfs-kernel-server
(apt automatically installs nfs-common and portmap when you install nfs-kernel-server)
In this way, the host is the equivalent of nfs Server.
Similarly, the target system, as a client of Ubuntu nfs, needs to install the Ubuntu nfs client program. If it is a Debian/Ubuntu system, you need to install nfs-common.
$sudo apt-get install nfs-commmon
Both nfs-common and nfs-kernel-server rely on portmap!
Configure Ubuntu nfs
Configure portmap
Method 1: edit / etc/default/portmap and remove-I 127.0.0.1.
Method 2: $sudo dpkg-reconfigure portmap, for Should portmap be bound to the loopback address? Choose N.
Configuration / etc/hosts.deny
(prohibit any host (host) from Ubuntu nfs connection with your Ubuntu nfs server), add:
Ubuntu nfs DAEMONS
Portmap:ALL
Lockd:ALL
Mountd:ALL
Rquotad:ALL
Statd:ALL
Configuration / etc/hosts.allow
Allow the hosts you want to connect to your Ubuntu nfs server. The following steps will allow any host whose IP address begins with 192.168.2 (connected to the Ubuntu nfs server), or to specify a specific IP address. See man page hosts_access (5), hosts_options (5). Join:
Ubuntu nfs DAEMONS
Portmap: 192.168.2.
Lockd: 192.168.2.
Rquotad: 192.168.2.
Mountd: 192.168.2.
Statd: 192.168.2.
/ etc/hosts.deny and / etc/hosts.allow set access to portmap. Using these two configuration files is somewhat similar to the meaning of "mask". All users are now prohibited from accessing portmap in / etc/hosts.deny. Then allow some users to access portmap in / etc/hosts.allow.
Run $sudo / etc/init.d/portmap restart to restart portmap daemon.
Configuration / etc/exports
The Ubuntu nfs mount directory and permissions are defined by the / etc/exports file
For example, if I want to share the / home/zp/share directory in my home directory with the IP of 192.168.2.*, add the following statement at the end of the file:
/ home/zp/share 192.168.2.* (rw,sync,no_root_squash)
Or: / home/zp/share 192.168.2.0 take 24 (rw,sync,no_root_squash)
192.168.2.* Ubuntu nfs clients in the network segment can share the contents of the Ubuntu nfs server / home/zp/share directory. And has read and write permissions, and the identity of the user after entering the / home/zp/share directory is root
* add sync, otherwise $sudo exportfs-r will give a warning. Sync is the default option for Ubuntu nfs.
Run $showmount-e to view nfs server's export list. If / etc/exports is changed, run $sudo exportfs-r update and run $sudo / etc/init.d/nfs-kernel-server restart to restart the Ubuntu nfs service)
/ etc/exports is actually the core configuration file of the Ubuntu nfs server. Brother Bird's Linux cuisine lists some exports files.
Test Ubuntu nfs
You can try mounting the local disk (assuming the local host IP address is 192.128.2.1, mount / home/zp/share to / mnt)
$sudo mount 192.168.2.1:/home/zp/share / mnt
Run $df to see the result
$sudo umount / mnt
Pay attention to the read / write permissions of the copied file!
In addition, you can use certain parameters:
Mount-o nolock,rsize=1024,wsize=1024,timeo=15 192.168.2.130:/tmp/ / tmp/ using the method of adding parameters
Thank you for reading! This is the end of the article on "how to configure the Ubuntu nfs installation service version". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.