introduce NFS the installation, as well as shared files
nfs ( net FileSystem ), by using Span lang= "en-US" style= "FONT-SIZE:12.0PT; Font-family: "georgia", serif; Color:black ">nfs You can access remote files as you would with a local file.
Installation configuration
1. linux ubuntu nfsserver machine and nfs client machine installed separately
"NFSServer"
1 |
sudo apt-get install Nfs-kernel-server |
"NFSClient"
1 |
sudo apt-get install Nfs-common |
2.ConfigurationNFSA directory that needs to be shared, /etc/exportsAdd the directories you want to share at the bottom /home/hadoop/yxlshare
/etc/exports
1 |
/home/ Hadoop/yxlshare * (Rw,sync,no_root_squash) |
3. restart Portmap and NFS server
1 2 |
sudo/ Etc/init.d/portmap Restart sudo/etc/init.d/nfs-kernel-server restart |
4. run the command to see what can be mounted
5. at this point, on the client, mount a local directory to nfs
You can add the fstab , let linux boot auto mount
Usage: Sudomount NFSServer of the IP: shared directory Local directory
Example
1 |
sudo Mount 192.168 1.111 :/home/hadoop/.ssh/home/hadoop/.ssh |
4. at this point, both on the client and on the server , the modification of this directory can be reflected, so that multiple machines share a directory.
Instance
1. sharing hadoopssh authorization Files
when the wholeHadoopcluster, share aAuthorized_keys, so thatSSHJump. You can add a local directory~/nfs_share/, mounted onNFSon.
Then a soft connection is established so that the share is realized.
1 |
Ln-s ~/nfs_share/authorized_keys ~/.ssh/authorized_keys |
2.namenodeha metadata Save
We all know hadoop namenode Zookeeper nfs , you can automatically switch the function.
will beNamenodethe metadata is saved in theNFS, whenNamenodeThe machine has been hung off, usingZookeeperFind another replacement machine, and then the replacement machine readsNFSmetadata on the data, which becomes theNamenode.
here is a diagram that illustrates the situation . Reference from http://www.cnblogs.com/commond/archive/2009/07/28/1533223.html
Nfs
From for notes (Wiz)
Install NFS and share file