³¬È«µÄNFSÎĵµ(FOR LINUX)
NFS server¿ÉÒÔ¿´×÷ÊÇÒ»¸öFILE SERVER,Ëü¿ÉÒÔÈÃÄãµÄPCͨ¹ýÍøÂ罫Զ¶ËµÃNFS SERVER¹²Ïí³öÀ´µÄµµ°¸MOUNTµ½×Ô¼ºµÄϵͳÖУ¬ÔÚCLIENT¿´À´Ê¹ÓÃNFSµÄÔ¶¶ËÎļþ¾ÍÏóÊÇÔÚʹÓñ¾µØÎļþÒ»Ñù¡£
NFSÐÒé´Óµ®Éúµ½ÏÖÔÚΪֹ£¬ÒѾÓжà¸ö°æ±¾£¬ÈçNFS V2£¨rfc1094£©,NFS V3£¨rfc1813£©£¨×îеİ汾ÊÇV4£¨rfc3010£©¡£
redhat µÄrpc.statd·þÎñ:
¹²ÏíºÍ¼ÓÔØNFSÎļþϵͳÐèҪʲô·þÎñ?
½â¾ö·½·¨:ºìñÆóÒµLinuxʹÓúËÐļ¶µÄÖ§³ÖºÍÊØ»¤½ø³ÌµÄ×éºÏÀ´ÌṩNFSÎļþ¹²Ïí.NFSÒÀ¿¿Ô¶³Ì¹ý³Ìµ÷ÓÃ(RPC)ÔÚ¿Í»§¶ËºÍ·þÎñÆ÷¶Ë·ÓÉÇëÇó¡£ÔÚLinuxÏÂRPC·þÎñÓÉportmap·þÎñ¿ØÖÆ.
ΪÁ˹²ÏíºÍ¼ÓÔØNFSÎļþϵͳ£¬ÏÂÃæµÄ·þÎñÒªÒ»Æð¹¤×÷:
* nfs - Æô¶¯ÏàÓ¦RPC·þÎñ½ø³ÌÀ´·þÎñ¶ÔÓÚNFSÎļþϵͳµÄÇëÇó.
* nfslock - Ò»¸ö¿ÉÑ¡µÄ·þÎñ£¬ÓÃÓÚÆô¶¯ÏàÓ¦µÄRPC½ø³Ì£¬ÔÊÐíNFS¿Í»§¶ËÔÚ·þÎñÆ÷É϶ÔÎļþ¼ÓËø.
* portmap - LinuxµÄRPC·þÎñ,ËüÏìÓ¦RPC·þÎñµÄÇëÇóºÍÓëÇëÇóµÄRPC·þÎñ½¨Á¢Á¬½Ó.
ÏÂÃæµÄRPC½ø³ÌÔÚºǫ́һÆð¹¤×÷·þÎñÓÚNFS·þÎñ£º
* rpc.mountd - Õâ¸ö½ø³Ì½ÓÊÜÀ´×ÔNFS¿Í»§¶ËµÄ¼ÓÔØÇëÇóºÍÑéÖ¤ÇëÇóµÄÎļþϵͳÕýÔÚ±»Êä³ö.Õâ¸ö½ø³ÌÓÉNFS·þÎñ×Ô¶¯Æô¶¯£¬²»ÐèÒªÓû§µÄÅäÖÃ.
* rpc.nfsd - Õâ¸ö½ø³ÌÊÇNFS·þÎñÆ÷.ËüºÍLinuxºËÐÄÒ»Æð¹¤×÷À´Âú×ãNFS¿Í»§¶ËµÄ¶¯Ì¬ÐèÇó£¬ÀýÈçÌṩΪÿ¸öNFS¿Í»§¶ËµÄÿ´ÎÇëÇó·þÎñÆ÷Ïß³Ì.Õâ¸ö½ø³Ì¶ÔÓ¦ÓÚnfs·þÎñ.
* rpc.lockd - Ò»¸ö¿ÉÑ¡µÄ½ø³Ì£¬ËüÔÊÐíNFS¿Í»§¶ËÔÚ·þÎñÆ÷É϶ÔÎļþ¼ÓËø.Õâ¸ö½ø³Ì¶ÔÓ¦ÓÚnfslock·þÎñ.
* rpc.statd - Õâ¸ö½ø³ÌʵÏÖÁËÍøÂç״̬¼à¿Ø(NSM)RPCÐÒé,֪ͨNFS¿Í»§¶ËʲôʱºòÒ»¸öNFS·þÎñÆ÷·ÇÕý³£ÖØÆô¶¯.Õâ¸ö½ø³Ì±»nfslock·þÎñ×Ô¶¯Æô¶¯£¬²»ÐèÒªÓû§µÄÅäÖÃ.
* rpc.rquotad - Õâ¸ö½ø³Ì¶ÔÓÚÔ¶³ÌÓû§ÌṩÓû§Åä¶îÐÅÏ¢. Õâ¸ö½ø³Ì±»nfs·þÎñ×Ô¶¯Æô¶¯£¬²»ÐèÒªÓû§µÄÅäÖÃ.
Í£ÓÃÃüÁî
service nfslock stop
chkconfig nfslock off
rpcbind·þÎñÍ£Ö¹ÃüÁî
service portmap stop
¶þ¡¢¸÷NFSÐÒé°æ±¾µÄÖ÷ÒªÇø±ð
V3Ïà¶ÔV2µÄÖ÷ÒªÇø±ð£º
1¡¢Îļþ³ß´ç
V2×î´óÖ»Ö§³Ö32BITµÄÎļþ´óС(4G),¶øNFS V3ÐÂÔö¼ÓÁËÖ§³Ö64BITÎļþ´óСµÄ¼¼Êõ¡£
2¡¢Îļþ´«Êä³ß´ç
V3ûÓÐÏÞ¶¨´«Êä³ß´ç£¬V2×î¶àÖ»ÄÜÉ趨Ϊ8k£¬¿ÉÒÔʹÓÃ-rsize and -wsize À´½øÐÐÉ趨¡£
3¡¢ÍêÕûµÄÐÅÏ¢·µ»Ø
V3Ôö¼ÓºÍÍêÉÆÁËÐí¶à´íÎóºÍ³É¹¦ÐÅÏ¢µÄ·µ»Ø£¬¶ÔÓÚ·þÎñÆ÷µÄÉè
Ïà¹ØÎĵµ£º
sock_rawÔʼÌ×½Ó×Ö±à³Ì¿ÉÒÔ½ÓÊÕµ½±¾»úÍø¿¨ÉϵÄÊý¾ÝÖ¡»òÕßÊý¾Ý°ü,¶ÔÓë¼àÌýÍøÂçµÄÁ÷Á¿ºÍ·ÖÎöÊǺÜÓÐ×÷ÓõÄ.Ò»¹²¿ÉÒÔÓÐ3ÖÖ·½Ê½´´½¨ÕâÖÖsocket
1.socket(AF_INET, SOCK_RAW, IPPROTO_TCP|IPPROTO_UDP|IPPROTO_ICMP)·¢ËͽÓÊÕipÊý¾Ý°ü
2.socket(PF_PACKET, SOCK_RAW, htons(ETH_P_IP|ETH_P_ARP|ETH_P_ALL))·¢ËͽÓÊÕÒÔ ......
===============================================================================
= »¶ Ó ÔÄ ¶Á ¡¶ V I M ½Ì ³Ì ¡· —— °æ±¾ ......
×îºÃÊÇÏÈ×°XP£¬ºó×°LINUX£¬ÕâÊdz£Ê¶¡£Èç¹ûÒѾÕâÑùÁË£¬×°ÍêXPºó¿Ï¶¨²»ÄÜÆô¶¯LINUX¡£
ÕâÐèÒªÓÃLINUX°²×°ÅÌÖØÐÂÐÞ¸´Æô¶¯ÏÖØдMBR£©¼°ÊÖ¹¤±à¼LINUXµÄÆô¶¯²Ëµ¥
ϵͳÒýµ¼²»ÁËlinuxÁË£¬Ö»ÄܽøÈëxp;
²»ÊÇ°É£¬ÓÖÒªÖØ×°linux?
»Ø´ðÊÇ£º²»ÐèÒª;
ÏÂÃæ¾ÍÊǽâ¾ö·½°¸:
1.½øÈëxpϵͳ£»
2.°²×°wingrupÕâ¸öÈí¼þ;
3.ÖØÐÂÆô¶¯£¬Ñ¡Ô ......
errno
ÊǸöint±äÁ¿£¬·µ»Ø´íÎó
ÓдíÎóʱʹÓ÷½·¨
fprintf(fp, "%s", strerror(errno))
perrorÓ÷¨
#include <stdio.h>
#include <stdlib.h>
#include<errno.h>
int main(void)
{
FILE *fp;
if((fp=fopen("aaa.txt","r+"))==NULL)
{
puts("²»ÄܽøÈ ......
¹¦ÄÜÃèÊö£º
ÔÚÏûÏ¢¶ÓÁÐÉϽøÐÐÊÕ·¢ÏûÏ¢¡£ÎªÁË·¢ËÍÏûÏ¢£¬µ÷Óýø³Ì¶ÔÏûÏ¢¶ÓÁбØÐëÓÐдȨÄÜ¡£½ÓÊÕÏûϢʱ±ØÐëÓжÁȨÄÜ¡£
Ó÷¨£º
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/msg.h>
int msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg);
ssize_t msgrcv ......