1. 程式人生 > >OpenStack+Ceph+熱遷移+++四、建立儲存池

OpenStack+Ceph+熱遷移+++四、建立儲存池

四、建立儲存池

1.建立Cinder,Glance,Nova的儲存池(node1節點)

ceph osd pool create volumes 128

ceph osd pool create images 128

ceph osd pool create vms 128

[[email protected] ~]# ceph osd pool create volumes 128
pool 'volumes' created
[[email protected] ~]# ceph osd pool create images 128
pool 'images' created
[
[email protected]
~]# ceph osd pool create vms 128 pool 'vms' created [[email protected] ~]#

2.將ceph.conf的檔案傳給controller,compute1,compute2,cinder節點

也就是執行著glance-api 、 cinder-volume 、 nova-compute 和 cinder的節點

ssh controller tee /etc/ceph/ceph.conf </etc/ceph/ceph.conf

ssh cinder tee /etc/ceph/ceph.conf </etc/ceph/ceph.conf

ssh compute1 tee /etc/ceph/ceph.conf </etc/ceph/ceph.conf

ssh compute2 tee /etc/ceph/ceph.conf </etc/ceph/ceph.conf

[[email protected] ~]# ssh controller tee /etc/ceph/ceph.conf </etc/ceph/ceph.conf
[email protected]'s password: 
[global]
fsid = 46ac86e8-1efe-403c-b735-587f9d76a905
mon_initial_members = node1
mon_host = 10.0.0.41
auth_cluster_required = cephx
auth_service_required = cephx
auth_client_required = cephx

[
[email protected]
~]# ssh cinder tee /etc/ceph/ceph.conf </etc/ceph/ceph.conf [email protected]'s password: [global] fsid = 46ac86e8-1efe-403c-b735-587f9d76a905 mon_initial_members = node1 mon_host = 10.0.0.41 auth_cluster_required = cephx auth_service_required = cephx auth_client_required = cephx [[email protected] ~]# ssh compute1 tee /etc/ceph/ceph.conf </etc/ceph/ceph.conf [email protected]'s password: [global] fsid = 46ac86e8-1efe-403c-b735-587f9d76a905 mon_initial_members = node1 mon_host = 10.0.0.41 auth_cluster_required = cephx auth_service_required = cephx auth_client_required = cephx [[email protected] ~]# ssh compute2 tee /etc/ceph/ceph.conf </etc/ceph/ceph.conf [email protected]'s password: [global] fsid = 46ac86e8-1efe-403c-b735-587f9d76a905 mon_initial_members = node1 mon_host = 10.0.0.41 auth_cluster_required = cephx auth_service_required = cephx auth_client_required = cephx

3.安裝ceph客戶端

controller(glance-api)節點上安裝librbd的Python 繫結

yum install python-rbd

yum install python-rbd

compute1(nova-compute)、compute2(nova-compute)、cinder(cinder-volume)節點上安裝 Python 繫結和客戶端命令列工具

yum install ceph

yum install ceph

4.配置ceph客戶端認證

啟用cephx認證,為Nova/Cinder和Glance建立新使用者

ceph auth get-or-create client.cinder mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=volumes, allow rwx pool=vms, allow rx pool=images'

ceph auth get-or-create client.glance mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=images'

[[email protected] ~]# ceph auth get-or-create client.cinder mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=volumes, allow rwx pool=vms, allow rx pool=images'
[client.cinder]
	key = AQCVXx1aUZErNRAAeVUTAhLU4r4xaiqDbHqVhw==
[[email protected] ~]# ceph auth get-or-create client.glance mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=images'
[client.glance]
	key = AQCzXx1a7g5BKxAAHECANQ7E6rxTR9S2xzN5bQ==


5.把 client.cinder(cinder) 、 client.glance(controller) 的金鑰環複製到適當的節點,並更改所有權:

client.glance(controller

ceph auth get-or-create client.glance | ssh controller tee /etc/ceph/ceph.client.glance.keyring

ssh controller chown glance:glance /etc/ceph/ceph.client.glance.keyring

[[email protected] ~]# ceph auth get-or-create client.glance | ssh controller tee /etc/ceph/ceph.client.glance.keyring
[email protected]'s password: 
[client.glance]
	key = AQCzXx1a7g5BKxAAHECANQ7E6rxTR9S2xzN5bQ==
[[email protected] ~]# ssh controller chown glance:glance /etc/ceph/ceph.client.glance.keyring
[email protected]'s password: 

clientcinder(cinder)

ceph auth get-or-create client.cinder | ssh cinder tee /etc/ceph/ceph.client.cinder.keyring

ssh cinder chown cinder:cinder /etc/ceph/ceph.client.cinder.keyring

[[email protected] ~]# ceph auth get-or-create client.cinder | ssh cinder tee /etc/ceph/ceph.client.cinder.keyring
[email protected]'s password: 
[client.cinder]
	key = AQCVXx1aUZErNRAAeVUTAhLU4r4xaiqDbHqVhw==
[[email protected] ~]# ssh cinder chown cinder:cinder /etc/ceph/ceph.client.cinder.keyring
[email protected]'s password: 

6.配置compute1與compute2的密匙環檔案

執行nova-compute的節點,其程序需要金鑰環檔案:

compute1

ceph auth get-or-create client.cinder | ssh compute1 tee /etc/ceph/ceph.client.cinder.keyring

ceph auth get-key client.cinder | ssh compute1 tee client.cinder.key

[[email protected] ceph]# ceph auth get-or-create client.cinder | ssh compute1 tee /etc/ceph/ceph.client.cinder.keyring
[email protected]'s password: 
[client.cinder]
	key = AQCVXx1aUZErNRAAeVUTAhLU4r4xaiqDbHqVhw==
[[email protected] ceph]# ceph auth get-key client.cinder | ssh compute1 tee client.cinder.key
[email protected]'s password: 
AQCVXx1aUZErNRAAeVUTAhLU4r4xaiqDbHqVhw==

compute2

ceph auth get-or-create client.cinder | ssh compute2 tee /etc/ceph/ceph.client.cinder.keyring

ceph auth get-key client.cinder | ssh compute2 tee client.cinder.key

[[email protected] ceph]# ceph auth get-or-create client.cinder | ssh compute2 tee /etc/ceph/ceph.client.cinder.keyring
[email protected]'s password: 
[client.cinder]
	key = AQCVXx1aUZErNRAAeVUTAhLU4r4xaiqDbHqVhw==
[[email protected] ceph]# ceph auth get-key client.cinder | ssh compute2 tee client.cinder.key
[email protected]'s password: 
AQCVXx1aUZErNRAAeVUTAhLU4r4xaiqDbHqVhw==

任選計算節點1或者2生成一個uuid
[[email protected] ~]# uuidgen
9d9cbdda-532a-4441-b11d-eb540dec9df9

所有計算節點執行執行下面命令

下面那一長串直接複製進去就能執行改為自己的uuid

cat > secret.xml <<EOF
<secret ephemeral='no' private='no'>
  <uuid>9d9cbdda-532a-4441-b11d-eb540dec9df9</uuid>
  <usage type='ceph'>
        <name>client.cinder secret</name>
  </usage>
</secret>
EOF

在計算節點上把金鑰加進libvirt、然後刪除臨時副本

virsh secret-define --file secret.xml

[[email protected] ~]# virsh secret-define --file secret.xml
Secret 9d9cbdda-532a-4441-b11d-eb540dec9df9 created

virsh secret-set-value --secret 9d9cbdda-532a-4441-b11d-eb540dec9df9 --base64 $(cat client.cinder.key) && rm client.cinder.key secret.xml
Secret value set
[[email protected] ~]# virsh secret-set-value --secret 9d9cbdda-532a-4441-b11d-eb540dec9df9 --base64 $(cat client.cinder.key) && rm client.cinder.key secret.xml
Secret value set

rm: remove regular file ‘client.cinder.key’? y
rm: remove regular file ‘secret.xml’? y

相關推薦

OpenStack+Ceph+遷移+++建立儲存

四、建立儲存池 1.建立Cinder,Glance,Nova的儲存池(node1節點) ceph osd pool create volumes 128 ceph osd pool create i

部署OpenStack+Ceph+遷移架構圖

OpenStack+Ceph+熱遷移架構與規劃 Openstack資訊 Openstack平臺資訊 Hostname eth0(外部) eht1(管理) OS controller

建立模式----單例模式

一、單例模式 單例模式分為:懶漢模式和餓漢模式。 單例物件(Singleton)是一種常用的設計模式。在Java應用中,單例物件能保證在一個JVM中,該物件只有一個例項存在。這樣的模式有幾個好處: 1、某些類建立比較頻繁,對於一些大型的物件,這是一筆很大的系統開銷。 2、省去了new

建立第一個Django頁面應用

沿用之前建立好的目錄結構,首先在views.py中編寫頁面: 1、匯入django中的HttpResponse模組 2、建立一個類,隨便命一個名,類名後傳入一個必要的引數,一般預設為request,為簡單起見

MySQL儲存過程和自定義函式Navicat for mysql建立儲存過程和函式呼叫儲存過程和函式的區別

與你相遇 好幸運  可我已失去為你淚流滿面的權利  但願在我看不到的天際  你張開了雙翼 1 MySQL儲存過程和函式 過程和函式,它們被編譯後儲存在資料庫中,稱為永續性儲存模組(Persistent Stored Module,PSM),可以反覆呼叫,執行速度快。 1.1 儲存過程 儲存過程是由

叢集基礎之04(部署ceph實驗環境部署ceph叢集建立Ceph儲存儲存應用掛載Ceph檔案系統建立物件儲存伺服器)

目錄 前言: 前言: Ceph簡介 Ceph是一個統一的分散式儲存系統,設計初衷是提供較好的效能、可靠性和可擴充套件性。 Ceph專案最早起源於Sage就讀博士期間的工作(最早的成果於2004年

openstack遷移雲主機總匯其一(雲主機遷移

openstack 雲主機熱遷移openstack遷移總匯目錄1 熱遷移之block-migration 1.1 查看物理主機CPU 1.2 修改hosts文件 1.3 開啟熱遷移 1.4 修改防火墻 1.5 virsh測試是否可以連通對端機器 1.5.

記一次 openstack 雲主機遷移失敗與恢復過程

openstack 遷移失敗 背景:最近把openstack上的所有機器的磁盤逐一重新分區,之前是兩塊磁盤用RAID1,但是ceph已經配置了3份副本,這樣相當於存6份副本了,目前磁盤資源不太夠。機器用的是HP P440ar的陣列卡,支持建立不同模式的邏輯卷,所以把磁盤分區修改為RAID1系統盤+RA

OpenStack Pike Minimal安裝:計算服務

systemctl list rbo console meta catalog l數據庫 sys manage Ⅰ、在controller節點上配置nova 1.創建nova服務憑據 #先使用腳本登陸admin [root@controller ~]# . admin-op

Linux叢集儲存——day4——Ceph分散式儲存搭建OSD塊儲存COW快照RBD儲存映象

Ceph的專有名詞 OSDs 儲存裝置 Monitors 叢集監控元件 MDSs 存放檔案系統的元資料 部署Ceph分散式儲存  

踩坑經歷(建立索引儲存過程

需求:存在刪除索引並且建立索引 儲存過程 DROP PROCEDURE IF EXISTS add_Index; delimiter // CREATE PROCEDURE add_Index ( IN p_dbname VARCHAR (200), I

【python+opencv入門學習】視訊的讀取顯示儲存

本篇文章,將學習如何讀取視訊,顯示視訊和儲存視訊。分別學習從相機和視訊檔案中讀取視訊。主要學習類VideoCapture和類VideoWrter的使用。 環境:Windows 7(64)   python 3.6    opencv 3.4.2 一、視訊的讀取與顯示 1

HIVE的安裝配置mysql的安裝hive建立建立分割槽修改表等內容hive beeline使用HIVE的種資料匯入方式使用Java程式碼執行hive的sql命令

1.上傳tar包 這裡我上傳的是apache-hive-1.2.1-bin.tar.gz 2.解壓 mkdir -p /home/tuzq/software/hive/ tar -zxvf apache-hive-1.2.1-bin.tar.gz  -C /home/

使用PL/SQL developer ORACLE 建立儲存過程DBMS_JOB定時任務

由於需要對資料庫的一個表進行定時更新,之前想在後臺寫定時任務,後來發現數據庫的dems_job比較方便,之前並沒有接觸過PL/SQL和Oracle的定時任務Job,為了實現這一需求,於是在網上找了各種資料。 建立定時任務job之前首先需要有我們要操作的資料庫表,然後我們應該

第3章 決策樹(ID3演算法建立繪製決策樹分類器儲存預測隱性眼鏡型別)

ID3演算法 ID3演算法的核心是在決策樹各個結點上對應資訊增益準則選擇特徵,遞迴地構建決策樹。具體方法是:從根結點(root node)開始,對結點計算所有可能的特徵的資訊增益,選擇資訊增益最大的特徵作為結點的特徵,由該特徵的不同取值建立子節點;再對子結點遞迴地呼叫以上方法,構建決策樹

初試 Ceph 儲存之塊裝置檔案系統物件儲存

目錄 Ceph 儲存介紹 環境、軟體準備 Ceph 塊裝置 Ceph 檔案系統 Ceph 物件儲存 1、Ceph 儲存介紹 Ceph 是一個開源的分散式儲存系統,包括物件儲存、塊裝置、檔案系統。它可靠性高、管理方便、伸縮性強,能夠輕鬆應對PB

利用navicat建立儲存過程觸發器和使用遊標的簡單例項

建立儲存過程和觸發器 1、建表 首先先建兩張表(users表和number表),具體設計如下圖: 2、儲存過程 寫一個儲存過程,往users表中插入資料,建立過程如下:     程式碼如下: BEGIN #Routine body goes here... d

JQuery學習筆記()——建立插入和刪除節點

一個小練習: 需求1: 點選 submit 按鈕時, 檢查是否選擇 type, 若沒有選擇給出提示: "請選擇型別";  檢查文字框中是否有輸入(可以去除前後空格), 若沒有輸入,則給出提示: "請輸入內容"; 若檢查都通過, 則在相應的 ul 節點中新增對應的 li 節點

優化資料庫,將不同功能的表分別建立在不同的庫中,儘量避免表的聯合查詢,重視索引

        對於大型網站最終資料庫將會是瓶頸,因為對於網站程式來說可以架構負載平衡,讓多個伺服器來分擔執行程式,但要讓多個伺服器同時操作一個數據庫是比較困難的,也因此最終會選擇把一個庫分成多個庫的方式來讓多臺伺服器分擔資料庫的壓力,所以我建議在最初就根據功能將表分開放在不

關於Webstorm webpack不能自動更新問題

專案是vue+webpack構建的,以前的時候熱更新還挺正常的,一改動程式碼瀏覽器也就立馬重新整理了,現在基本都不重新整理了,每次都手動npm run dev 重啟服務才能看到更新的,很煩,查詢了很多