Linux¹ÒÔØÍøÂçÎļþ¼Ð£¨¼òµ¥NFSÅäÖã©
###########################################
### ¹ÒÔØÍøÂçÎļþ¼Ð ###
###########################################
NFS˵Ã÷
=======
NFSÊÇNet File SystemµÄ¼òд,¼´ÍøÂçÎļþϵͳ.
NFSÔÊÐíÒ»¸öϵͳÔÚÍøÂçÉÏÓëËüÈ˹²ÏíĿ¼ºÍÎļþ¡£Í¨¹ýʹÓÃNFS£¬Óû§ºÍ³ÌÐò¿ÉÒÔÏó·ÃÎʱ¾µØÎļþÒ»Ñù·ÃÎÊÔ¶¶ËϵͳÉϵÄÎļþ¡£
ʹÓÃNFSµÄÔÒò
=============
ÓÉÓÚÒªÔÚ¹«Ë¾ÄÚ²¿ÅäÖÃYUM£¬¶øÇÒ×¼±¸ÓÃApache·¢²¼,ÄÜͨ¹ýHttp·ÃÎÊ¡£A·þÎñÆ÷ÉÏÓÐhttp·þÎñ,µ«Êǿռ䲻×ã¡£B·þÎñÆ÷ÉÏÓÐ×ã¹»¿Õ¼ä¡£A¡¢B¾ùΪLinux
ËùÒÔ×¼±¸Í¨¹ýNFS,½«BÉϵÄ/yum¹ÒÔص½AµÄ/mnt/yumÖС£
¼ÙÉèA IP:192.168.0.100
¼ÙÉèB IP:192.168.0.200
NFSʹÓøÅÀ¨
===========
·þÎñÆ÷¶ËÒªÇó: //ÔÚÉÏÃæµÄÀý×ÓÖÐBΪ·þÎñÆ÷¶Ë
portmap Æô¶¯ # service portmap start
nfs Æô¶¯ # service nfs start
¿Í»§¶ËÒªÇó: //ÔÚÉÏÃæµÄÀý×ÓÖÐAΪ·þÎñÆ÷¶Ë
portmap Æô¶¯ # service portmap start
ÔÚAÉÏÖ´ÐйÒÔØÃüÁî:
# mount -t nfs 192.168.0.200:/yum /mnt/yum (×¢ÒâÖ÷»úºóµÄðºÅ)
¾ßÌåNFS Server ÅäÖÃ
===================
1.°²×°Èí¼þ
°üº¬µÄÈí¼þ°ü£º
NFSÐèÒª5¸öRPM£¬·Ö±ðÊÇ£º
setup-*£º¡¡¡¡¡¡¡¡¹²ÏíNFSĿ¼ÔÚ/etc/exportsÖж¨Òå
initscripts-*£º¡¡°üÀ¨Òýµ¼¹ý³ÌÖÐ×°ÔØÍøÂçĿ¼µÄ»ù±¾½Å±¾
nfs-utils-*£º¡¡¡¡°üÀ¨»ù±¾µÄNFSÃüÁîÓë¼à¿Ø³ÌÐò
portmap-*£º¡¡¡¡¡¡Ö§³Ö°²È«NFS RPC·þÎñµÄÁ¬½Ó
quota-*£º¡¡¡¡¡¡¡¡ÍøÂçÉϹ²ÏíµÄĿ¼Åä¶î£¬°üÀ¨rpc.rquotad £¨Õâ¸ö°ü²»ÊDZØÐëµÄ£©
//¼ì²éϵͳÊÇ·ñ°²×°ºÃËùÐèµÄÌ×¼þ
# rpm -qa | nfs
# rpm -qa | portmap
//Æô¶¯nfs·þÎñÇ°±ØÐëÆô¶¯portmap·þÎñ
nfs-utils°üÀ¨rpc.nfsdºÍrpc.mountd
Èç¹ûÒÔÉÏÈí¼þ¶¼°²×°ÁË£¬ÏÂÃæ¾Í¿ÉÒÔ¿ªÊ¼ÅäÖÃÁË.
2.Server ¶ËÅäÖÃ
NFS Æô¶¯ÐèÒªµÄ·þÎñ£º
rpc.nfsd: ¹ÜÀíClientÊÇ·ñÄܹ»µÇ½Ö÷»úµÄȨÏÞ£¬»¹°üÀ¨µÇ½ÕßµÄIDÅбð
rpc.mountd£º¹ÜÀíNFSµÄÎļþϵͳ£¬µ±client¶Ëͨ¹ýrpc.nfsdµÇ½Ö÷»úºó
rpc.rquotad:´ÅÅÌÅä¶î¹ÜÀí
# vi /etc/exports
//±à¼´ËÎļþÔö¼ÓNFSµÄ¹²ÏíÄÚÈÝ,Èç¹ûûÓиÃÎļþÔòÔö¼Ó.
exportsÖ÷Òª²ÎÊý:
rw:¿É¶ÁдȨÏÞ
ro:Ö»¶ÁȨÏÞ
no_root_squash:¶ÔÓڵǽNFSÖ÷»úµÄ¹²ÏíĿ¼Óû§Èç¹ûÊÇrootµÄ»°Ôò¶Ô¸ÃĿ¼¾ßÓÐrootȨÏÞ¡£ÕâÑù×ö¼«
²»°²È«£
Ïà¹ØÎĵµ£º
Red Hat Linux ѧϰ±Ê¼Ç
1. ÔÚlinux ÉϺÍÆäËû¼ÆËã»ú¹²ÏíÎļþ£¬ÐèÒªÔÚlinuxÉϴftp server (vsftp)
2. Æô¶¯linuxÉϵÄftp server ʹÓÃÃüÁservice vsftpd start
3. ......
˵Ã÷£º
´ó¼ÒºÃ£¬ÎÒÓõÄÊÇÐéÄâ»úÏÂlinux»·¾³½øÐа²×°µÄoracle 11g Êý¾Ý¿â£¬ÓÐЩ²»Í׵ĵط½Çë¶à¶àÖ¸½Ì¡£
Ê×ÏÈÒª²Î¿¼Ô°æµÄ°²×°Ê¹ÓÃ˵Ã÷Îĵµ£¬¸ù¾ÝÉÏÃæµÄÃèÊöµÄÒªÇó½øÐа²×°²Ù×÷¡£
ÈçÏÂÊÇÊÖ¶¯²Ù×÷µÄ·½·¨£º
Ò»£®¼ì²élinux»·¾³RPM°üµÄÊÇ·ñÍêÈ«°²×°£¬²¢¼Ç¼ȱÉÙµÄRPM°üÎļþ²¢½øÐа²×°¡£
[root@mylinux ~]# r ......
#include <stdio.h>
#include <sys/select.h>
#include <termios.h>
#include <unistd.h>
#include <ctype.h>
#define STDIN 0
int main()
{
struct timeval tv = {0,0};
struct termios term , termbak;
& ......
rm -rf mydir /* ɾ³ýmydirĿ¼ */
cd mydir /* ½øÈëmydirĿ¼ */
cd – /* »ØÉÏÒ»¼¶Ä¿Â¼ */
cd ~ /* »Ø¸ùĿ¼ */
mv tools tool /* °ÑtoolsĿ¼¸ÄÃûΪtool */
ln -s tool bac
/* ¸øtoolĿ¼´´½¨ÃûΪbacµÄ·ûºÅÁ´½Ó,×îÊìϤµÄÓ¦¸Ã¾ÍÊÇFTPÖÐwwwÁ´½Óµ½public_htmlĿ¼ÁË */
cp -a tool /home/leavex/www /* °ÑtoolÄ ......
°²×°²½Öè
1ÏÈ°²×°ºÃµÚÒ»¸ömysql :
#tar zxvf mysql*.tar.gz
#cd mysql*
#groupadd mysql
#useradd -g mysql mysql
#./configure --prefix=/usr/local/mysql #make
#make install
#scripts/mysql_install_db
#chown -R root /usr/local/mysql
#chown -R mysql /usr/local/mysql/var
#chgr ......