Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Description of important Services of Linux (1)

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Overview of NFS

NFS (Network File System) is the network file system, which allows computers in the network to share resources over the TCP/IP network. In the application of NFS, the client application of the local NFS can read and write files located on the remote NFS server transparently, just like accessing the local file.

First developed by sun, it is a method to realize disk sharing among unix-like systems.

working principle

As shown in the figure above, when we set up a shared directory / data/share on the NFS server, other NFS clients with permission to access the NFS server can mount this directory locally and see all the data under the server / data/share. NFS transfers data between the server and the Client through the network. Both sides must have ports, so how does NFS Server know which port to use for data transmission? NFS will actually randomly select ports for data transmission. NFS servers are realized through remote procedure call RPC (Remote Procedure Call) protocol, so, RPC manages the NFS port assignment of the server, and the client needs to transmit data, then the client's RPC will first ask the server's port with the server's RPC to get to the port. Then establish a connection and then transfer the data

RPC (Remote Procedure Call)-remote procedure call, which is a protocol that requests services from remote computer programs over the network without knowing the underlying network technology. The RPC protocol assumes the existence of certain transport protocols, such as TCP or UDP, to carry information data between communication programs. In the OSI network communication model, RPC spans the transport layer and the application layer. RPC makes it easier to develop applications, including web-based distributed multiprograms. The NFS server has to register with RPC when it starts, so the NFS server is also a RPC server.

Software required for NFS services

The whole program of nfs-utils:NFS service, including rpc.nfsd, rpc.mountd daemons and related documentation, as well as the execution command file and so on.

The main program of RPC under rpcbind:Centos.x. NFS can be regarded as a rpc program, before interacting with any RPC program, we need to do a good job of mapping ports and functions, which is done by RPCBIND services. Therefore, the NFS service must be started before the RPCBIND service is provided.

Overview of named

Named service, that is, dns, generally speaking, domain names are more meaningful and easier to remember than IP addresses, so users are usually more accustomed to entering domain names to access resources in the network, but hosts on the Internet can only identify each other's hosts through IP, so DNS domain name resolution service is needed.

Usually, the general structure of Internet host domain name is: host name. Third-level domain name. Second-level domain name. Top-level domain name.

TLD (top level domain)

Organizational domain: .com, .org, .net, .cc

Country domain: .cn, .tw, .HK, .iq, .ir, .jp

Reverse domain: IP-- > FQDN translates IP addresses into hostnames, which can only be resolved in the forward direction in the early days, but a mechanism was introduced later. Pointers; but converting from IP to FQDN is a different set of databases.

DNS service protocol uses a hierarchical structure similar to a directory tree to record the mapping relationship between domain name and IP address to form a distributed database system. The superior only knows the direct subordinate, and the subordinate only knows the location of the root. Structural model:

DNS Domain name Resolution Service (Domain Name System) is a service used to resolve the relationship between domain names and IP addresses. Forward resolution and reverse resolution can be achieved functionally:

Forward resolution: look up the corresponding IP address based on the host name (domain name).

Reverse resolution: look up the corresponding hostname (domain name) according to the IP address.

Port number used by DNS

UDP TCP:53 gives priority to UDP, which is a fast query protocol, and TCP, a reliable transport protocol, is used when master-slave DNS synchronizes data.

Main configuration file options {Global configuration listen-on port 53 {any }; listening port listen-on-v6 port 53 {:: 1;}; directory "/ var/named"; specify the area file storage directory dump-file "/ var/named/data/cache_dump.db"; dump cache directory allow-query {any;}; specify the host recursion yes that allows queries Whether to allow recursive query pid-file "/ var/run/named" to specify the location of pid allow-transfer {none }; specify hosts that are allowed to accept zone delivery requests (defined as secondary DNS) forwarders {114.114.114.114;}; set forwarding forward only | first Forward only | forward first}; logging {specify the content of server log records and the source of log information channel default_debug {file "data/named.run"; severity dynamic;};}; zone "." IN {specified zone type hint; specified zone type hint root master master service slave slave file "named.ca"; zone file name}; LVS load balancing cluster LVS (Liunx Virtual Server)

The role of LVS is to achieve load balancing, and load balancing is simply to divert user requests to the back-end nodes to achieve efficient use of resources.

LVS is characterized by cross-platform, that is, it can be used on both windows and Linux systems.

Core components of LVS:

The kernel function module of ip_vs:linux, which works in the kernel, depends on the kernel module to realize the load balancing function.

Ipvsadm: an application layer program that can communicate with ip_vs modules in the kernel to manage and control load balancing

Keepalived can also manage ip_vs.

The working mode of LVS: DR mode, NAT mode, TUN mode,.

Address translation: referred to as NAT mode, similar to the private network structure of the firewall, the load scheduler acts as the gateway of all server nodes, that is, as the access entrance of the client, but also the access exit of the node responding to the client. The server node uses a private IP address, which is located in the same physical network as the load balancer scheduler, so its security is better than the other two ways.

IP tunnel: referred to as TUN mode, using an open network structure, the load scheduler only serves as the entrance to the client, and each node responds directly to the client through its own Internet connection instead of going through the negative scheduler. Server nodes are scattered in different locations of the Internet and have independent public network IP addresses. Usually, private IP tunnels communicate with load schedulers.

Direct routing: referred to as DR mode, uses a semi-open network structure, which is similar to that of TUN mode, but the nodes are not scattered everywhere, but are located in the same physical network as the scheduler. The load scheduler connects with each node server through the local network, so there is no need to establish a dedicated IP tunnel.

LVS scheduling algorithm, the so-called algorithm is simply according to what rules to send the back-end of multiple RS to choose one to provide services to users. There are static algorithm and dynamic algorithm.

Static algorithm: regardless of the current server load of the back-end RS, install a fixed way to assign user requests to the RS

Rr:Round Bobin, polling, alternately assigning client requests to RS

Wrr:Weighted Round Bobin, weighted polling, depending on the performance of RS, let them bear different proportions of user requests

Dh:Destination Hashing, the destination address hash scheduling, and the hash table based on the address requested by the user.

Function: to schedule requests for the same address to the same RS

Usage scenario: when the front end is a DR and the back end is multiple cache

Sh:Source Hashing, the hash scheduling of the source address, and the hash table based on the user's ip address

Function: to schedule the same client to the same RS

Type of cluster

Load balancing cluster: to improve the response ability of the application system, handle as many access requests as possible, reduce latency, and achieve high concurrency and high load all-day performance, such as "DNS polling", "application layer exchange", "reverse proxy" and so on.

High availability cluster: to improve the reliability of the application system, reduce the downtime as much as possible, ensure the continuity of service, and achieve the effect of high availability fault tolerance. For example, "failover", "dual-computer hot backup", "multi-machine hot backup" and so on are all highly available clusters.

High-performance computing cluster: to improve the CPU computing speed of application systems, expand hardware resources and analysis capabilities, and obtain high-performance computing power equivalent to large, supercomputers. For example, "cloud computing" is one of the high-performance computing clusters.

Hierarchical structure of load balance

In a typical load balancing cluster, it includes the following three levels of components.

Layer 1: the load scheduler, which is the only entrance to the entire cluster system, using the VIP (virtual IP) address common to all servers, also known as the cluster IP address. Usually, the master and backup schedulers are configured to achieve hot standby, and when the primary scheduler fails, it is smoothly replaced to the standby scheduler to ensure high availability.

The second tier: server pool: the application services provided by the cluster are undertaken by the server pool, in which each node has an independent RIP (real IP) address and only handles client requests sent by the scheduler.

The third layer: shared storage, which provides stable and consistent file access services for all nodes in the server pool, ensuring the unity of the entire cluster. In a Linux environment, shared storage can use NAS devices or dedicated servers that provide NFS (Network File system) sharing services.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report