In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
To do PV based on NFS service:
Install NFS service and rpcbind service: 1. [root@master yaml] # yum install-y nfs-utils rpcbind # note that NFS service should be installed in all three. 2. [root@master yaml] # vim / etc/exports file add / nfsdata * (rw,sync,no_root_squash) 4. [root@master yaml] # mkdir / nfsdata 5. [root@master yaml] # systemctl start rpcbind 6. [root@master yaml] # systemctl start nfs-server.service 7. [root@master yaml] # showmount-e Export list for master: / nfsdata *
Create a PV resource object:
Vim nfs-pv.yamlapiVersion: v1kind: PersistentVolumemetadata: name: testspec: capacity given by capacity:# storage: access mode supported by 1Gi accessModes:#PV-ReadWriteOnce# here means that persistentVolumeReclaimPolicy: Recycle#pv can only be mounted to a single node in a read-write manner: the recycling policy of storageClassName: nfs# indicates that the name of the storage class defined by storageClassName: nfs# should be the same as the storage class name defined above Path: / nfsdata/pv1# specify the directory of NFS server: 192.168.1." specify the IP execution nfs-pv.yaml file of the NFS server: * * `kubectl apply-f nfs-pv.yaml `* * persistentvolume/test created * * `kubectl get pv` * * NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE test 1Gi RWO Recycle * * Available * * Nfs 7s * * Note here that the STATUS status is Available before it can be used. **
Access modes supported by pv:
ReadWriteOnce: the access mode is that you can only mount to a single node in read-write mode.
ReadWriteMany: the access mode is that you can only mount to multiple nodes in a read-write manner.
ReadOnlyMany: the access mode is that you can only mount to multiple nodes as read-only.
Recycling strategy for PV storage space:
Recycle: automatically clears data.
Retain: requires manual recycling by the administrator.
Delete: dedicated to cloud storage.
The correlation between PV and PVC: through storageClassName and accessModes
Create PVC: vim nfs-pvc.yamlapiVersion: v1kind: PersistentVolumeClaimmetadata: name: testspec: accessModes:-ReadWriteOnce# to define the access mode, which must be consistent with the Pv definition. Resources: requests: storage: 1Gi# request capacity size storageClassName: nfs# storage class name must be consistent with the pv definition.
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.