I. experiment environment:
System Version:
Red Hat Enterprise Linux Server release 5.6
Host Name |
Alias |
IP |
System Version |
Shared directory/mount point |
201701 |
201701.licz.com |
192.168.2.111 |
OEL5.6 |
Shared directory/home/grid |
201702 |
Hotel02.licz.com |
192.168.2.112 |
OEL5.6 |
Mount point/nfs_share |
201703 |
201703.licz.com |
192.168.2.113 |
OEL5.6 |
Mount point/nfs_share |
..... |
|
|
|
|
Shared directory:
The NFS directory is placed on the host at ipv01.
Ii. Install nfs and rpcbind or portmap
1. Software introduction:
NFS is short for Network File System, that is, Network File System. the Network File System is one of the file systems supported by FreeBSD, also known as NFS. NFS allows a system to share directories and files with others on the network. By using NFS, users and programs can access files on the remote system just like accessing local files.
RPC is the Remote Procedure Call Protocol (Remote Procedure Call Protocol ).
RPCBIND is used to replace the portmap component in the old version. In short, RPCBIND is used to bind different services to corresponding ports to support inter-machine interoperability.
The main function of the portmap Process is to convert the RPC program number to the Internet port number. It must be run when RPC is used.
Note: Because the rpcbind component does not exist in my linux version, you need to install the portmap component for an experiment.
2. Check and install the following nfs and portmap rpm packages.
-- If it is missing, you can find and install it on the installation disk.
[Root @ defaults 01 bind] # rpm-qa | grep nfs
Nfs-utils-1.0.9-50.el5
Nfs4-acl-tools-0.3.3-1.el5
Nfs-utils-lib-1.0.8-7.6.el5
[Root @ users 01 ~] # Rpm-qa | grep portmap
Portmap-4.0-65.2.2.1
3. Check and start the NFS and portmap services
[Root @ resolve 01 named] # service nfs status
Rpc. mountd stopped
Nfsd stopped
Rpc. rquotad stopped
[Root @ resolve 01 named] # rpm-qa | grep rpc
[Root @ resolve 01 named] # service rpcbind status
Rpcbind: unrecognized service
[Root @ users 01 ~] # Service portmap status
Portmap stopped
[Root @ users 01 ~] # Service portmap start
Start portmap: [OK]
[Root @ users 01 ~] # Service nfs start
Start the NFS service: [OK]
Disable NFS quota: [OK]
Start the NFS daemon: [OK]
Start NFS mountd: [OK]
4. Configure Service Startup
[Root @ users 01 ~] # Chkconfig nfs on
[Root @ users 01 ~] # Chkconfig portmap on
5. Set it to the shared directory/home/grid/
[Root @ users 01 ~] # Vi/etc/exports
/Home/grid * (sync, rw) # Add this content
Note:
/Home/grid is the directory to be shared by NFS.
* Indicates all IP addresses.
Rw is read/write, ro is read-only
Sync writes data to the hard disk immediately, and rsync writes data to the cache preferentially.
The No_root_squas root user has full management access permissions to the root directory (if this parameter is not configured, the remote root user will be read-only)
6. Restart the portmap and nfs services.
[Root @ users 01 ~] # Service portmap restart
Stop portmap: [OK]
Start portmap: [OK]
[Root @ users 01 ~] # Service nfs restart
Disable NFS mountd: [OK]
Disable the NFS daemon: [OK]
Disable NFS quotas: [OK]
Disable NFS: [failed]
Start the NFS service: [OK]
Disable NFS quota: [OK]
Start the NFS daemon: [OK]
Start NFS mountd: [OK]
-- Disable the firewall.
7. output the local mount point, that is, the shared directory on the slave 01 (master ).
[Root @ users 01 ~] # Showmount-e localhost
Export list for localhost:
/Home/grid *
8. Configure the Mount directory on the client
[Root @ 12702 ~] # Mkdir/nfs_share
[Root @ 12702 ~] # Mount-t nfs 192.168.2.111:/home/grid/nfs_share/
[Root @ 12702 ~] # Cd/nfs_share/
-Bash: cd:/nfs_share/: insufficient Permissions
[Root @ 12702/] # su-grid
[Grid @ 000002 ~] $ Cd/nfs_share/
-- Create a test file in the shared directory
[Root @ 000001 home] # cd grid
[Root @ 000001 grid] # touch aaa.txt
-- View on the client
[Grid @ clusters 02. ssh] $ cd/nfs_share/
[Grid @ hotel02 nfs_share] $ ll
Total 0
-Rw-r -- 1 root 0 03-05 09:10 aaa.txt
Note: use the same method to operate on other clients (ipv03 ).
9. Set the nfs shared directory to be automatically mounted after startup.
-- Modify the/etc/fstab file on the client and add the following content.
[Root @ 12702 ~] # Vi/etc/fstab
192.168.2.111:/home/grid/nfs_share nfs ults 1 1
[Root @ brief 03 ~] # Vi/etc/fstab
192.168.2.111:/home/grid/nfs_share nfs ults 1 1
[Root @ brief 03 ~] # Cat/etc/fstab
LABEL = // ext3 defaults 1 1
LABEL =/boot ext3 defaults 1 2
Tmpfs/dev/shm tmpfs defaults 0 0
Devpts/dev/pts devpts gid = 5, mode = 620 0 0
Sysfs/sys sysfs defaults 0 0
Proc/proc defaults 0 0
LABEL = SWAP-sda3 swap defaults 0 0
192.168.2.111:/home/grid/nfs_share nfs ults 1 1
Build a Hadoop environment on Ubuntu 13.04
Cluster configuration for Ubuntu 12.10 + Hadoop 1.2.1
Build a Hadoop environment on Ubuntu (standalone mode + pseudo Distribution Mode)
Configuration of Hadoop environment in Ubuntu
Detailed tutorial on creating a Hadoop environment for standalone Edition
Build a Hadoop environment (using virtual machines to build two Ubuntu systems in a Winodws environment)