File System Selection
NFS MFS (Distributed File System) GFS (cloud storage large file)
ext234 XFS (C7 rh7 default)
Selection:
C5:ext3
C6:EXT4 Video downloads, streaming media, databases, small files
The following need to be installed separately:
XFS database MySQL, etc.
ReiserFS large number of small files
0, small and medium-sized websites
1, pay attention to maintenance convenience
2, large concurrency optimization, cache resolution disk pressure: CDN Site Cache Database Front End cache
ls/lib/modules/2.6.32-573.el6.x86_64/kernel/fs/
Why should enterprises share storage?
Web attachments, images, etc. are stored on the NSF server. NSF can relieve stress through a CDN.
Demand:
Website dispatch System |-a backend NFS system supply data to each server
|-b
NFS port is not deterministic:
RPC-Remote Procedure Call
C5:portmap C6:rpcbind
Working process:
NFS port is not fixed
Start the RPC service before you start the Rpcbind service. Rpcbind reports its own port to RPC. RPC tells the client the port.
Cat/etc/red
Uname-r-M
Rpm-qa Rpcbind Portmap
Yum Grouplist
Installation:
Yum groupinstall "NFS file Server"-y
Yum Install nfs-utils rpcbind-y
Route del default GW 10.0.0.253
Route add default GW 10.0.0.254
Service side:
/etc/init.d/rpcbind start
Ps-ef |grep RPC
/etc/init.d/rpcbind status
rpcinfo-p localhost View listings
RPC Default 111 port
/etc/init.d/nfs start
Rpcinfo-p localhost
Chkconfig NFS On
Chkconfig Rpcbind on
Chkconfig--list NFS
Chkconfig--list Rpcbind
More/etc/init.d/rpcbind
Look at the boot sequence.
Client: You can start the RPC service. No NFS Service
/etc/init.d/rpcbind start
Chkconfig Rpcbind on
Chkconfig--list Rpcbind
To configure a share:
Service side:
Ll/etc/exports
Mkdir/data
Vim/etc/exports
#shared data for BBS by Lanny at time
/data 10.0.0.0/24 (Rw,sync)
Cat/etc/exports
/etc/init.d/nfs Reload
Sync writes the data from buffer to the cache.
Halt
Check:
Service side:
SHOWMOUNT-E localhost
Client:
SHOWMOUNT-E 10.1.1.10
Mount:
Mount-t Source Purpose
Mount-t NFS 10.1.1.10:data/mnt
Df-h
Cd/mnt
ll
RM index.html
To the service side look, also lost.
--The client can read the
See if it can be written.
Not be able to write. Although sharing permissions are available. Local directory permissions.
The first way: server: chmod 777 data
Can write.
If you do not add suid, the default properties are logged in users and groups.
ll find out that it was written in nfsnobody identity.
Service side:
To modify the default User:
Cat/var/lib/nsf/etab NFS Permissions list, and so on.
grep 65534/etc/passwd
The second way:
chmod 766/data
Chmod-r Nsfnobody.nsfnobody/data
NFS Mount Optimizations:
Mount-t Nfs-o NOSUID,NOEXEC,NODEV,RW 10.1.1.10:/data/mnt
Unloading:
Umont/mnt
View parameters
grep mnt/proc/mounts
Security testing:
NOEXEC: Program commands cannot be executed
./test.sh does not have permission to execute
chmod +x test.sh do not have permission to execute
SH Test.shs can be executed
Under the ~:
echo pwd > t.sh
./t.sh Can't Execute
chmod +x t.sh can perform
Cp/bin/cat/mnt
/mnt/cat/mnt/test.sh
Ll/mnt/cat
Cannot execute
Cp/bin/cat/opt
/opt/cat/mnt/test.sh
can perform
SUID test
Cp/bin/rm/mnt
chmod U+s RM in the premise of not knowing the original file permissions
LL RM
This article is from the "Lannyma" blog, make sure to keep this source http://lannyma.blog.51cto.com/4544390/1733503
NFS 00 Total Total