1. 程式人生 > >Flocker 做為後端儲存代理 docker volume-driver 支援

Flocker 做為後端儲存代理 docker volume-driver 支援

docker Flocker

https://github.com/ClusterHQ/flocker/


文件:

https://docs.clusterhq.com/en/latest/docker-integration/


docker swarm 部署 Flocker

https://docs.clusterhq.com/en/latest/docker-integration/manual-install.html


CentOS 7 安裝 flocker-cli

需要 python 2.7

yum install gcc libffi-devel git

[[email protected]

~]# git clone https://github.com/ClusterHQ/flocker

[[email protected] ~]# cd flocker

[[email protected] flocker]# pip install -r requirements/all.txt

[[email protected] flocker]# python setup.py install

[[email protected] flocker]# flocker-ca --version
1.14.0+1.g40433b3

CentOS 7 安裝 flocker node 在每個節點中

[[email protected] ~]# yum list installed clusterhq-release || yum install -y https://clusterhq-archive.s3.amazonaws.com/centos/clusterhq-release$(rpm -E %dist).noarch.rpm
[[email protected] ~]# yum install -y clusterhq-flocker-node
[[email protected] ~]# yum install -y clusterhq-flocker-docker-plugin


在 管理節點 與 node 節點 建立 flocker 配置目錄

mkdir /etc/flocker

[[email protected] ~]# cd /etc/flocker

一、生成 flocker 管理伺服器 證書
[[email protected] flocker]# flocker-ca initialize cnflocker
Created cluster.key and cluster.crt. Please keep cluster.key secret, as anyone who can access it will be able to control your cluster.


二、生成 flocker 控制節點 證書

官方 建議使用 hostname, 而不使用IP, 我這裡暫時使用 IP

[[email protected] flocker]# flocker-ca create-control-certificate 172.16.1.25

拷貝 control-172.16.1.25.crt control-172.16.1.25.key cluster.crt 三個檔案到 控制節點 中

注意:cluster.key 檔案為 key 檔案,只儲存在本機,或者管理伺服器 (我這裡 管理伺服器 與 控制節點 為同一臺伺服器)

[[email protected] flocker]# scp control-172.16.1.25.crt 172.16.1.25:/etc/flocker

[[email protected] flocker]# scp control-172.16.1.25.key 172.16.1.25:/etc/flocker

[[email protected] flocker]# scp cluster.crt 172.16.1.25:/etc/flocker


重新命名 剛複製過來的 control-172.16.1.25.key control-172.16.1.25.crt

[[email protected] flocker]# mv control-172.16.1.25.crt control-service.crt
[[email protected] flocker]# mv control-172.16.1.25.key control-service.key

設定 許可權

[[email protected] flocker]# chmod 0700 /etc/flocker
[[email protected] flocker]# chmod 0600 /etc/flocker/control-service.key

三、生成 flocker node節點 證書 , 每個節點都必須生成一個不一樣的證書

[[email protected] flocker]# flocker-ca create-node-certificate
Created 6cc5713a-4976-4545-bf61-3686f182ae50.crt. Copy it over to /etc/flocker/node.crt on your node machine and make sure to chmod 0600 it.

複製 6cc5713a-4976-4545-bf61-3686f182ae50.crt 6cc5713a-4976-4545-bf61-3686f182ae50.key cluster.crt 到 flocker node 節點 /etc/flocker 目錄中

[[email protected] flocker]# scp 6cc5713a-4976-4545-bf61-3686f182ae50.crt 172.16.1.28:/etc/flocker
[[email protected] flocker]# scp 6cc5713a-4976-4545-bf61-3686f182ae50.key 172.16.1.28:/etc/flocker
[[email protected] flocker]# scp cluster.crt 172.16.1.28:/etc/flocker


登陸 node 節點 重新命名 crt 與 key 檔案 為 node.crt node.key

[[email protected] flocker]# mv 6cc5713a-4976-4545-bf61-3686f182ae50.crt node.crt
[[email protected] flocker]# mv 6cc5713a-4976-4545-bf61-3686f182ae50.key node.key

[[email protected] flocker]# chmod 0700 /etc/flocker
[[email protected] flocker]# chmod 0600 /etc/flocker/node.key


四、生成 Flocker Plugin for Docker 客戶端 API

[[email protected] flocker]# flocker-ca create-api-certificate plugin
Created plugin.crt. You can now give it to your API enduser so they can access the control service API.

複製 plugin.crt plugin.key 到 flocker node 節點 /etc/flocker 目錄中。
[[email protected] flocker]# scp plugin.crt 172.16.1.28:/etc/flocker/
[[email protected] flocker]# scp plugin.key 172.16.1.28:/etc/flocker/

五、 控制節點 執行 flocker Service

[[email protected] flocker]# systemctl enable flocker-control
[[email protected] flocker]# systemctl start flocker-control


六、 配置 node 節點 以及 後端儲存

在每個節點 新增 配置檔案

[[email protected] flocker]# vi /etc/flocker/agent.yml

---------------------------------------------------------------------------------------------------

"version": 1
"control-service":
"hostname": "172.16.1.25"
"port": 4524

# The dataset key below selects and configures a dataset backend (see below: aws/openstack/etc).
# # All nodes will be configured to use only one backend

dataset:
backend: "aws"
region: "<your region; for example, us-west-1>"
zone: "<your availability zone; for example, us-west-1a>"
access_key_id: "<AWS API key identifier>"
secret_access_key: "<Matching AWS API key>"

---------------------------------------------------------------------------------------------------

dataset 為後端儲存的設定選項。

後端儲存支援列表: https://docs.clusterhq.com/en/latest/flocker-features/storage-backends.html#supported-backends

七、 node 節點 執行 flocker-agent 與 flocker-docker-plugin

[[email protected] flocker]# systemctl enable flocker-dataset-agent
[[email protected] flocker]# systemctl start flocker-dataset-agent
[[email protected] flocker]# systemctl enable flocker-container-agent
[[email protected] flocker]# systemctl start flocker-container-agent

[[email protected] flocker]# systemctl enable flocker-docker-plugin
[[email protected] flocker]# systemctl restart flocker-docker-plugin


八、 docker volume-driver 測試

[[email protected]]# docker run -v apples:/data --volume-driver flocker busybox sh -c "echo hello > /data/file.txt"

[[email protected]]# docker run -v apples:/data --volume-driver flocker busybox sh -c "cat /data/file.txt"

相關推薦

Flocker 儲存代理 docker volume-driver 支援

docker Flocker https://github.com/ClusterHQ/flocker/ 文件: https://docs.clusterhq.com/en/latest/docker-integration/ docker swarm 部署 Flocker https://do

1.快速部署ceph叢集(cephopenstack的儲存

Ceph 簡介(官網 http://docs.ceph.org.cn/start/intro/)不管你是想為雲平臺提供Ceph 物件儲存和/或 Ceph 塊裝置,還是想部署一個 Ceph 檔案系統或者把 Ceph 作為他用,所有 Ceph 儲存叢集的部署都始於部署一個個 Ce

以rpm及以yum前端工具的程序包管理器在Linux發行版系統centos中的使用

rpm yum 程序包管理: 應用程序的安裝,實際上是解壓縮並復制程序包中的文件到指定目錄的過程; 程序包管理器: 方便終端用戶進行程序的安裝、卸載、升級、安裝信息查詢及校驗等工作; 不同的Linux的發行版本中,有不同的程序包管理器: Debian:dpt;Redhat:rpm;S.u.S.

cinder 使用NFS 存儲

cto 一個 type eat 綁定 etc syn nfs xfs 更多的OpenStack 對接課程請訪問 http://edu.51cto.com/course/14150.html?source=so**實驗環境 network 存儲節點controller

關於webservice,服務,解析basic使用者名稱和密碼的問題

作為服務端,不可能接受任何人的資料。basic認證是一種很好的方式。 具體程式碼就不細說了,比較簡單。但是不知道相關方法還是很頭疼的。下面看程式碼: 下面是有認證的headers Headers: {accept-encoding=[gzip,deflate], Aut

在Kubernetes叢集中用Helm託管安裝Ceph叢集並提供儲存_Kubernetes中文社群

在Kubernetes叢集中用Helm託管安裝Ceph叢集並提供後端儲存 本文翻譯自Ceph官方文件,括號內的內容為註釋。 安裝 ceph-helm 專案可讓你在Kubernetes 環境以託管方式部署Ceph . 本文件假定Kubernetes 環境已經可用。 當前的限制 Public網路

OpenStack Cinder 與各種儲存技術的整合敘述與實踐

              Cinder專案為管理快裝置而生,它最重要的地方就是如何做到和各種儲存後端就到完美適配,用好後端儲存的功能,本文為Cinder 多種後端儲存(LVM, FC+SAN, iSCSI+SAN, NFS, VMWARE, Glusterfs)的場景總結

vue2.x 通過介面代理,獲取qq音樂api的資料

前言: 部分qq音樂的api介面不能直接通過jsonp訪問,需要通過官方的代理才能獲取,如:歌詞,推薦歌單等 1. webpack.dev.conf.js中建立介面: // 開頭呼叫: var exp

Openstack 多配置--詳解NFS作為Cinder的儲存

材料: 1.現有一外接NFS儲存,大小為300G,路徑為:192.168.8.213:/test3/cinder 2.mitaka版本,已配置lvm後端儲存,大小為20G NFS後端儲存本地掛載(不掛載也不影響) 掛載到本地目錄 cd /root

keras以tensorflow的迴歸問題

import numpy as np np.random.seed(1337) from keras.models import Sequential from keras.layers import Dense import matplotlib.pyplot as pl

18.glance服務介紹及配置swift作為儲存

映象中的幾種狀態: active 映象已經在正確的上傳並可以使用了 saving 映象正在被上傳 queued 這個映象的ID已經被記錄了,但是映象並沒有真的上傳 killed 上傳失敗,完全不可用 glance主要的兩個服務: glance-api    

Unity 使用TCP客戶,並進入粘包處理

客戶端:using System; using System.Collections; using System.Collections.Generic; using System.Net; using System.Net.Sockets; using System.Thr

叢集+儲存

###########叢集+高可用+後端儲存######## 一.知識梳理 1.什麼是叢集? 叢集是一組相互獨立的、通過高速網路互聯的計算機,它們構成了一個組,並以單一系統的模式加以管理。一個客戶與叢集相互作用時,叢集像是一個獨立的伺服器。叢集配置是用於提高可用性和可縮放性

跟我學Spring Cloud(Finchley版)-26-使用Elasticsearch作為Zipkin Server的儲存

前文搭建的Zipkin Server是沒有後端儲存的——資料會儲存在Zipkin的記憶體中。這一般不適合生產,本節來探討如何將Zi

在閒魚,我們如何用Dart高效開發?

背景 像阿里其他技術團隊以及業界的做法一樣,閒魚的大多數後端應用都是全部使用java來實現的。java易用、豐富的庫、結構容易

為什麼我推薦Nginx作為伺服器代理

![](https://img2020.cnblogs.com/other/1739473/202007/1739473-20200722214255527-1615142949.png) ## 1. 前言 我們真實的伺服器不應該直接暴露到公網上去,否則更加容易洩露伺服器的資訊,也更加容易受到攻擊。一個比

Java前端Rsa公鑰加密,Rsa私鑰解密(支援字元和中文)

Java前端Rsa公鑰加密,後端Rsa私鑰解密(支援字元和中文)   package com.utils; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import j

nginx反向代理web伺服器之間的互動

分享一下我老師大神的人工智慧教程!零基礎,通俗易懂!http://blog.csdn.net/jiangjunshow 也歡迎大家轉載本篇文章。分享知識,造福人民,實現我們中華民族偉大復興!        

nginx對的目錄進行反向代理

plonenginx主配置文件worker_processes 1; error_log /home/data/logs/nginx/error.log; #error_log logs/error.log; #error_log logs/error.log notice; #error_log

用apache代理下載本地pdf文件

自動生成 .cn 指定 listen err 文件的 ide 技術 ror 有一些公司會用apache做為代理,下載服務器上的pdf文件。以下是apache做為代理的配置 一. 環境 centos6.5 192.168.69.3 二. yum安裝apache