本文主要介紹先下載iaas鏡像(先構(gòu)建paas平臺(tái)),下面一起看看先下載iaas鏡像(先構(gòu)建paas平臺(tái))相關(guān)資訊。
#!/bin/bash#聲明解釋器路徑source /etc/xiandian/openrc.sh#有效環(huán)境變量# selinux sed-i/selinux =。*/selinux = permission/g ;/etc/selinux/config #編寫(xiě)配置文件。永久關(guān)閉selinuxsetenforce 0#臨時(shí)關(guān)閉selinux # firewalldsystemctl停止防火墻d #關(guān)閉防火墻systemctl禁用防火墻d/dev/null 21 #關(guān)閉引導(dǎo)自啟動(dòng)防火墻,并以額外的將該命令的正確輸出和錯(cuò)誤輸出保存到/dev/null,相當(dāng)于將其扔進(jìn)回收站# networkmanagersystemctl停止網(wǎng)絡(luò)管理器/dev/null 21 #關(guān)閉網(wǎng)絡(luò)管理器并將該命令的正確輸出和錯(cuò)誤輸出保存到/dev/null。相當(dāng)于把它扔到回收站system ctl disable network manager/dev/null 21 #關(guān)閉開(kāi)機(jī)自啟動(dòng)網(wǎng)絡(luò)管理器,把這個(gè)命令的正確輸出和錯(cuò)誤輸出保存到/dev/null。相當(dāng)于扔進(jìn)了回收站yum remove-y網(wǎng)管防火墻d #卸載防火墻系統(tǒng)ctl重啟網(wǎng)絡(luò)#重啟網(wǎng)絡(luò)服務(wù)# iptables yum安裝iptables-services-y if [0-ne $?];然后回聲e 安裝源配置錯(cuò)誤exit 1fi #不解釋安裝iptables服務(wù)shell的語(yǔ)法,這部分的作用是看iptables服務(wù)是否安裝成功,并報(bào)錯(cuò),終止腳本的執(zhí)行。然后打印出來(lái)(安裝源配置錯(cuò)誤)system ctl restart iptables # restart iptables service iptables-f #清除所有規(guī)則iptables -x#刪除自定義鏈iptables -z #鏈計(jì)數(shù)器清除/usr/sbin/iptables-保存#保存和修改系統(tǒng)ctl停止iptables#關(guān)閉iptables服務(wù)系統(tǒng)ctl禁用iptabl 88722806 # installpackagesed-i-e/# used nsyes/used nsno/g ;-e/gssapiaouthentication是/gssapiaouthentication否/g ;/etc/ ssh/sshd _ config #編輯/etc/ ssh/sshd _ config文件,關(guān)閉dns域名解析,關(guān)閉gssapi認(rèn)證,提高ssh連接速度yum upgrade -y#升級(jí)所有軟件包和系統(tǒng)版本,不改變內(nèi)核。軟件和系統(tǒng)設(shè)置yum安裝python-openstackclient openstack-selinux open stack-utils crudini expect-y #安裝open stack軟件包、crudini命令解釋器和expect命令解釋器# # hosts if[[` ip a | grep-w $ host _ ip host _ ip `!= ]];然后hostname ctl set-hostname $ host _ name elif[[` ip a | grep-w $ host _ ip _ node `!= ]];然后hostname ctl set-hostname $ host _ name _ node else hostname ctl set-hostname $ host _ namefised-i-e /$主機(jī)名稱/d -e /$主機(jī)名稱節(jié)點(diǎn)/d /etc/hosts echo 主機(jī)名稱 /etc/hosts echo 主機(jī)名稱節(jié)點(diǎn) 不解釋/etc/hosts # shell。這部分的作用是設(shè)置主機(jī)名和主機(jī)解析# ssh if [!-s ~/。ssh/id _ rsa . pub]];然后ssh-keygen-t rsa-n ; -f ~/。ssh/id_rsa -q -b 2048 finame = ` hostname if[[$ name = = $ host _ name]];期望-c 設(shè)置超時(shí)-1;生成ssh-copy-id -i /root/。ssh/id _ rsa $主機(jī)名稱節(jié)點(diǎn);expect { * password : * { send-$ host _ pass _ node \ r;expect { * denied * { exit 2;} eof} } *(是/否)* { send-yes \ r;exp _ continue} eof { exit 1;} } else expect-c 設(shè)置超時(shí)-1;生成ssh-copy-id -i /root/。ssh/id _ rsa $ host _ name;expect { * password : * { send-$ host _ pass \ r;expect { * denied * { exit 2;} eof} } *(是/否)* { send-yes \ r;exp _ continue} eof { exit 1;} } fi # shell和expect的語(yǔ)法就不解釋了,這部分的作用是生成密鑰傳輸?shù)搅硪粋€(gè)節(jié)點(diǎn)的ssh。實(shí)現(xiàn)免密登錄的語(yǔ)法expect:://blog.csdn.net/hanguofei/article/details/. 103135178 ssh-keygen命令簡(jiǎn)介: _ 40932679/article/details/117487540 # chrony yum install-y chrony if[$ name = $ host _ name]];戰(zhàn)略與經(jīng)濟(jì)對(duì)話。;3,6s/#/g ;/etc/chronicle . conf sed-i ;7s//服務(wù)器控制器i burst/g ;/etc/chronicle.conf #表示與控制器echo 允許$network_segment。_ ip /etc/chronicle.conf #允許network_segment_ip與此時(shí)間服務(wù)器同步時(shí)間?;芈晥?bào)局部地層 else sed-i ;3必須配置。6s/^/#/g;/etc/chrony . conf sed-i ;7s/^/server控制器iburst/g ;/etc/chrony . confissystemctl restart chronydsystemctl enable chronyd #安裝chrony軟件實(shí)現(xiàn)ntp服務(wù)的shell語(yǔ)法不解釋。這部分的功能是安裝ntp服務(wù),編輯ntp服務(wù)的配置文件/etc/chrony.conf,啟用ntp服務(wù)。ntp是時(shí)間服務(wù)器,chrony可以保持系統(tǒng)時(shí)鐘與時(shí)間服務(wù)器(ntp)同步,以保持時(shí)間準(zhǔn)確。# dnsif[[$ name = = $ host _ name]];然后yum安裝bind-yes-i-e ;13,14s//\/g ;\-e ;19s//\//g ;\-e ;37,42s///g ;\.-e/dnssec-enable yes/dnssec-enable no/g ;\ # dns安全擴(kuò)展,可以更改為no來(lái)關(guān)閉-e/dnssec-validation yes/dnssec-validation no/g ;/etc/named.conf # dns身份驗(yàn)證。您可以關(guān)閉systemctl start named。servicesystemctl啟用命名。servicefi #安裝bind軟件實(shí)現(xiàn)dns服務(wù)。沒(méi)有解釋shell的語(yǔ)法。這部分的功能是安裝dns服務(wù),編輯dns服務(wù)/etc/named.conf的配置文件,啟用dns服務(wù)。dns服務(wù)是域名系統(tǒng)服務(wù)。簡(jiǎn)單來(lái)說(shuō),就是把域名翻譯成ip標(biāo)簽:
語(yǔ)法沒(méi)做完
了解更多先下載iaas鏡像(先構(gòu)建paas平臺(tái))相關(guān)內(nèi)容請(qǐng)關(guān)注本站點(diǎn)。