當(dāng)前位置:首頁 > 芯聞號 > 充電吧
[導(dǎo)讀]由于課題需要,現(xiàn)開始進(jìn)行對openstack的研究,現(xiàn)在網(wǎng)上對于swift安裝有很多教程,有成功的,有失敗的,現(xiàn)將我的心得告訴大家,方便大家的使用1.首先安裝GIT???? 1.1有人推薦使用????

由于課題需要,現(xiàn)開始進(jìn)行對openstack的研究,現(xiàn)在網(wǎng)上對于swift安裝有很多教程,有成功的,有失敗的,現(xiàn)將我的心得告訴大家,方便大家的使用

1.首先安裝GIT

???? 1.1有人推薦使用

????????????sudo?apt-get?install?git


??????????? PS:在我的環(huán)境下沒成功過...,


???? 1.2使用其他命令步驟安裝


???????????sudo?apt-get?install?git-core?openssh-server?openssh-client
???????????sudo?apt-get?install?git-core?git-gui?git-doc?
???????????sudo?apt-get?install?libcurl4-gnutls-dev?libexpat1-dev?gettext?libz-dev?git-core

????? 至此安裝成功??!


2.swift的安裝部署

? ? ?? 2.1安裝部署依賴項(xiàng)


??????????sudo?apt-get?update
??????????sudo?apt-get?install?curl?gcc?memcached?rsync?sqlite3?xfsprogs?git?python-setuptools
??????????sudo?apt-get?install?python-coverage?python-dev?python-nose?python-simplejson?python-xattr?python-eventlet?python-greenlet?python-pastedeploy?python-netifaces?python-pip?python-dnspython?python-mock

?????? 2.2使用回環(huán)設(shè)備作為存儲,若需要使用一個分區(qū)作為存儲,參見官方文檔


??????????sudo?mkdir?/srv
??????????sudo?truncate?-s?1GB?/srv/swift-disk
??????????sudo??mkfs.xfs?/srv/swift-disk

?????? 2.3修改/etc/fstab添加如下行



??????????/srv/swift-disk?/mnt/sdb1?xfs?loop,noatime,nodiratime,nobarrier,logbufs=8?0?0


?????? 2.4繼續(xù)運(yùn)行下面命令



?????????sudo?mkdir?/mnt/sdb1
?????????mount?/mnt/sdb1
?????????mkdir?/mnt/sdb1/1?/mnt/sdb1/2?/mnt/sdb1/3?/mnt/sdb1/4
?????????chown?root:root?/mnt/sdb1/*
?????????ln?-s?/mnt/sdb1/2?/srv/2?????????ln?-s?/mnt/sdb1/3?/srv/3?????????ln?-s?/mnt/sdb1/4?/srv/4
?????????ln?-s?/mnt/sdb1/1?/srv/1

sudo mkdir -p /etc/swift/object-server /etc/swift/container-server /etc/swift/account-server sudo mkdir -p /srv/1/node/sdb1 /srv/2/node/sdb2 /srv/3/node/sdb3 /srv/4/node/sdb4 /var/run/swift sudo chown -R root:root /etc/swift /srv/[1-4]/ /var/run/swift




???????? 2.5編輯文件/etc/rc.local 在exit 0之前添加一下代碼



????????sudo?mkdir?-p?/var/cache/swift?/var/cache/swift2?/var/cache/swift3?/var/cache/swift4
????????sudo?chown:/var/cache/swift*
????????sudo?mkdir?-p?/var/run/swift
????????sudo?chown:/var/run/swift


??????? 2.6設(shè)置Rsync,創(chuàng)建/etc/rsyncd.conf文件



???????uid?=?root#這里不一定是root
???????gid?=?root#這里不一定是root
???????log?file?=?/var/log/rsyncd.log
???????pid?file?=?/var/run/rsyncd.pid
???????address?=?127.0.0.1
???????
???????[account6012]
???????max?connections?=?25
???????path?=?/srv/1/node/
???????read?only?=?false
???????lock?file?=?/var/lock/account6012.lock
?
???????[account6022]
???????max?connections?=?25?
???????path?=?/srv/2/node/
???????read?only?=?false
???????lock?file?=?/var/lock/account6022.lock

???????[account6032]
???????max?connections?=?25
???????path?=?/srv/3/node/
???????read?only?=?false
??????lock?file?=?/var/lock/account6032.lock
?????
??????[account6042]?
??????max?connections?=?25
??????path?=?/srv/4/node/
??????read?only?=?false
??????lock?file?=?/var/lock/account6042.lock
????
??????[container6011]
??????max?connections?=?25?
??????path?=?/srv/1/node/
??????read?only?=?false
??????lock?file?=?/var/lock/container6011.lock
?????
??????[container6021]
??????max?connections?=?25
??????path?=?/srv/2/node/
??????read?only?=?false
??????lock?file?=?/var/lock/container6021.lock
????
??????[container6031]?
??????max?connections?=?25
??????path?=?/srv/3/node/??
??????read?only?=?false
??????lock?file?=?/var/lock/container6031.lock
????
??????[container6041]
??????max?connections?=?25
??????path?=?/srv/4/node/?
??????read?only?=?false
??????lock?file?=?/var/lock/container6041.lock
?????
??????[object6010]
??????max?connections?=?25
??????path?=?/srv/1/node/?
??????read?only?=?false
??????lock?file?=?/var/lock/object6010.lock
?
??????[object6020]
??????max?connections?=?25
??????path?=?/srv/2/node/
??????read?only?=?false
??????lock?file?=?/var/lock/object6020.lock
????
??????[object6030]
??????max?connections?=?25
??????path?=?/srv/3/node/
??????read?only?=?false
??????lock?file?=?/var/lock/object6030.lock
???
?????[object6040]
?????max?connections?=?25
?????path?=?/srv/4/node/??
?????read?only?=?false
?????lock?file?=?/var/lock/object6040.lock


????? 2.7編輯文件/etc/default/rsync文件設(shè)置參數(shù)RSYNC_ENABLE為true

??????RSYNC_ENABLE=true


???? 2.8啟動rsync服務(wù)


??????service?rsync?restart

??? 2.9確認(rèn)rsync啟動??

??????rsync?rsync://pub@localhost/

?? 2.10開始用到git了,從git上下載swift代碼????

?????git?clone?https://github.com/openstack/swift.git

?? 2.10安裝swift的開發(fā)版本???

?????cd?~/swift
?????git?checkout?-t?origin/stable/grizzly?#?checkout穩(wěn)定分支1.8,可忽略
?????sudo?python?setup.py?develop
?????cd?..

?? 2.11獲取python-swiftclient源代碼,并進(jìn)行安裝



?????git?clone?https://github.com/openstack/python-swiftclient.git
?????cd?~/python-swiftclientsudo?python?setup.py?developcd?..


?? 2.12配置各節(jié)點(diǎn)???

???? 創(chuàng)建文件/etc/swift/proxy-server.conf,

[DEFAULT]
bind_port?=?8080
user?=?root
log_facility?=?LOG_LOCAL1
eventlet_debug?=?true

[pipeline:main]
pipeline?=?healthcheck?cache?tempauth?proxy-logging?proxy-server

[app:proxy-server]
use?=?egg:swift#proxy
allow_account_management?=?true
account_autocreate?=?true

[filter:tempauth]
use?=?egg:swift#tempauth
user_admin_admin?=?admin?.admin?.reseller_admin
user_test_tester?=?testing?.admin
user_test2_tester2?=?testing2?.admin
user_test_tester3?=?testing3

[filter:healthcheck]
use?=?egg:swift#healthcheck

[filter:cache]
use?=?egg:swift#memcache

[filter:proxy-logging]
use?=?egg:swift#proxy_logging



創(chuàng)建文件/etc/swift/swift.conf

[swift-hash]
#?random?unique?strings?that?can?never?change?(DO?NOT?LOSE)
swift_hash_path_prefix?=?rui
swift_hash_path_suffix?=?jie


Create?/etc/swift/account-server/1.conf:

[DEFAULT]
devices?=?/srv/1/node
mount_check?=?false
disable_fallocate?=?true
bind_port?=?6012
user?=?root
log_facility?=?LOG_LOCAL2
recon_cache_path?=?/var/cache/swift
eventlet_debug?=?true

[pipeline:main]
pipeline?=?recon?account-server

[app:account-server]
use?=?egg:swift#account

[filter:recon]
use?=?egg:swift#recon

[account-replicator]
vm_test_mode?=?yes

[account-auditor]

[account-reaper]


Create?/etc/swift/account-server/2.conf:

[DEFAULT]
devices?=?/srv/2/node
mount_check?=?false
disable_fallocate?=?true
bind_port?=?6022
user?=?root
log_facility?=?LOG_LOCAL3
recon_cache_path?=?/var/cache/swift2
eventlet_debug?=?true

[pipeline:main]
pipeline?=?recon?account-server

[app:account-server]
use?=?egg:swift#account

[filter:recon]
use?=?egg:swift#recon

[account-replicator]
vm_test_mode?=?yes

[account-auditor]

[account-reaper]


Create?/etc/swift/account-server/3.conf:

[DEFAULT]

devices?=?/srv/3/node

mount_check?=?false

disable_fallocate?=?true

bind_port?=?6032

user?=?root

log_facility?=?LOG_LOCAL4

recon_cache_path?=?/var/cache/swift3

eventlet_debug?=?true

?

[pipeline:main]

pipeline?=?recon?account-server

?

[app:account-server]

use?=?egg:swift#account

?

[filter:recon]

use?=?egg:swift#recon

?

[account-replicator]

vm_test_mode?=?yes

?

[account-auditor]

?

[account-reaper]


Create?/etc/swift/account-server/4.conf:

[DEFAULT]
devices?=?/srv/4/node
mount_check?=?false
disable_fallocate?=?true
bind_port?=?6042
user?=?root
log_facility?=?LOG_LOCAL5
recon_cache_path?=?/var/cache/swift4
eventlet_debug?=?true

[pipeline:main]
pipeline?=?recon?account-server

[app:account-server]
use?=?egg:swift#account

[filter:recon]
use?=?egg:swift#recon

[account-replicator]
vm_test_mode?=?yes

[account-auditor]

[account-reaper]



Create?/etc/swift/container-server/1.conf:

[DEFAULT]

devices?=?/srv/1/node

mount_check?=?false

disable_fallocate?=?true

bind_port?=?6011

user?=?root

log_facility?=?LOG_LOCAL2

recon_cache_path?=?/var/cache/swift

eventlet_debug?=?true

?

[pipeline:main]

pipeline?=?recon?container-server

?

[app:container-server]

use?=?egg:swift#container

?

[filter:recon]

use?=?egg:swift#recon

?

[container-replicator]

vm_test_mode?=?yes

?

[container-updater]

?

[container-auditor]

?

[container-sync]


Create?/etc/swift/container-server/2.conf:

[DEFAULT]
devices?=?/srv/2/node
mount_check?=?false
disable_fallocate?=?true
bind_port?=?6021
user?=?root
log_facility?=?LOG_LOCAL3
recon_cache_path?=?/var/cache/swift2
eventlet_debug?=?true

[pipeline:main]
pipeline?=?recon?container-server

[app:container-server]
use?=?egg:swift#container

[filter:recon]
use?=?egg:swift#recon

[container-replicator]
vm_test_mode?=?yes

[container-updater]

[container-auditor]

[container-sync]


Create?/etc/swift/container-server/3.conf:

[DEFAULT]
devices?=?/srv/3/node
mount_check?=?false
disable_fallocate?=?true
bind_port?=?6031
user?=?root
log_facility?=?LOG_LOCAL4
recon_cache_path?=?/var/cache/swift3
eventlet_debug?=?true

[pipeline:main]
pipeline?=?recon?container-server

[app:container-server]
use?=?egg:swift#container

[filter:recon]
use?=?egg:swift#recon

[container-replicator]
vm_test_mode?=?yes

[container-updater]

[container-auditor]

[container-sync]


Create?/etc/swift/container-server/4.conf:

[DEFAULT]

devices?=?/srv/4/node

mount_check?=?false

disable_fallocate?=?true

bind_port?=?6041

user?=?root

log_facility?=?LOG_LOCAL5

recon_cache_path?=?/var/cache/swift4

eventlet_debug?=?true

?

[pipeline:main]

pipeline?=?recon?container-server

?

[app:container-server]

use?=?egg:swift#container

?

[filter:recon]

use?=?egg:swift#recon

?

[container-replicator]

vm_test_mode?=?yes

?

[container-updater]

?

[container-auditor]

?

[container-sync]





Create?/etc/swift/object-server/1.conf:

[DEFAULT]
devices?=?/srv/1/node
mount_check?=?false
disable_fallocate?=?true
bind_port?=?6010
user?=?root
log_facility?=?LOG_LOCAL2
recon_cache_path?=?/var/cache/swift
eventlet_debug?=?true

[pipeline:main]
pipeline?=?recon?object-server

[app:object-server]
use?=?egg:swift#object

[filter:recon]
use?=?egg:swift#recon

[object-replicator]
vm_test_mode?=?yes

[object-updater]

[object-auditor]


Create?/etc/swift/object-server/2.conf:

[DEFAULT]
devices?=?/srv/2/node
mount_check?=?false
disable_fallocate?=?true
bind_port?=?6020
user?=?root
log_facility?=?LOG_LOCAL3
recon_cache_path?=?/var/cache/swift2
eventlet_debug?=?true

[pipeline:main]
pipeline?=?recon?object-server

[app:object-server]
use?=?egg:swift#object

[filter:recon]
use?=?egg:swift#recon

[object-replicator]
vm_test_mode?=?yes

[object-updater]

[object-auditor]


Create?/etc/swift/object-server/3.conf:

[DEFAULT]
devices?=?/srv/3/node
mount_check?=?false
disable_fallocate?=?true
bind_port?=?6030
user?=?root
log_facility?=?LOG_LOCAL4
recon_cache_path?=?/var/cache/swift3
eventlet_debug?=?true

[pipeline:main]
pipeline?=?recon?object-server

[app:object-server]
use?=?egg:swift#object

[filter:recon]
use?=?egg:swift#recon

[object-replicator]
vm_test_mode?=?yes

[object-updater]

[object-auditor]


Create?/etc/swift/object-server/4.conf:

[DEFAULT]
devices?=?/srv/4/node
mount_check?=?false
disable_fallocate?=?true
bind_port?=?6040
user?=?root
log_facility?=?LOG_LOCAL5
recon_cache_path?=?/var/cache/swift4
eventlet_debug?=?true

[pipeline:main]
pipeline?=?recon?object-server

[app:object-server]
use?=?egg:swift#object

[filter:recon]
use?=?egg:swift#recon

[object-replicator]
vm_test_mode?=?yes

[object-updater]

[object-auditor]


2.13創(chuàng)建腳本~/bin/remakerings



#!/bin/bash
cd?/etc/swift
rm?-f?*.builder?*.ring.gz?backups/*.builder?backups/*.ring.gz
swift-ring-builder?object.builder?create?10?3?1
swift-ring-builder?object.builder?add?r1z1-127.0.0.1:6010/sdb1?1
swift-ring-builder?object.builder?add?r1z2-127.0.0.1:6020/sdb2?1
swift-ring-builder?object.builder?add?r1z3-127.0.0.1:6030/sdb3?1
swift-ring-builder?object.builder?add?r1z4-127.0.0.1:6040/sdb4?1
swift-ring-builder?object.builder?rebalance
swift-ring-builder?container.builder?create?10?3?1
swift-ring-builder?container.builder?add?r1z1-127.0.0.1:6011/sdb1?1
swift-ring-builder?container.builder?add?r1z2-127.0.0.1:6021/sdb2?1
swift-ring-builder?container.builder?add?r1z3-127.0.0.1:6031/sdb3?1
swift-ring-builder?container.builder?add?r1z4-127.0.0.1:6041/sdb4?1
swift-ring-builder?container.builder?rebalance
swift-ring-builder?account.builder?create?10?3?1
swift-ring-builder?account.builder?add?r1z1-127.0.0.1:6012/sdb1?1
swift-ring-builder?account.builder?add?r1z2-127.0.0.1:6022/sdb2?1
swift-ring-builder?account.builder?add?r1z3-127.0.0.1:6032/sdb3?1
swift-ring-builder?account.builder?add?r1z4-127.0.0.1:6042/sdb4?1
swift-ring-builder?account.builder?rebalance



2.14創(chuàng)建~/bin/startmain

#!/bin/bash
swift-init?main?start



2.15編輯~/.bashrc,在最后添加如下兩行

export?SWIFT_TEST_CONFIG_FILE=/etc/swift/test.conf
export?PATH=${PATH}:~/bin


2.16開啟Swift(在開啟swift之前先運(yùn)行一次remakering)



startmain
檢查Swift工作
swift?-A?http://127.0.0.1:8080/auth/v1.0?-U?test:tester?-K?testing?stat
正確情況下,應(yīng)該輸出以下信息
Account:?AUTH_test
Containers:?0
Objects:?0
Bytes:?0
Accept-Ranges:?bytes




本站聲明: 本文章由作者或相關(guān)機(jī)構(gòu)授權(quán)發(fā)布,目的在于傳遞更多信息,并不代表本站贊同其觀點(diǎn),本站亦不保證或承諾內(nèi)容真實(shí)性等。需要轉(zhuǎn)載請聯(lián)系該專欄作者,如若文章內(nèi)容侵犯您的權(quán)益,請及時聯(lián)系本站刪除。
換一批
延伸閱讀

9月2日消息,不造車的華為或?qū)⒋呱龈蟮莫?dú)角獸公司,隨著阿維塔和賽力斯的入局,華為引望愈發(fā)顯得引人矚目。

關(guān)鍵字: 阿維塔 塞力斯 華為

加利福尼亞州圣克拉拉縣2024年8月30日 /美通社/ -- 數(shù)字化轉(zhuǎn)型技術(shù)解決方案公司Trianz今天宣布,該公司與Amazon Web Services (AWS)簽訂了...

關(guān)鍵字: AWS AN BSP 數(shù)字化

倫敦2024年8月29日 /美通社/ -- 英國汽車技術(shù)公司SODA.Auto推出其旗艦產(chǎn)品SODA V,這是全球首款涵蓋汽車工程師從創(chuàng)意到認(rèn)證的所有需求的工具,可用于創(chuàng)建軟件定義汽車。 SODA V工具的開發(fā)耗時1.5...

關(guān)鍵字: 汽車 人工智能 智能驅(qū)動 BSP

北京2024年8月28日 /美通社/ -- 越來越多用戶希望企業(yè)業(yè)務(wù)能7×24不間斷運(yùn)行,同時企業(yè)卻面臨越來越多業(yè)務(wù)中斷的風(fēng)險,如企業(yè)系統(tǒng)復(fù)雜性的增加,頻繁的功能更新和發(fā)布等。如何確保業(yè)務(wù)連續(xù)性,提升韌性,成...

關(guān)鍵字: 亞馬遜 解密 控制平面 BSP

8月30日消息,據(jù)媒體報道,騰訊和網(wǎng)易近期正在縮減他們對日本游戲市場的投資。

關(guān)鍵字: 騰訊 編碼器 CPU

8月28日消息,今天上午,2024中國國際大數(shù)據(jù)產(chǎn)業(yè)博覽會開幕式在貴陽舉行,華為董事、質(zhì)量流程IT總裁陶景文發(fā)表了演講。

關(guān)鍵字: 華為 12nm EDA 半導(dǎo)體

8月28日消息,在2024中國國際大數(shù)據(jù)產(chǎn)業(yè)博覽會上,華為常務(wù)董事、華為云CEO張平安發(fā)表演講稱,數(shù)字世界的話語權(quán)最終是由生態(tài)的繁榮決定的。

關(guān)鍵字: 華為 12nm 手機(jī) 衛(wèi)星通信

要點(diǎn): 有效應(yīng)對環(huán)境變化,經(jīng)營業(yè)績穩(wěn)中有升 落實(shí)提質(zhì)增效舉措,毛利潤率延續(xù)升勢 戰(zhàn)略布局成效顯著,戰(zhàn)新業(yè)務(wù)引領(lǐng)增長 以科技創(chuàng)新為引領(lǐng),提升企業(yè)核心競爭力 堅持高質(zhì)量發(fā)展策略,塑強(qiáng)核心競爭優(yōu)勢...

關(guān)鍵字: 通信 BSP 電信運(yùn)營商 數(shù)字經(jīng)濟(jì)

北京2024年8月27日 /美通社/ -- 8月21日,由中央廣播電視總臺與中國電影電視技術(shù)學(xué)會聯(lián)合牽頭組建的NVI技術(shù)創(chuàng)新聯(lián)盟在BIRTV2024超高清全產(chǎn)業(yè)鏈發(fā)展研討會上宣布正式成立。 活動現(xiàn)場 NVI技術(shù)創(chuàng)新聯(lián)...

關(guān)鍵字: VI 傳輸協(xié)議 音頻 BSP

北京2024年8月27日 /美通社/ -- 在8月23日舉辦的2024年長三角生態(tài)綠色一體化發(fā)展示范區(qū)聯(lián)合招商會上,軟通動力信息技術(shù)(集團(tuán))股份有限公司(以下簡稱"軟通動力")與長三角投資(上海)有限...

關(guān)鍵字: BSP 信息技術(shù)
關(guān)閉
關(guān)閉