<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # 使用OpenEBS做持久化存儲 本文將指導您如何在Kubernetes集群上安裝[OpenEBS](https://github.com/openebs/openebs)作為持久化存儲。 我們將使用[Operator](https://coreos.com/operators/)的方式來安裝OpenEBS,安裝之前需要先確認您的節點上已經安裝了iSCSI。 ## 先決條件 OpenEBS依賴與iSCSI做存儲管理,因此需要先確保您的集群上已有安裝openiscsi。 **注意**:如果您使用kubeadm,容器方式安裝的kublet,那么其中會自帶iSCSI,不需要再手動安裝,如果是直接使用二進制形式在裸機上安裝的kubelet,則需要自己安裝iSCSI。 iSCSI( Internet Small Computer System Interface 互聯網小型計算機系統接口)是一種基于TCP/IP 的協議,用來建立和管理IP存儲設備、主機和客戶機等之間的相互連接,并創建存儲區域網絡(SAN)。SAN 使得SCSI 協議應用于高速數據傳輸網絡成為可能,這種傳輸以數據塊級別(block-level)在多個數據存儲網絡間進行。SCSI 結構基于C/S模式,其通常應用環境是:設備互相靠近,并且這些設備由SCSI 總線連接。 OpenEBS需要使用iSCSI作為存儲協議,而CentOS上默認是沒有安裝該軟件的,因此我們需要手動安裝。 iSCSI中包括兩種類型的角色: - **target**:用來提供存儲(server) - **initiator**:使用存儲的客戶端(client) 下圖在Kubernetes中使用iSCSI的架構圖(圖片來源:`http://rootfs.github.io/iSCSI-Kubernetes/`)。 ![Kubernetes iSCSI架構](https://box.kancloud.cn/4046dcd88acae733afb6c917273e2b24_621x315.png) 安裝iSCSI服務十分簡單,不需要額外的配置,只要安裝后啟動服務即可。 在每個node節點上執行下面的命令: ```bash yum -y install iscsi-initiator-utils systemctl enable iscsid systemctl start iscsid ``` ## 快速開始 使用Operator運行OpenEBS服務: ```bash wget https://raw.githubusercontent.com/openebs/openebs/master/k8s/openebs-operator.yaml kubectl apply -f openebs-operator.yaml ``` 使用默認或自定義的storageclass: ```bash wget https://raw.githubusercontent.com/openebs/openebs/master/k8s/openebs-storageclasses.yaml kubectl apply -f openebs-storageclasses.yaml ``` 用到的鏡像有: - openebs/m-apiserver:0.5.1-RC1 - openebs/openebs-k8s-provisioner:0.5.1-RC2 - openebs/jiva:0.5.1-RC1 - openebs/m-exporter:0.5.0 ## 測試 下面使用OpenEBS官方文檔中的示例,安裝Jenkins測試 ```bash wget https://raw.githubusercontent.com/openebs/openebs/master/k8s/demo/jenkins/jenkins.yml kubectl apply -f jenkins.yml ``` 查看PV和PVC ```bash $ kubectl get pv NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE pvc-8e203e86-f1e5-11e7-aa47-f4e9d49f8ed0 5G RWO Delete Bound default/jenkins-claim openebs-standard 1h $ kubectl get pvc kubectl get pvc NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE jenkins-claim Bound pvc-8e203e86-f1e5-11e7-aa47-f4e9d49f8ed0 5G RWO openebs-standard 1h ``` 查看Jenkins pod ```bash Events: Type Reason Age From Message ---- ------ ---- ---- ------- Warning FailedScheduling 29m (x2 over 29m) default-scheduler PersistentVolumeClaim is not bound: "jenkins-claim" (repeated 3 times) Normal Scheduled 29m default-scheduler Successfully assigned jenkins-668dfbd847-vhg4c to 172.20.0.115 Normal SuccessfulMountVolume 29m kubelet, 172.20.0.115 MountVolume.SetUp succeeded for volume "default-token-3l9f0" Warning FailedMount 27m kubelet, 172.20.0.115 Unable to mount volumes for pod "jenkins-668dfbd847-vhg4c_default(8e2ad467-f1e5-11e7-aa47-f4e9d49f8ed0)": timeout expired waiting for volumes to attach/mount for pod "default"/"jenkins-668dfbd847-vhg4c". list of unattached/unmounted volumes=[jenkins-home] Warning FailedSync 27m kubelet, 172.20.0.115 Error syncing pod Normal SuccessfulMountVolume 26m kubelet, 172.20.0.115 MountVolume.SetUp succeeded for volume "pvc-8e203e86-f1e5-11e7-aa47-f4e9d49f8ed0" Normal Pulling 26m kubelet, 172.20.0.115 pulling image "harbor-001.jimmysong.io/library/jenkins:lts" Normal Pulled 26m kubelet, 172.20.0.115 Successfully pulled image "harbor-001.jimmysong.io/library/jenkins:lts" Normal Created 26m kubelet, 172.20.0.115 Created container Normal Started 26m kubelet, 172.20.0.115 Started container ``` 啟動成功。Jenkins配置使用的是**NodePort**方式訪問,現在訪問集群中任何一個節點的Jenkins service的NodePort即可。 ## 存儲策略 OpenEBS的存儲策略使用StorageClaass實現,包括如下的StorageClass: - openebs-cassandra - openebs-es-data-sc - openebs-jupyter - openebs-kafka - openebs-mongodb - openebs-percona - openebs-redis - openebs-standalone - openebs-standard - openebs-zk ## 參考 - [CentOS 7.x 下配置iSCSI網絡存儲](http://blog.csdn.net/wh211212/article/details/52981305) - [Configure iSCSI Initiator](https://www.server-world.info/en/note?os=CentOS_7&p=iscsi&f=2) - [RHEL7: Configure a system as either an iSCSI target or initiator that persistently mounts an iSCSI target.](https://www.certdepot.net/rhel7-configure-iscsi-target-initiator-persistently/)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看