版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、Ceph安裝部署文檔目錄一:簡(jiǎn)介1二:部署環(huán)境介紹1三:集群配置準(zhǔn)備工作23.1 :生成SSH證書(shū),節(jié)點(diǎn)建立連接23.2 :建立ip地址list, 修改host文件33.3 :網(wǎng)絡(luò)端口設(shè)置33.4 :安裝centos的yum源軟件包 =全部節(jié)點(diǎn)安裝43.5 :添加時(shí)間同步定時(shí)任務(wù)43.6 :安裝 yum-plugin-priorities.8四:安裝ceph軟件包84.1、安裝ceph部署機(jī) ,使用ceph-deploy方式安裝部署84.2、安裝ceph存儲(chǔ)集群(包括ceph對(duì)象網(wǎng)關(guān))8五:搭建ceph集群85.1 :新建ceph集群95.2 :添加mon節(jié)點(diǎn)95.3 :添加osd節(jié)點(diǎn)9六:安
2、裝過(guò)程出現(xiàn)的部分錯(cuò)誤及解決方法11七:常用命令11一:簡(jiǎn)介Ceph 生態(tài)系統(tǒng)架構(gòu)可以劃分為四部分:1. Clients:客戶端:數(shù)據(jù)用戶2. mds:Metadata server cluster,元數(shù)據(jù)服務(wù)器:緩存和同步分布式元數(shù)據(jù)(此文檔沒(méi)有安裝mds)3. osd:Object storage cluster,對(duì)象存儲(chǔ)集群:將數(shù)據(jù)和元數(shù)據(jù)作為對(duì)象存儲(chǔ),執(zhí)行其它關(guān)鍵職能4. mon:Cluster monitors,集群監(jiān)視器:執(zhí)行監(jiān)視功能二:部署環(huán)境介紹主機(jī)名公網(wǎng)IP(eth0)私網(wǎng)IP(eth1)雙網(wǎng)卡綁定 bond0運(yùn)行服務(wù)操作系統(tǒng)內(nèi)核備注anode15mon
3、、osdCentOS6.7主節(jié)點(diǎn)anode26mon、osdCentOS6.7anode37mon、osdCentOS6.7三:集群配置準(zhǔn)備工作 3.1 :生成SSH證書(shū),節(jié)點(diǎn)建立連接1) 所有節(jié)點(diǎn)修改hostname vim /etc/sysconfig/network2) 安裝SSH (主節(jié)點(diǎn))sudo apt-get install openssh-server3) ssh登陸證書(shū) (主節(jié)點(diǎn))ssh-keygen將配置完成的證書(shū)傳輸?shù)狡渌?wù)器:ssh-copy-id 其他節(jié)點(diǎn)用戶名其他節(jié)點(diǎn)IPExample:ssh-copy-id roo
4、tanode24) 創(chuàng)建并編輯/.ssh/config 文件,添加其他HostHost Hostname Hostname User UsernameExample:Host anode1 Hostname 5 User rootHost anode2 Hostname 6 User rootHost anode3 Hostname 7 User root3.2 :建立ip地址list, 修改host文件1) 創(chuàng)建工作文件夾,建立ip地址list,為文件
5、傳輸做準(zhǔn)備主節(jié)點(diǎn)執(zhí)行mkdir /workspace/cd /workspace/vim cephlist.txt 主機(jī)列表寫(xiě)入:anode1anode2anode32) 修改host文件vim /etc/hosts追加內(nèi)容如下:5 anode16 anode27 anode3將host文件傳輸?shù)狡渌鳈C(jī)for ip in $(cat /workspace/cephlist.txt);do echo -$ip-;rsync -avp /etc/hosts $ip:/etc/;done3.3 :網(wǎng)絡(luò)端口設(shè)置檢查網(wǎng)絡(luò)設(shè)置,確定
6、這些設(shè)置是永久生效的,重啟之后不會(huì)改變。(1) Network設(shè)置,所有節(jié)點(diǎn)執(zhí)行vim /etc/sysconfig/network-scripts/ifcfg-iface確認(rèn)ONBOOT 為YES BOOTPROTO 對(duì)于靜態(tài)IP地址來(lái)說(shuō)通常為NONE如果要使用IPV6協(xié)議的話,需要設(shè)置IPV6opt 為YES(2) 防火墻設(shè)置(Iptables),所有節(jié)點(diǎn)執(zhí)行a) 端口6789:Monitor 需要通過(guò)此端口與OSD通信,因此所有Monitor節(jié)點(diǎn)需打開(kāi)b) 端口6800:7300:用于OSD通信。每個(gè)Ceph Node上的每個(gè)OSD需要三個(gè)端口,一個(gè)用于與client和 Monitor通
7、信;一個(gè)用于與其他OSD傳送數(shù)據(jù),一個(gè)用于心跳檢測(cè)。如果一個(gè)Ceph Node上有4個(gè)OSD,打開(kāi)12(=34)個(gè)端口。sudo iptables -I INPUT 1 -i eth0 -p tcp -s 5/ -dport 6789 -j ACCEPT sudo iptables -I INPUT 1 -i eth0 -p tcp -s 5/ -dport 6800:6809 -j ACCEPT配置完成iptable以后,確保每個(gè)節(jié)點(diǎn)上的改變永久生效,重啟以后也能保持有效。/sbin/serv
8、ice iptables save(3) tty 設(shè)置, 所有節(jié)點(diǎn)執(zhí)行sudo visudo找到Defaults requiretty,大約在50多行,把它改成Defaults:User !requiretty 或者直接把原句注釋掉。確保Ceph-Deploy不會(huì)報(bào)錯(cuò)。(4) SELINUX, 所有節(jié)點(diǎn)執(zhí)行sudo setenforce 0確保集群在配置完成之前不會(huì)出錯(cuò)??梢栽?etc/selinux/config修改永久改變。3.4 :安裝centos的yum源軟件包 =全部節(jié)點(diǎn)安裝(1)復(fù)制此文檔所在文件夾中的.repo文件到目錄/etc/yum.repos.d/中(2)傳輸yum源文件到
9、其它節(jié)點(diǎn)服務(wù)器-delete 刪除那些DST中SRC沒(méi)有的文件for ip in $(cat /workspace/cephlist.txt);do echo -$ip-;rsync -avp -delete /etc/yum.repos.d $ip:/etc/;done(3)yum立即生效(所有節(jié)點(diǎn)執(zhí)行)yum make cache3.5 :添加時(shí)間同步定時(shí)任務(wù)(1)安裝NTP軟件包,所有節(jié)點(diǎn)執(zhí)行yum install ntp完成后,都需要配置NTP服務(wù)為自啟動(dòng)chkconfig ntpd onchkconfig -list ntpdntpd 0:關(guān)閉 1:關(guān)閉 2:啟用 3:啟用 4:啟用
10、 5:啟用 6:關(guān)閉在配置前,先使用ntpdate手動(dòng)同步下時(shí)間,免得本機(jī)與外部時(shí)間服務(wù)器時(shí)間差距太大,讓ntpd不能正常同步。# ntpdate -u 2.(2)配置內(nèi)網(wǎng)時(shí)間服務(wù)器NTP-Server(5)NTPD服務(wù)配置核心就在/etc/ntp.conf文件,紅色部分修改,其他的是默認(rèn)。# For more information about this file, see the man pages# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp
11、_mon(5).driftfile /var/lib/ntp/drift# Permit time synchronization with our time source, but do not# permit the source to query or modify the service on this system.restrict default kod nomodify notrap nopeer noqueryrestrict -6 default kod nomodify notrap nopeer noquery# Permit all access over the lo
12、opback interface. This could# be tightened as well, but to do so would effect some of# the administrative functions.restrict restrict -6 :1# Hosts on local network are less restricted.# 允許內(nèi)網(wǎng)其他機(jī)器同步時(shí)間restrict mask nomodify notrap# Use public servers from the pool.nt
13、 project.# Please consider joining the pool (/join.html).# 中國(guó)這邊最活躍的時(shí)間服務(wù)器 :/zone/cnserver 2. perfer # 中國(guó)國(guó)家受時(shí)中心server 1. #1.server 3. #0.#broadcast 55 autokey #
14、broadcast server#broadcastclient # broadcast client#broadcast autokey # multicast server#multicastclient # multicast client#manycastserver 54 # manycast server#manycastclient 54 autokey # manycast client# allow update time by the upper server# 允許上層時(shí)間服務(wù)器主
15、動(dòng)修改本機(jī)時(shí)間restrict 2. nomodify notrap noqueryrestrict 1. nomodify notrap noqueryrestrict 3. nomodify notrap noquery# Undisciplined Local Clock. This is a fake driver intended for backup# and when no outside source of synchronized time is available.# 外部時(shí)間
16、服務(wù)器不可用時(shí),以本地時(shí)間作為時(shí)間服務(wù)server # local clockfudge stratum 10# Enable public key cryptography.#cryptoincludefile /etc/ntp/crypto/pw# Key file containing the keys and key identifiers used when operating# with symmetric key cryptography.keys /etc/ntp/keys# Specify the key identifiers
17、 which are trusted.#trustedkey 4 8 42# Specify the key identifier to use with the ntpdc utility.#requestkey 8# Specify the key identifier to use with the ntpq utility.#controlkey 8# Enable writing of statistics records.#statistics clockstats cryptostats loopstats peerstats使修改立即生效chkconfig ntpd onchk
18、config ntpdate on(3)與本地時(shí)間服務(wù)器同步的其他節(jié)點(diǎn)設(shè)置yum install ntp.chkconfig ntpd onvim /etc/ntp.conf(直接替換原來(lái)文件)driftfile /var/lib/ntp/driftrestrict restrict -6 :1# 配置時(shí)間服務(wù)器為本地的時(shí)間服務(wù)器server 5restrict 5 nomodify notrap noqueryserver # local clockfudge stratum 1
19、0includefile /etc/ntp/crypto/pwkeys /etc/ntp/keys使用ntpdate手動(dòng)同步本地服務(wù)器時(shí)間ntpdate -u 3522 Dec 17:09:57 ntpdate6439: adjust time server 5 offset 0. sec這里有可能出現(xiàn)同步失敗,一般情況下原因都是本地的NTPD服務(wù)器還沒(méi)有正常啟動(dòng)起來(lái),一般需要幾分鐘時(shí)間后才能開(kāi)始同步。service ntpd start.啟動(dòng)后,查看同步情況ntpq -pntpstat3.6 :安裝 yum-plugin-priorities.y
20、um install yum-plugin-priorities -yyum update -y確認(rèn)配置文件內(nèi)容cat /etc/yum/pluginconf.d/priorities.confmainenabled = 1四:安裝ceph軟件包4.1、安裝ceph部署機(jī) ,使用ceph-deploy方式安裝部署sudo yum update -y & sudo yum install ceph-deploy -y4.2、安裝ceph存儲(chǔ)集群(包括ceph對(duì)象網(wǎng)關(guān))(1)直接用ceph-deploy安裝cephceph-deploy install hostname hostname .exa
21、mple:ceph-deploy install anode1 anode2 anode3(2)如果由于網(wǎng)速等原因報(bào)錯(cuò),可以不執(zhí)行(1),選擇手動(dòng)安裝報(bào)錯(cuò)軟件或依賴 =allyum -y install epel-release -nogpgcheckyum -y install ceph -nogpgcheckyum -y install ceph-radosgw五:搭建ceph集群 /docs/master/rados/deployment/5.1 :新建ceph集群(1)新建文件夾,用于放置集群配置文件mkdir my-clustercd my-cl
22、uster(2)新建集群,寫(xiě)上的節(jié)點(diǎn)會(huì)默認(rèn)作為monitor,也可不寫(xiě)所有monitor,后續(xù)添加ceph-deploy new host host, .example:ceph-deploy new anode1 anode2 anode3(3)修改ceph默認(rèn)副本數(shù)量(根據(jù)自己集群節(jié)點(diǎn)數(shù)而定)Vim ceph.conf在 global 下添加:osd pool default size = 2(4) 如果有一個(gè)以上的網(wǎng)絡(luò)接口,添加公共網(wǎng)絡(luò)設(shè)置到global 下public network = ip-address/netmask(1) 添加默認(rèn)(初始)monitor并收集keysceph-
23、deploy mon create-initial完成這個(gè)過(guò)程后,在集群所在文件夾下應(yīng)該能看到如下文件:cluster-name.client.admin.keyringcluster-name.bootstrap-osd.keyringcluster-name.bootstrap-mds.keyringcluster-name.bootstrap-rgw.keyring5.2 :添加mon節(jié)點(diǎn)在初始化以后想要添加其他monitor節(jié)點(diǎn):ceph-deploy mon create host-name host-name.example:ceph-deploy mon create anode
24、45.3 :添加osd節(jié)點(diǎn)(1) 首先為OSD建立文件路徑添加anode1 服務(wù)器上的文件夾為osd1添加anode2 服務(wù)器上的文件夾為osd2添加anode3 服務(wù)器上的文件夾為osd3遠(yuǎn)程:ssh node2sudo mkdir /var/local/osd2exitssh node3sudo mkdir /var/local/osd3exit本地:mkdir /var/local/osd1(2) 準(zhǔn)備osd節(jié)點(diǎn)ceph-deploy osd prepare ceph-node:/path/to/directoryexample:ceph-deploy osd prepare anode1:/var/local/osd1 anode2:/var/local/osd2 anode3:/var/local/osd3(3) 激活osd節(jié)點(diǎn)ceph-deploy osd activate ceph-node:/path/to/directoryexample:ceph-deploy osd activate anode1:/var/local/osd1 anode2:/var/
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2026年中國(guó)石化銷售股份有限公司山東濱州鄒平石油分公司招聘?jìng)淇碱}庫(kù)附答案詳解
- 2026年合肥市人力資源服務(wù)有限公司派駐至合肥源創(chuàng)新人才發(fā)展有限公司外包人員招聘?jìng)淇碱}庫(kù)及1套參考答案詳解
- 2026年廣州醫(yī)科大學(xué)附屬口腔醫(yī)院招聘?jìng)淇碱}庫(kù)(一)及答案詳解1套
- 2026年山西省鐵路工程學(xué)校招聘?jìng)淇碱}庫(kù)及參考答案詳解1套
- 2026年企業(yè)年金、績(jī)效獎(jiǎng)金重慶中電自能科技有限公司招聘高級(jí)產(chǎn)品經(jīng)理、研發(fā)工程師等社校招崗位備考題庫(kù)參考答案詳解
- 2026年中國(guó)輕工業(yè)長(zhǎng)沙工程有限公司招聘?jìng)淇碱}庫(kù)及完整答案詳解1套
- 2026年上海中醫(yī)藥大學(xué)附屬曙光醫(yī)院安徽醫(yī)院勞務(wù)派遣窗口收費(fèi)崗招聘?jìng)淇碱}庫(kù)(第二批)及答案詳解一套
- 2025年德惠市大學(xué)生鄉(xiāng)村醫(yī)生專項(xiàng)計(jì)劃公開(kāi)招聘工作人員備考題庫(kù)(1號(hào))及一套答案詳解
- 2026年中核粒子醫(yī)療科技有限公司招聘?jìng)淇碱}庫(kù)含答案詳解
- 2026年宜賓國(guó)企招聘維操員大??蛇M(jìn)六險(xiǎn)二金備考題庫(kù)及答案詳解參考
- 2024年高中語(yǔ)文選擇性必修上冊(cè)古詩(shī)文情境式默寫(xiě)(含答案)
- 部編人教版4年級(jí)上冊(cè)語(yǔ)文期末復(fù)習(xí)(單元復(fù)習(xí)+專項(xiàng)復(fù)習(xí))教學(xué)課件
- 2024-2025學(xué)年云南省玉溪市八年級(jí)(上)期末英語(yǔ)試卷(含答案無(wú)聽(tīng)力原文及音頻)
- 綠色建材生產(chǎn)合作協(xié)議
- 英語(yǔ)丨安徽省皖江名校聯(lián)盟2025屆高三12月聯(lián)考英語(yǔ)試卷及答案
- 湖南省長(zhǎng)沙市長(zhǎng)2024年七年級(jí)上學(xué)期數(shù)學(xué)期末考試試卷【附答案】
- 涼山州 2024 年教師綜合業(yè)務(wù)素質(zhì)測(cè)試試卷初中物理
- 他汀不耐受的臨床診斷與處理中國(guó)專家共識(shí)(2024)解讀課件
- 鋼管支撐強(qiáng)度及穩(wěn)定性驗(yàn)算
- 《企業(yè)內(nèi)部控制流程手冊(cè)》
- DB 37T5061-2016 住宅小區(qū)供配電設(shè)施建設(shè)標(biāo)準(zhǔn)
評(píng)論
0/150
提交評(píng)論