Man statd (rpc. statd Chinese manual), statdrpc. statd
Rpc. the statd program mainly implements NFS lock-related content, such as common file locks (NLM, NSM), file delegation, and lease. However, note that, it can be combined with sm-policy to implement the entire NFS lock mechanism. For details, see the description in the translation documentation.
RPC. STATD (8) System Manager's Manual RPC. STATD (8) NAME rpc. statd-NSM service daemon SYNOPSIS rpc. statd [-dh? FLNvV] [-H prog] [-n my-name] [-o outgoing-port] [-p listener-port] [-P path] [-- nlm-port] [-- nlm-udp-port] DESCRIPTION file lock is not part of the persistent file system status. Therefore, when the host restarts, the lock status will be lost. When the remote host restarts, the Network File System must be able to detect the loss of the lock status. When the NFS client restarts, the NFS service must release all the file locks applied by the client. After the server restarts, the client must be able to remind the server of all the file locks it has applied. For NFSv2 and NFSv3, the Network Status Monitor (NSM) protocol is used to notify the NFS peer about the restart. On Linux, The NSM service process is composed of two independent user space programs: ● rpc. statd: This daemon monitors restart messages of other hosts and manages the list of hosts to be notified when the local host restarts. ● Sm-ipvy is a helper program used to notify the NFS peer when the local system is restarted. Note: rpc. statd is the receiver of the restart information, while sm-policy is the notification of the information. The local NFS lock manager (NLM) uses its local rpc. statd issued a warning that the status of each remote peer in the list needs to be monitored. When the local system is restarted, the sm-notify Command notifies the NSM service on the peer about the restart. When the remote host restarts, the remote peer sm-ipvy notifies the local rcp. statd, and then tell the local NFS lock manager. The local lock manager maintains the lock of the file corresponding to the restart end. The first file lock interaction between the nsm operation in detail nfs client and the server will enable NLM at both ends to contact their local NSM service to store their peer information. On Linux, let the local manager contact the rpc. statd daemon. Rpc. statd records the NFS peer information on persistent storage. This information describes how to contact a remote peer when the local system is restarted, and how to identify the Peer to report its restart information, and how to notify NLM when the peer says it has restarted. Each client sends a host name called client caller_name in each filelock request. The NFS server can use this host name to send an asynchronous GRANT call to the client, or notify the client that it has restarted. The Linux NFS server can provide the client's caller_name or client's network address to rpc. statd. To comply with the NSM protocol, this name or address is called the peer mon_name. In addition, the local lock manager will tell rpc. statd its own host name. To comply with the NSM protocol, this host name is called my_name. In NFS, the NFS server does not notify the client of its host name interaction. Therefore, the NFS client does not actually know the mon_name of the server, even though it will be used in the sm_policy request. The Linux NFS client identifies the starting NFS server by using the server host name or address obtained from the mounting command. Reboot notification when the local system is restarted, the local sm-ipvy command reads the monitoring peer list from persistent storage and sends a sm_ipvy request to each remote NSM service process in the list, it uses the mon_name string to specify the sending destination. To identify the host that has been restarted, the host will use the sm-policy command to send the my_name string. Remote rpc. statd will use this string to match the peer in the monitoring list to find the host sending the SM_NOTIFY request. If rpc. statd does not find the peer that matches the received SM_NOTIFY request in its monitoring list, the notification will not be forwarded to the local lock manager. In addition, each peer has a unique 32-bit integer NSM status code. After each restart, the sm-running y command will repeat it. Rpc. statd uses this number to identify whether to restart or notify replay. Part of NFS lock recovery is to find out which peer needs to be monitored again. After each restart, the sm-cmdy command clears the monitoring list on persistent storage. OPTIONS-d, -- no-syslog if the "-F" option is specified at the same time, it means that rpc. statd will not write logs to syslog, but be output to stderr. -F, -- foreground makes rpc. statd attached to the control terminal so that NSM operations can be directly monitored, mainly for debugging. If this option is not specified, rpc. statd will run in the background immediately after it is started. -H ,-?, -- Help: output the instructions for rpc. statd and exit. -H, -- ha-callout prog specifies a high-availability callout program. If this option is not specified, no callout program is executed. For details, see the section "High-availability callouts" below. -L, -- no-policy prevents rpc. statd from running the sm-policy command at startup, as well as preventing existing NSM status numbers and monitoring column tables from being retained. Note: The sm-notify Command contains a check to ensure that it runs only once after each system restart. If rpc. statd is restarted without the "-L" option, this prevents false restart notifications. -N, -- name ipaddr | hostname specifies the address bound to the RPC listening socket. If this option is not specified, rpc. statd uses the wildcard address (0.0.0.0 ). This string will also be passed to the sm-Restart y command, used as the source address when sending the restart notification request. For details, see the man document of sm-Policy (8. -N: Ask rpc. statd to execute the sm-policy command and then exit. Because the sm-policy command can be run directly, this option has been deprecated. -O, -- outgoing-port specifies the source port number used when the sm-Restart y Command sends the restart notification. For details, see the man document of sm-Policy (8. -P, -- port specifies the port number of the rpc listener socket. If this option is not specified, rpc. statd will try to get it from/etc/services. If it is obtained successfully, set this port number for all listening sockets; otherwise, a random port number will be selected for each listening socket. This option can be used to adjust the port number when SM_NOTIFY needs to traverse the firewall to prevent blocking by the firewall. -T, -- nlm-port specifies the port number for listening to NLM requests. Unless "-U" is used to specify the UDP port number separately, the TCP and UDP port numbers will be monitored at the same time. -U, -- nlm-udp-port specifies the UDP port number that listens to NLM requests. -P, -- state-directory-path pathname specifies the parent directory of the NSM state information storage path. If this option is not specified, the default value is/var/lib/nfs/statd. After the program starts, rpc. statd will try to set its owner and group with UID and GID for this directory. -V,-V, -- version: output the version number of rpc. statd and exit. SECURITY The rpc. statd daemon must be started as root to acquire privileges needed to create sockets with privileged source ports, and to access the state information database. because rpc. statd mai-ntains a long-running network service, however, it drops root privileges as soon as it starts up to reduce the risk of a privilege escalation attack. during normal operation, the valid user ID it c Hooses is the owner of the state directory. this allows it to continue to access files in that directory after it has dropped its root privileges. to control which user ID rpc. statd chooses, simply use chown (1) to set the owner of the state directory. you can also protect your rpc. statd listeners using the tcp_wrapper library or iptables (8 ). to use the tcp_wrapper library, add the hostnames of pee Rs that shoshould be allowed access to/etc/hosts. allow. use the daemon name statd even if the rpc. statd binary has a different filename. for further information see the tcpd (8) and hosts_access (5) man pages. the lock recovery after the additional notes host is restarted is crucial for maintaining data consistency and preventing unnecessary application suspension. To make rpc. statd more efficient in matching SM_NOTIFY requests, some best practices should be followed, including: the system's UTS name must match the DNS name used by the NFS peer for connection. (Note: If you do not know what the UTS name is, you can simply think that the UTS name is the host name.) The UTS name of the system should always be in the fqdn format. It is recommended that the forward and reverse DNS Mappings of the system's UTS names be consistent. The Host Name of the server that the client uses to mount is best matched with the mon_name in the sm_policy request it sends. When you detach an NFS file system, you do not need to stop status monitoring at either end of the client or server. The two ends may continue to be monitored for a period of time to prevent the next occurrence of new mounting and additional file lock NFS traffic between the two ends. In Linux, if the kernel lock module is not installed, all remote NFS clients will not be monitored. This may occur on the NFS client. For example, the automatic Mount tool removes all NFS mount points because they are idle and inactive. High-availability callouts can execute a specific callback (callout) program when rpc. statd successfully processes SM_MON, SM_UNMOU, and SM_UNMON_ALL requests or receives SM_NOTIFY. This program can be used in a high-availability NFS (HA-NFS) environment to track lock statuses, especially when resources need to be migrated after a node host is restarted. The name of the callout program is specified by the "-H" option of rpc. statd. The program runs with four parameters: add-client, del-client, or sm-producer y, depending on the reason for calling callout. The second parameter is the mon_name of the monitoring peer. The third parameter is the caller_name when the lock manager wants to add-client or del-client. Otherwise, it is the IP address that sends the SM_NOTIFY request. The fourth parameter is state_value in the SM_NOTIFY request. IPv6 and TI-RPC support TI-RPC is a pre-requisite for supporting NFS on IPv6. If TI-RPC support is built into rpc. statd, it attempts to start listeners on network transports marked 'visable' in/etc/netconfig. as long as at least one network transport listener starts successfully, rpc. statd will operate. FILES/var/lib/nfs/statd/sm directory containing monitor list/var/lib/nfs/statd/sm. bak directory containing running y list/var/lib/nfs/statd/state NSM state number for this host/var/run. statd. pid file/etc/netconfig network transport capability databaseSEE ALSO sm-Policy (8), nfs (5), rpc. nfsd (8), rpcbind (8), tcpd (8), hosts_access (5), iptables (8), netconfig (5) RFC 1094-"NFS: network File System Protocol Specification "RFC 1813-" NFS Version 3 Protocol Specification "OpenGroup Protocols for Interworking: XNFS, version 3 W-Chapter 11 AUTHORS Jeff Uphoff <juphoff@users.sourceforge.net> Olaf Kirch <okir@monad.swb.de> H. j. lu
NFS translation is as follows:
Translation: man rpcbind (rpcbind Chinese manual) Translation: man nfsd (rpc. translation: man mountd (rpc. translation: man statd (rpc. statd Chinese manual) Translation: man sm-Policy (sm-policy command Chinese manual) Translation: man exportfs (exportfs command Chinese manual) Part Translation: man nfs
Back to series article outline: http://www.cnblogs.com/f-ck-need-u/p/7048359.html
Reprinted please indicate the source: Success!