04-容器部署方案-部署容器網(wǎng)絡運行環(huán)境_第1頁
04-容器部署方案-部署容器網(wǎng)絡運行環(huán)境_第2頁
04-容器部署方案-部署容器網(wǎng)絡運行環(huán)境_第3頁
04-容器部署方案-部署容器網(wǎng)絡運行環(huán)境_第4頁
04-容器部署方案-部署容器網(wǎng)絡運行環(huán)境_第5頁
已閱讀5頁,還剩25頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領

文檔簡介

《容器技術實戰(zhàn)》廣州白云工商技師學院云計算和大數(shù)據(jù)人才培養(yǎng)規(guī)劃教材項目任務容器部署方案(部署容器網(wǎng)絡運行環(huán)境)計算機網(wǎng)絡教研室復習回顧回顧與作業(yè)點評回顧:

1、Ubuntu安裝過程2、怎樣用終端連接主機

作業(yè)點評:

安裝過程中出現(xiàn)問題和解決辦法任務要求配置主機的網(wǎng)絡參數(shù),配置容器運行環(huán)境。學習目標1、能配置Ubuntu網(wǎng)絡參數(shù);2、能配置Ubuntu源;3、能測試互聯(lián)網(wǎng)的連通性;4、體驗研究問題的快樂,養(yǎng)成良好工作學習的習慣。重點難點重點:1、配置Ubuntu網(wǎng)絡參數(shù)2、配置Ubuntu系統(tǒng)源難點:配置Ubuntu網(wǎng)絡參數(shù)學習內(nèi)容部署容器主機網(wǎng)絡環(huán)境配置系統(tǒng)網(wǎng)絡參數(shù)01配置系統(tǒng)源02測試源更新03一配置Ubuntu網(wǎng)絡參數(shù)分析示例1:配置Ubuntu網(wǎng)絡參數(shù)修改root密碼修改root密碼,由于對系統(tǒng)的修改需要root用戶的權限,現(xiàn)在需要修改root用戶的密碼adminroot@blockchain:~$sudopasswdroot[sudo]passwordforadminroot:EnternewUNIXpassword:RetypenewUNIXpassword:passwd:passwordupdatedsuccessfullyadminroot@blockchain:~$一配置Ubuntu網(wǎng)絡參數(shù)分析示例1:配置Ubuntu網(wǎng)絡參數(shù)修改網(wǎng)絡設置Ubuntu18.04不再使用ifupdown配置網(wǎng)絡,而改用netplan。在/etc/network/interfaces配置固定IP是無效的,重啟網(wǎng)絡的命令servicesnetworkrestrart或/etc/init.d/networkingrestart也是無效的。可以采用兩種方案進行修改:1、利用傳統(tǒng)的方式,使用ifupdown配置網(wǎng)絡2、利用Ubuntu18.04默認的方式,使用netplan配置網(wǎng)絡一配置Ubuntu網(wǎng)絡參數(shù)分析示例1:配置Ubuntu網(wǎng)絡參數(shù)修改網(wǎng)絡設置1、利用傳統(tǒng)的方式,使用ifupdown配置網(wǎng)絡(1)如果要使用之前的方式配置網(wǎng)絡,需要重新安裝ifupdown:sudoaptinstallifupdown修改配置文件/etc/network/interfaces:sudovim/etc/network/interfaces配置文件修改如下:ifaceens160inetstaticaddress5gateway54netmaskdns-nameservers重啟網(wǎng)絡服務使配置生效sudoservicesnetworkrestrart一配置Ubuntu網(wǎng)絡參數(shù)分析示例1:配置Ubuntu網(wǎng)絡參數(shù)修改網(wǎng)絡設置2、利用Ubuntu18.04默認的方式,使用netplan配置網(wǎng)絡Ubuntu18.04使用netplan配置網(wǎng)絡,其配置文件是yaml格式的。安裝好Ubuntu18.04之后,在/etc/netplan/目錄下默認的配置文件名是50-cloud-init.yaml,我們通過VIM修改它:sudovim/etc/netplan/50-cloud-init.yaml本網(wǎng)絡用自動獲取方式,配置如下:root@blockchain:/etc/netplan#vim50-cloud-init.yaml#Thisfileisgeneratedfrominformationprovidedby#thedatasource.Changestoitwillnotpersistacrossaninstance.#Todisablecloud-init'snetworkconfigurationcapabilities,writeafile#/etc/cloud/cloud.cfg.d/99-disable-network-config.cfgwiththefollowing:#network:{config:disabled}network:ethernets:ens32:dhcp4:trueversion:2一配置Ubuntu網(wǎng)絡參數(shù)分析示例1:配置Ubuntu網(wǎng)絡參數(shù)補充yaml文件格式基本原則1、大小寫敏感2、使用縮進表示層級關系3、禁止使用tab縮進,只能使用空格鍵4、縮進長度沒有限制(只能使用空格縮進),只要元素對齊就表示這些元素屬于一個層級。5、使用#表示注釋6、字符串可以不用引號標注? "hello"? 'hello'? hello一配置Ubuntu網(wǎng)絡參數(shù)分析示例1:配置Ubuntu網(wǎng)絡參數(shù)補充yaml文件格式--yaml中的三種數(shù)據(jù)結構map-散列表#使用冒號(:)表示鍵值對,同一縮進的所有鍵值對屬于一個map,示例:age:12name:huangsex:manlist-數(shù)組#使用連字符(-)表示:#YAML表示-a-b-12一配置Ubuntu網(wǎng)絡參數(shù)分析示例1:配置Ubuntu網(wǎng)絡參數(shù)補充yaml文件格式--yaml中的三種數(shù)據(jù)結構scalar-純量字符串 "hello" world布爾值 true false整數(shù) 12,13浮點數(shù) 12.6NULL 使用~表示一配置Ubuntu網(wǎng)絡參數(shù)分析示例1:配置Ubuntu網(wǎng)絡參數(shù)補充yaml文件格式--舉例#例1Websites:YAML:Ruby:Python:Perl:一配置Ubuntu網(wǎng)絡參數(shù)分析示例1:配置Ubuntu網(wǎng)絡參數(shù)補充yaml文件格式--舉例練習完成時間:15分鐘學生練習,教師巡回指導一配置Ubuntu網(wǎng)絡參數(shù)分析示例1:配置Ubuntu網(wǎng)絡參數(shù)補充yaml文件格式--舉例#例2languages:-Ruby-Perl-Python-c一配置Ubuntu網(wǎng)絡參數(shù)分析示例1:配置Ubuntu網(wǎng)絡參數(shù)補充yaml文件格式--舉例#例3--Ruby-Perl-Python--c-c++-java一配置Ubuntu網(wǎng)絡參數(shù)分析示例1:配置Ubuntu網(wǎng)絡參數(shù)補充yaml文件格式--舉例#例4-id:1name:huang-id:2name:liao檢測工具,直接將文本復制到網(wǎng)站就可/tool-format-yaml一配置Ubuntu網(wǎng)絡參數(shù)分析示例1:配置Ubuntu網(wǎng)絡參數(shù)修改網(wǎng)絡設置2、利用Ubuntu18.04默認的方式,使用netplan配置網(wǎng)絡其他靜態(tài)配置舉例說明配置文件修改如下:

network:ethernets:ens160:addresses:-8/24

#IP及掩碼gateway4:54#網(wǎng)關nameservers:addresses:-#DNSversion:2無論是ifupdown還是netplan,配置的思路都是一致的,在配置文件里面按照規(guī)則填入IP、掩碼、網(wǎng)關、DNS等信息。注意yaml是層次結構,需要縮進,冒號(:)表示字典,連字符(-)表示列表。重啟網(wǎng)絡服務使配置生效:sudonetplanapply一配置Ubuntu網(wǎng)絡參數(shù)分析示例1:配置Ubuntu網(wǎng)絡參數(shù)查看dns配置信息root@blockchain:/etc#systemd-resolve--statusGlobalDNSSECNTA:10.16.172.168.192.17.172.18.172.19.172.20.172.21.172.22.172.23.172.24.172.25.172.26.172.27.172.28.172.29.172.30.172.31.172.

corp

homeinternalintranetlanlocalprivatetestLink2(ens32)CurrentScopes:DNSLLMNRsetting:yesMulticastDNSsetting:noDNSSECsetting:noDNSSECsupported:no

DNSServers:DNSDomain:localdomain一配置Ubuntu網(wǎng)絡參數(shù)分析示例1:配置Ubuntu網(wǎng)絡參數(shù)完成時間:15分鐘學生練習,教師巡回指導二配置Ubuntu系統(tǒng)源分析示例2:配置Ubuntu系統(tǒng)源修改源(改為阿里云的源)首選做個備份(1)備份root@blockchain:/etc/apt#cpsources.listsources.list.back(2)查看文件root@blockchain:/etc/apt#lsapt.conf.dsources.listsources.list.curtin.oldtrusted.gpg.dpreferences.dsources.list.backsources.list.d二配置Ubuntu系統(tǒng)源分析示例2:配置Ubuntu系統(tǒng)源修改源(改為阿里云的源)修改源文件內(nèi)容(3)修改源文件內(nèi)容將源修改為阿里云的源root@blockchain:/etc/apt#vimsources.listdeb/ubuntu/bionicmainrestricteduniversemultiversedeb-src/ubuntu/bionicmainrestricteduniversemultiversedeb/ubuntu/bionic-securitymainrestricteduniversemultiversedeb-src/ubuntu/bionic-securitymainrestricteduniversemultiversedeb/ubuntu/bionic-updatesmainrestricteduniversemultiversedeb-src/ubuntu/bionic-updatesmainrestricteduniversemultiversedeb/ubuntu/bionic-backportsmainrestricteduniversemultiversedeb-src/ubuntu/bionic-backportsmainrestricteduniversemultiversedeb/ubuntu/bionic-proposedmainrestricteduniversemultiversedeb-src/ubuntu/bionic-proposedmainrestricteduniversemultiverse二配置Ubuntu系統(tǒng)源分析示例2:配置Ubuntu系統(tǒng)源修改源(改為阿里云的源)修改源文件內(nèi)容(3)修改源文件內(nèi)容將源修改為阿里云的源###############################################################################Thefollowingistheoriginalsource,andthethree#aretheoriginalvalidsources#############################################################################See/community/UpgradeNotesforhowtoupgradeto#newerversionsofthedistribution.###deb/ubuntubionicmainrestricted#deb-src/ubuntubionicmainrestricted##Majorbugfixupdatesproducedafterthefinalreleaseofthe##distribution.###deb/ubuntubionic-updatesmainrestricted#deb-src/ubuntubionic-updatesmainrestricted##N.B.softwarefromthisrepositoryisENTIRELYUNSUPPORTEDbytheUbuntu##team.Also,pleasenotethatsoftwareinuniverseWILLNOTreceiveany##revieworupdatesfromtheUbuntusecurityteam.###deb/ubuntubionic

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論