In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
One: Statefulset
StatefulSet is designed to solve the problem of stateful service, and the corresponding Deployment and ReplicaSet are designed for stateless service. The application scenarios include:
1. Stable persistent storage, that is, Pod can still access the same persistent data after rescheduling, which is based on PVC.
two。 Stable network sign, that is, its PodName and HostName remain unchanged after Pod rescheduling, which is based on Headless Service (that is, Service without Cluster IP).
3. Orderly deployment, orderly expansion, that is, Pod is sequentially deployed or expanded according to the defined order (that is, from 0 to Nmuri 1, all previous Pod must be Running and Ready states before the next Pod runs), which is implemented based on init containers.
4. Orderly contraction, orderly deletion (I. e., from Nmuri 1 to 0)
Because statefulset requires that the names of Pod are ordered, each Pod cannot be replaced at will, that is, even after the Pod is rebuilt, the name remains the same. Name each Pod at the back end.
From the above application scenario, it can be found that StatefulSet consists of the following parts: 1. Headless Service (headless-svc: headless service) used to define the network logo. Because there is no IP address, it does not have the function of load balancing. ) 2. The volumeClaimTemplates3 used to create the PersistentVolumes. Define the application-specific StatefulSet
StatefulSet:Pod controller.
RC 、 RS 、 Deployment 、 DS . Stateless service.
Template (template): the status of the Pod created from the template is exactly the same (except for name, IP, domain name)
It can be understood as: any Pod can be deleted and replaced with the newly generated Pod.
Stateful service: the relevant time in the previous or multiple communications needs to be recorded as the classification standard for the next communication. For example: database services such as MySQL. The name of Pod cannot be changed at will. The directory for data persistence is also different, and each Pod has its own unique directory for data persistence. )
Each Pod- corresponds to a PVC- and each PVC corresponds to a PV.
Testing: requirement
Create a namespace with your own name in which all the following resources run.
Running a httpd web service with statefuset resources requires three Pod, but the main interface content of each Pod is different, and all need to do proprietary data persistence. Try to delete one of the Pod and check whether the newly generated Pod is the same as before.
1. Based on the NFS service, create a NFS service.
1. [root@master ~] # yum-y install nfs-utils rpcbind 2. [root@master ~] # mkdir / nfsdata
Br/ > 4./nfsdata * (rw,sync,no_root_squash)
5. [root@master ~] # systemctl start nfs-server.service 1. [root@master yaml] # kubectl apply-f nfs-deployment.yaml 1. [root@master yaml] # kubectl apply-f sc.yaml 1. [root@master yaml] # kubectl apply-fs tatefulset.yaml
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.