版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
實(shí)驗(yàn)四鏡像服務(wù)Glance的安裝、配置,鏡像構(gòu)建實(shí)驗(yàn)?zāi)康耐瓿蒓penStack鏡像服務(wù) Glance的安裝、配置;完成鏡像構(gòu)建。實(shí)驗(yàn)內(nèi)容?鏡像服務(wù)Glance的安裝與配置?鏡像構(gòu)建實(shí)驗(yàn)步驟①、首先輸入密碼123456,登錄進(jìn)入虛擬機(jī)。②、然后單擊Terminal,進(jìn)入命令行界面。③、由于所有步驟與操作均需要在root權(quán)限下執(zhí)行,所以需要切換到root用戶下:su輸入密碼:1234561.準(zhǔn)備工作(controller)在安裝和配置圖像服務(wù)之前,必須創(chuàng)建一個(gè)數(shù)據(jù)庫(kù)、服務(wù)憑據(jù)和API節(jié)點(diǎn)。,創(chuàng)建數(shù)據(jù)庫(kù)以root用戶進(jìn)入mysql數(shù)據(jù)庫(kù)(本環(huán)境中MYSQL數(shù)據(jù)庫(kù)的默認(rèn)密碼為123456)mysql-uroot-proot^controller:mysql-Jroot-pl23456WelcometotheMariaDBmonitor.Commandsendwith;orKg*YourHariaDDconnectionidis28Serverversion:5.5.52-HdriaDB-lubminiO.14.04.1(Ubunru!Copyright(c)2006r2016,Oracle,MariaDBCorporationAbandothers.Type'help;'or'\h1forhelp.Type'\c1toclearthecurrentinputstatement.MariflDB[(none)]>\創(chuàng)建Glance數(shù)據(jù)庫(kù)CREATEDATABASEglance;Maria&B[(none)1>CREATEDATABASEglanice;Query0Kr1rowaflected(0.sec}HariaDB[(none)]>口授予Glance數(shù)據(jù)庫(kù)訪問(wèn)權(quán)限,使得本地及遠(yuǎn)程都能訪問(wèn)(需要將123456替換成你自己的密碼)GRANTALLPRIVILEGESONglance.*TO'glance'@'localhost'IDENTIFIEDBY'123456';GRANTALLPRIVILEGESONglance.*TO'glance'@'%'IDENTIFIEDBY'123456';ManaDEEtnome)]?■GRANTALLPRIVILEGESONglance,*TO'glance'e'localhost'IDENTIFIEDBY'1.23456,;QueryDK,3rowsaffected[B.HBsec>NariaDB[(none]]iGRANTALLPRTVILEGESONglance.ATO'glance'^'t'TDEITriFIEDBY'123^56,;QueryDK,9rowsaffectedsec卜MariaDB|(none)]>|口退出數(shù)據(jù)庫(kù)quitMariaDB[(none)]>Quit;Bye獲得管理員憑據(jù)來(lái)訪問(wèn)僅管理員CLI命令執(zhí)行.admin-openrc腳本roattacontrailer:-#.admin-openrcroat(acontrailer:-#創(chuàng)建服務(wù)憑據(jù)口創(chuàng)建Glance用戶(請(qǐng)記住你的輸入的密碼,建議還是123456)openstackusercreate--domaindefault--password-promptglanceubuntu@cantrailsr:/$openstack,usercreate--domaindefault--password-promptglanceUserPassword:RepeatUser Password:TOC\o"1-5"\h\z4- +\o"CurrentDocument"IField | Value |-I 1 K-|domain_id f67fdcel3S054b7297b0be3D860362ccenabled Trueid 625cl84ddb2a4a729ae70dat>09b3L650name glance+ lr lrubuntu@controllsr:/f|添加管理員角色到用戶和服務(wù)項(xiàng)目(這條命令沒(méi)有返回)openstackroleadd--projectservice--userglanceadminraat@controller:-#openstackroleadd-■projectservice--userglanceadminroot@contrctler:|創(chuàng)建Glance服務(wù)openstackservicecreate--nameglance--description"OpenStackImage"image
roctdcontrolleropenstackservicecreate--nameglance--description11OpenStacklinage"iniage1Field1Value1T■TT1description1OpenStaclkImage11enabled1True11-d1O72ac06-f00a04661a62aba89c7ab7e5e11name1glance11type1image14-■+-+rocti?control19r; |?創(chuàng)建鏡像服務(wù)的節(jié)點(diǎn),:'創(chuàng)建鏡像服務(wù)API節(jié)點(diǎn)openstackendpoint create --region RegionOne image publichttp://controller:9292openstackendpoint create --region RegionOne image internalhttp://controller:9292openstackendpoint create --region RegionOne image adminhttp://controller:9292rootontro11gr:openstackendpointcreate--regionRegionOn'eiimaggpublichttp;//coritroller;9292Field|Valueenabled|Trueid|1c6a664a87344696b14b0e1df556t075interface|publicregion|ReglonOnieregion_id|RegionOnie5ervice_id|972acO6fe0a04661a02abaa9c7ab7e5eservlcie_name|glmn出serule?_type|url 一http://cantrDller:9292- openstackefidpDintcreate--regionRegionOneimageinternalhttp;//cortrol10r;9292Field1ValueenabledT1Trueid117a2850c^d3b470ea4d3d38db491bl2finterface1internalregion1RegionOneiregion_id1RegionOreservice_id1O72acO6fe0a04661a02aba89c?ab7e5e5ervlc9_name1glanceservice_type1iiregeurl1■+■http://controller:9292root@controller:-4openstacKendpointcreate--regionRegionOneimageadminhUp:/J,controUer:9292——+-----------------------------------i-|Field IValue |enabledTrue|id |e0edd5222eaf4c31bedcl31a3ab3ei06|admin1region |RegionOneregion_idRegionOne|servic-e_id072acO6f?Oae4661ae2abaS9c7ab7e5e|S0rvic-e_nari0|glance|servdce_type|image ||url一 |+ 1_?http^//controllerj9292 L2.安裝和配置組件默認(rèn)配置文件按分布變化。您可能需要添加這些部分和選項(xiàng),而不是修改現(xiàn)有的部分和選項(xiàng)。另外,省略號(hào)(…)在配置片段表明潛在的默認(rèn)配置選項(xiàng),你應(yīng)該保留。?安裝相關(guān)軟件包口安裝軟件包apt-getinstallglanceroottaccmtroller: apt-getiistallglanceReadingpackagelists...DoneBuiIdLngdependencytreeReadingstateinformation...DoneThefollawiigextrapackageswillbeinstalled:glance-apiglancecommonglance-registrylibblas2LibgfortranJLiblapackSllbpq5libquadmathOpython-aurorratonpython-castellanpython-cgenix-mxdatQtimep/thon-egenix-mxtoDlspython-glancepython-glance-storepython-httplib2pythor-ipaddrpython-kazoopython-retworkxpython-nunpypython-apensslpython-osprofilerpython-psyccpg2python-semanticversionpython-simolegenericpython-taskftawpython-wsmeSuggestedpackages:pytlion-cephpython-auTomaton-dacpython-castellan-docpython-egenIx-mYdatetirnQ-dbgpython-egeniy-mYdatstime-dcicpython-egenix-mxtoots-dbgaythan-egen_x-mxtDol.s-docpython-kazoo-docpython-matplotlibpython-scipypython-pygraphvizpython-pydotgccgfortranpython-devpython-nosepython-numoy-dbgpython-numoy-docpython-openssldocpython-openssl-dbgpython-3sycapg2-docpython-semantic-version-docThefollawiigNEWpackageswillbeinstalled:glanceglance-apiglance-commonglance-registryllbbtas3libgfortran3Iiblapack2libpqSlibquadm^thOpython-automatonpython-castellanpython-egenix-mxdatetimepython-egenix-rnKtoolspython-glancepython-glance-storepython-httplib2pythar-ipaddraython-kazoopython-retworkxpython-numoypyth口n-osprcj'Filerpython-psycopg2python-semantic-versionpython-simplegenericpython-taskflowpython-wsme編輯glance-api的配置文件口進(jìn)入配置文件編輯界面gedit/etc/glance/glance-api.conf口在[database]中修改數(shù)據(jù)庫(kù)連接(注意替換GLANCE_DBPASS為你創(chuàng)建的GLANCE數(shù)據(jù)庫(kù)的密碼)[database]connection=mysql+pymysql://glance:123456@controller/glance[database]#Fromoslo.db#Thefilonam&tousdwithSQLite.(stringvalue)Deprecatedgroup/name-[DEFAULTJ/5qlite_dbsqlite_db=/var/lib/glance/glance.sqliteIfTrue?SQLiteusessynchronousmode.(booleani/alue)茸Deprecatedgroup/name-[DEFAULT]/sqlite_synchronousSolite_SynChr0n0US=true 替換為你自己的密碼'Ihebackendtauseforthedatabase,(stringvalue)Deprecatedgroirp/name-[DEFAULT]/db_bacmndbackend=sqlaichemyTheSQLALchemyconnectionstringtoU5eftoconnecttothedatabase.(stringvalue) /Deprecatedgroup/name-[DEFAULT]/sqlJannectionDAprecatArigroup/name-[DATABASE]/sq*connsctinnDeprecatedgroup/name-[sql]/connectionconnection=<None> connection=mysql+pymysqt://glance:123456^controller/glance。在[1^丫$10門(mén)6_a仇討01^川和[paste_deploy]中添加配置,確認(rèn)認(rèn)證服務(wù)連接(注意替換GLANCE_PASS為你創(chuàng)建的GLANCE用戶的密碼)[keystone_authtoken]auth_uri=http:〃controller:5000auth_url=http:〃controller:35357memcached_servers=controller:11211auth_type=passwordproject_domain_name=defaultuser_domain_name=defaultproject_name=serviceusername=glancepassword=123456[keystanie_authtoken]注意:此處的配置[keystanie_authtoken]注意:此處的配置用以是直接添加,也
可以找到相應(yīng)的注釋Fromkeystonemiddleware.auth_tok一[keystane_authtaken]auth_uri=http://controllgr:5000掉的配置進(jìn)行修改auth_url=http://contrDllsr:35357memcachedservers=controller:11211authtype=passwor-dprojectdomainname=defaultuser_domain_name=defaultpraject_name=serviceusername=glancepassword=1234561CampletepublicIdentityAPIendpoint.(stringvalue)authuri=<jipne>TAPIversionloftheadminIdentityAPIendpoint.(stringvalue#auth_versioif=<None>Don咕.冽邑st£withinthemiddlewarepb# todownstreamWSGIcampon茸(booleanvalue)#delay_auth_decisi0n=f^lse[paste_deploy]flavor=keystone[pastedeploy]Fromglance.apiPartialnameofapipelineinyourpasteconfigurationfilewiththeservicenameremoved.ForexampleFifyourpastesectionnameis[pipeline:glanc&-api-keystone]usethevalue"keystone"(stringvalue)#flavor=<None>flavHr=keystoneNameofthepasteconfigurationfile.(stringvalue)con_l=ig_file=<None>口在[glance_store中配置本地文件系統(tǒng)存儲(chǔ)和鏡像文件的位置[glance_store]stores=file,httpdefault_store=filefilesystem_store_datadir=/var/lib/glance/images/
[glancestore]#Fromglance.store#注意:找到對(duì)應(yīng)配置進(jìn)行修改或直接添加![glancestore]#Fromglance.store#注意:找到對(duì)應(yīng)配置進(jìn)行修改或直接添加!5tores=file,httpdefault_store=fileTilesystemstore_daTadir=/var/libfglance/Images/|Listofstaresenabled,Validstoresare:cinder,fileHhttp,rbd,#sheepdog,swift,s3dvsphere(listval^e)#5tare5-file,http保存后退出,然后創(chuàng)建對(duì)應(yīng)文件夾并賦予訪問(wèn)權(quán)限:mkdir-p/var/lib/glance/imageschown-Rglance.glance/var/lib/glance/images.編輯glance-registry配置文件gedit/etc/glance/glance-registry.conf在[database]中確認(rèn)數(shù)據(jù)庫(kù)連接(注意替換GLANCE_DBPASS為你創(chuàng)建的GLANCE數(shù)據(jù)庫(kù)的密碼)[database]connection=mysql+pymysql://glance:123456@controller/glanceFromoslo.dbThefilenametoLtsewithSQLite.(stringvalue)Deprecatedgroup/name-[DEFA.ULT]/sqtite_dbsqlite_db=oslo.sqlitesqlitedb=/ver/lib/glance/glance.sqliteIfTrue,SQLiteusessynchronousmode,(booleanvalue)Deprecatedgroup/narne-[DEFA.ULT]/sqlite_syn-chronoussqlite_synchronous=trueThebackendtouseforthedatabase,(stringvalue)Deprecatedgroup/name-[DEFAULT]/db_backendbackend=sqlalchemy 替換為你自己的密碼TheSQLALchernyconnectionstringtdusetoconnecttothedatabase,(stringvalue)Deprecatedgroup/name-[DEFAULT]/|ql_connectionDeprecatedgwup/name-[DATABASE]isql_connectionDeprecatedgroup/name-[sql]/connectionConnection=<Hone> connection=mysql+pymysql://glartce:123456^controtler/glance口在[keystone_authtoken]和[paste_deploy]中配置認(rèn)證服務(wù)連接(注意替換123456你創(chuàng)建的GLANCE用戶的密碼)
[keystone_authtoken]auth_uri=http:〃controller:5000auth_url=http:〃controller:35357memcached_servers=controller:11211auth_type=passwordproject_domain_name=defaultuser_domain_name=defaultproject_name=serviceusername=glancepassword=123456[key5tane_aLrthtoken]一 注意:找到相應(yīng)配置進(jìn)行修改或7TFromkeystenemiddleware.auth_tcken直力口音可'auth_uri=http://controller:5090SLEth_idrl=hlLp://conLroiler:35357menicach>ed_servers=cantroller:11211auth_type=passwordpreject_domain_naEre=deiaultuser_domain_name=defaultproject_narue=serviceusername=glancepassword=123456Coriplet?publicIdentityAPIendpoint,(strincvalue]i!fauth_uri-APIversionoTtheadminIdentityftPIendpoint,(stringvalue)#authversian=<None>[paste_deploy]flavor=keystone[pastedeploy]IFromglance.registryflavor=keystonejPartialnameofapipelineinyourpasteconfigurationfilewiththeservicenameremoved.Forexample,ifyourpastesectionnameis[pipeline:glance-api-keystone]usethevalue"keystone"(stringvalue)fLavor=<None>填充鏡像服務(wù)數(shù)據(jù)庫(kù)口同步GLANCE口同步GLANCE數(shù)據(jù)庫(kù)su-s/bin/sh-c"glance-managedb_sync"glanceroot@contrQl.ler:--#su-s/bin/shi-c-glance-managedb_synchglance/□sr/lib/pythoni2.7/dist-packages/oslo_db/sqlalcheniy/enginefacade.py-1656:OsloDBDeprecatioftWarningzEngineFacadqlalchemy-enginiefacadeexpirg_on_cDmmilt=Qxpire_on_coiwultr_conf=conf)migrat?,versioning.expirg_on_cDmmilt=Qxpire_on_coiwultr_conf=conf)migrat?,versioning.ap1[-]9->1...glance,db,5qlalche?nyrniigraite_rep<iBsctiema[■]creatingmigrate.versioning.api[-]damemigrate.versioning.api[-]1->2...glance.db.sqlalchemy.migrate_repo,schema(")creating2816-12-1913:33::22^.3873824INFO2916-12-1913;33;;22.3893824INFO2016-12-1913:33::22.5373B24INFO2016-12-1913:33::22?53S3S24INFO2816-121913:33::22?5443B24INFO2016-121913:9922,7363824INFO2816-121913:9922,7313824INFO2616-12-1913:3322.9833824INFO2816-12-1913:3322,9633834INFO2816-12-1913:3323,678.3824INFO2816-12-1913:3323,6783824INFO2016-12-1913:33:::23.1753024INFO2016-12-1913:33::23.1753024INFO2016-12-1913:23:22.2482824INFO2816-121913:3323.3483824INFO2816-121913:3323,4493824INFO2016-121913:3923,4563824INFO2016-12-1913:3323-45C3824INFO2816-12-1913:3323,6773B24INFO2816-12-1913:3323,6763834INFO2916-12-1913;33;;23,8983824INFO2016-12-1913:33::23.S9S3824INFOmigrate,versicfllrig.aplmigrate--versioning,aplmigrate-versioning.apimigrate,versioning.aplmigrate,versioning,aplimigrate,versioning,apimigrate-,vbtsianing.apimigrate.versianirg,apimigrate.verslanlrg.apimigrate,versicmiinq.apimigrate',versioning,aplmigrate,versianiing.apiI-]I][-][-][-]1-]I-]1-]17I-][-]tsbletableiirwgeslniage_propertiesdon@2donedone->done->done->don@4???6...glance.db.&qlalch€iimy.niigratG_repo.schemaI-]creatingtableiniag電membersmigrate,versioningPaplmigrate,versioning.apln?igrate,¥er5ioning『口口imigrat&.versianirg.api[][][]I]done8->9...doneg->ie...?重啟鏡像服務(wù)口重啟GLANCE服務(wù)使配置生效serviceglance-registryrestartserviceglance-apirestartroot^controller:'#serviceglance-registryrestartglance-registrystop/waitingglance-registrystart/running,process3355raot^contrailer;serviceglance-aplrestartglance-apistop/waitingglance-apistart/running,process3S75raot^controller:|3.驗(yàn)證操作獲得管理員憑據(jù)來(lái)訪問(wèn)僅管理員CLI命令口執(zhí)行.admin-openrc腳本.admin-openrcroat^controller:-#.admin-openrrroot@controller上傳鏡像至|JGLANCE下載鏡像文件到/var/lib/glance/images文件夾方法一:cd/var/lib/glance/imageswget/0.3.4/cirros-0.3.4-x86_64-disk.img方法二:
溫馨提示
- 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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 二零二五年度電子合同法律效力認(rèn)定及證據(jù)保全操作規(guī)程3篇
- 二零二五年度汽車(chē)銷(xiāo)售與售后服務(wù)咨詢合同2篇
- 二零二五年鋼筋制作與安裝勞動(dòng)合同規(guī)范3篇
- 二零二五版企業(yè)品牌形象策劃執(zhí)行合同3篇
- 二零二五年度工傷事故賠償協(xié)議及后續(xù)心理咨詢服務(wù)合同6篇
- 二零二五年度電梯產(chǎn)品研發(fā)與創(chuàng)新基金投資合同3篇
- 二零二五年度蜜蜂養(yǎng)殖環(huán)境監(jiān)測(cè)與改善合同2篇
- 小麥種子繁育生產(chǎn)合同(2篇)
- 二零二五年電子商務(wù)SET協(xié)議安全技術(shù)實(shí)施合同3篇
- 二零二五年智能工廠生產(chǎn)過(guò)程監(jiān)控合同樣本3篇
- 2024年采購(gòu)代發(fā)貨合作協(xié)議范本
- 2024年業(yè)績(jī)換取股權(quán)的協(xié)議書(shū)模板
- 顳下頜關(guān)節(jié)疾病(口腔頜面外科學(xué)課件)
- 工業(yè)自動(dòng)化設(shè)備維護(hù)保養(yǎng)指南
- 2024人教新版七年級(jí)上冊(cè)英語(yǔ)單詞英譯漢默寫(xiě)表
- 《向心力》參考課件4
- 2024至2030年中國(guó)膨潤(rùn)土行業(yè)投資戰(zhàn)略分析及發(fā)展前景研究報(bào)告
- 2024年深圳中考數(shù)學(xué)真題及答案
- 土方轉(zhuǎn)運(yùn)合同協(xié)議書(shū)
- Module 3 Unit 1 Point to the door(教學(xué)設(shè)計(jì))-2024-2025學(xué)年外研版(三起)英語(yǔ)三年級(jí)上冊(cè)
- 智能交通信號(hào)燈安裝合同樣本
評(píng)論
0/150
提交評(píng)論