controller

[root@controller ~]# hostnamectl set-hostname controller

yum install -y bash*

[root@controller ~]# logout

[root@controller ~]# vi /etc/hosts

[root@controller ~]# setenforce 0

[root@controller ~]# sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config

ssh -keygen

ssh-copy-id compute

[root@controller ~]# rm -rvf /etc/yum.repos.d/*

[root@controller ~]# vi /etc/yum.repos.d/http.repo

name baseurl enable=1 gpgcheck=0

yum clean all?

scp /etc/yum.repos.d/http.repo compute: /etc/repos.d

[root@compute ~]# hostnamectl set-hostname compute

[root@compute ~]# bash

[root@compute ~]# vi /etc/hosts

[root@compute ~]# setenforce 0

[root@compute ~]# sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config

[root@compute ~]# rm -rvf /etc/yum.repos.d/*

[root@compute ~]# vi /etc/yum.repos.d/ftp.repo

[root@compute ~]# umount /dev/vdb

[root@compute ~]# fdisk /dev/vdb

[root@controller ~]# yum install -y openstack-iaas vim

[root@controller ~]# vim /etc/openstack/openrc.sh

%s/# //

%s/PASS=/PASS=000000

[root@controller ~]# scp /etc/openstack/openrc.sh 172.100.0.25:/etc/openstack/openrc.sh

[root@controller ~]# iaas-pre-host.sh

reboot

[root@controller ~]# iaas-install-mysql.sh

vi /etc/my.conf

lower_case_table_names =1

innodb_buffer_pool_size = 4G

innodb_log_buffer_size = 64MB

#設置數(shù)據庫的redo log即redo日志大小

innodb_log_file_size = 256MB

#數(shù)據庫的redo log文件組即redo日志的個數(shù)配置

innodb_log_files_in_group = 2

[root@controller ~]# iaas-install-keystone.sh

source /etc/keystone/admin-openrc.sh?

openstack user create --password 000000 chinaskill

[root@controller ~]# iaas-install-glance.sh

curl -O http://10.18.4.100/cirros-0.3.4-x86_64-disk.img

[root@controller ~]# iaas-install-placement.sh

openstack image create --min-disk 10 --min-ram 1024 --file cirros-0.3.3-x86_64-disk.img? cirros

[root@controller ~]# iaas-install-placement.sh

[root@controller ~]# iaas-install-nova-controller.sh

cat /etc/nova/nova.conf |grep vif_plugging_is_fatal

vif_plugging_is_fatal=false

systemctl restart openstack-nova*

[root@controller ~]# iaas-install-neutron-controller.sh

[root@controller ~]# iaas-install-dashboard.sh

cat /etc/openstack-dashboard/local_settings |grep django

SESSION_ENGINE = 'django.contrib.sessions.backends.file'

systemctl restart httpd

[root@controller ~]# iaas-install-cinder-controller.sh

pvcreate /dev/vdb4

gextend cinder-volumes /dev/vdb4

vgdisplay

[root@controller ~]# iaas-install-swift-controller.sh

#通過命令行創(chuàng)建容器

openstack container create examcontainer

openstack container list

#下載鏡像

curl -O http://10.18.4.46/cirros-0.3.4-x86_64-disk.img

#swfit切片上傳cirros

#-S 上載不大于<size>(字節(jié))的段中的文件,然后創(chuàng)建一個“清單”文件,該文件將下載所有段雨涛,就像它是原始文件一樣笛园。

swift upload examcontainer -S 10485760 cirros-0.3.4-x86_64-disk.img

swift stat examcontainer cirros-0.3.4-x8664-disk.img

[root@controller ~]# iaas-install-trove.sh # network

[root@controller ~]# iaas-install-heat.sh

[root@controller ~]# iaas-install-ceilometer-controller.sh

[root@controller ~]# iaas-install-aodh.sh

[root@controller ~]# iaas-install-zun-controller.sh

[root@controller ~]# iaas-install-octavia.sh # sudo dhclient -v o-hm0 -cf /etc/dhcp/octavia

[root@controller ~]# iaas-install-manila-controller.sh

[root@controller ~]# iaas-install-cloudkitty.sh

[root@controller ~]# iaas-install-barbican.sh

[root@controller ~]# iaas-install-fwaas-and-vpnaas.sh

[root@compute ~]# yum install -y openstack-iaas vim

[root@compute ~]# iaas-pre-host.sh # umount /dev/vdb

[root@compute ~]# iaas-install-nova-compute.sh

[root@compute ~]# iaas-install-neutron-compute.sh

[root@compute ~]# iaas-install-cinder-compute.sh

[root@compute ~]# iaas-install-swift-compute.sh

[root@compute ~]# iaas-install-ceilometer-compute.sh

[root@compute ~]# iaas-install-zun-compute.sh

[root@compute ~]# iaas-install-manila-compute.sh

[root@controller ~]# yum install -y bash-completion

[root@controller ~]# source /usr/share/bash-completion/bash_completion

[root@controller ~]# openstack complete >> /root/.bashrc

[root@controller ~]# source /root/.bashrc

[root@controller ~]# file cirros-0.3.4-x86_64-disk.img # list

[root@controller ~]# glance image-create --name test-glance-image --disk-format qcow2 --container-format bare --min-ram 512 --min-disk 20 --tags test? --progress --file cirros-0.3.4-x86_64-disk.img # creat

[root@controller ~]# glance image-update IMAGE_ID --name glance-image2 --min-ram 1024 --min-disk 25 #

[root@controller ~]# glance image-list?

[root@controller ~]# glance image-show IMAGE_ID?

[root@controller ~]# glance image-delete IMAGE_ID

[root@controller ~]# openstack catalog list?

[root@controller ~]# openstack token issue?

[root@controller ~]# openstack domain create test-domain --descripti "Test Domain"

[root@controller ~]# openstack domain list?

[root@controller ~]# openstack domain show test-domain?

[root@controller ~]# openstack domain set test-domain --disable

[root@controller ~]# openstack domain delete test-domain?

[root@controller ~]# openstack project create test-project --domain test-domain --descripti "Test-Project"?

[root@controller ~]# openstack project set test-project --name test-project2 --domain test-domain --description "Test Project" --enable

[root@controller ~]# openstack user create test-user --domain test-domain --password 000000?

[root@controller ~]# openstack user set test-user --name test-user2 --domain test-domain --project test-project --project-domain test-domain? --password 000000 --enable

[root@controller ~]# openstack role create test-role?

[root@controller ~]# openstack role add test-role --project test-project --user test-user??

[root@controller ~]# export OS_PROJECT_NAME=admin?

[root@controller ~]# export OS_USERNAME=admin?

[root@controller ~]# export OS_PASSWORD=000000?

[root@controller ~]# openstack service create --name test-service SERVICE_TYPE?

[root@controller ~]# openstack endpoint create --region RegionOne SERVICE_TYPE public URL?

[root@controller ~]# openstack endpoint create --region RegionOne SERVICE_TYPE internal URL?

[root@controller ~]# openstack endpoint create --region RegionOne SERVICE_TYPE admin URL?

[root@controller ~]# openstack endpoint lis?

[root@controller ~]# openstack image create test-image --disk-format qcow2 --container-format bare --min-disk 20 --min-ram 512 --tag test-image --file cirros-0.3.4-x86_64-disk.img?

[root@controller ~]# openstack image set test-image --name test-image2 --min-disk 25 --min-ram 1024 --tag test-image2?

[root@controller ~]# openstack image list?

[root@controller ~]# openstack image show test-image2?

[root@controller ~]# openstack flavor create test-flavor --id 4 --ram 1024 --disk 30 --vcpus 1

[root@controller ~]# nova flavor-create test-nova-flavor 5 1024 30 1

[root@controller ~]# openstack network create test-net-wai --provider-network-type vlan --provider-physical-network provider --provider-segment 200 --external?

[root@controller ~]# openstack subnet create test-sub-wai --network test-net-wai --gateway 172.100.0.1 --subnet-range 172.100.0.0/24 --allocation-pool start=172.100.0.100,end=172.100.0.200 --dhcp?

[root@controller ~]# openstack network create test-net-nei --provider-network-type vlan --provider-physical-network provider --provider-segment 100

[root@controller ~]# openstack subnet create test-sub-nei --network test-net-nei --gateway 10.10.10.1 --subnet-range 10.10.10.0/24 --dhcp?

[root@controller ~]# openstack router create test-router?

[root@controller ~]# openstack router set test-router --external-gateway test-net-wai

[root@controller ~]# openstack router add subnet test-router test-sub-nei?

[root@controller ~]# openstack floating ip create test-net-wai --floating-ip-address 10.10.10.111?

[root@controller ~]# openstack server add floating ip test-vm 10.10.10.111

[root@controller ~]# openstack security group create test-security-group?

[root@controller ~]# openstack security group list?

[root@controller ~]# openstack security group show test-security-group?

[root@controller ~]# openstack security group rule list test-security-group

[root@controller ~]# openstack security group rule show RULE_ID?

[root@controller ~]# openstack security group rule delete RULE_ID?

[root@controller ~]# openstack security group rule create --protocol icmp --ingress test-security-group?

[root@controller ~]# openstack security group rule create --protocol tcp --ingress test-security-group?

[root@controller ~]# openstack security group rule create --protocol udp --ingress test-security-group?

[root@controller ~]# openstack security group rule create --protocol icmp --egress test-security-group?

[root@controller ~]# openstack security group rule create --protocol tcp --egress test-security-group

[root@controller ~]# openstack security group rule create --protocol udp --egress test-security-group?

[root@controller ~]# openstack server create test-vm --image test-image --flavor test-flavor --network test-net-nei?

[root@controller ~]# openstack server stop test-vm

[root@controller ~]# openstack server start test-vm

[root@controller ~]# openstack server reboot test-vm

[root@controller ~]# openstack server rebuild test-vm --image test-glance-image?

[root@controller ~]# openstack volume service lis?

[root@controller ~]# openstack volume type create lvm?

[root@controller ~]# openstack volume create test-volume --size 2 --type lvm?

[root@controller ~]# openstack server add volume test-vm test-volume

[root@controller ~]# openstack server remove volume test-vm test-volume?

[root@controller ~]# openstack volume set test-volume --size 3?

[root@controller ~]# cinder type-create lvm?

[root@controller ~]# cinder create --name test-cinder --volume-type lvm 2

Swift:

[root@controller ~]# swift stat?

[root@controller ~]# swift post test?

[root@controller ~]# swift stat test

[root@controller ~]# swift upload test -S 10000000 cirros-0.3.4-x86_64-disk.img # 上傳至容器并分片存儲

[root@controller ~]# swift stat test cirros-0.3.4-x86_64-disk.img # 查看存儲路徑

[root@controller ~]# swift list? test_segments # 查看路徑中的數(shù)據片

[root@controller ~]# openstack container create test-con # 創(chuàng)建容器

[root@controller ~]# openstack container list # 顯示容器

[root@controller ~]# openstack container show test-con # 查看容器詳細信息

[root@controller ~]# openstack object create test-con /root/cirros-0.3.4-x86_64-disk.img # 創(chuàng)建對象就是向容器中上傳文件

[root@controller ~]# openstack object list test-con # 查看容器中的所有對象信息

[root@controller ~]# openstack object show test-con? /root/cirros-0.3.4-x86_64-disk.img # 查看容器中對象的詳細信息

[root@controller ~]# openstack object save test-con /root/cirros-0.3.4-x86_64-disk.img --file /tmp/cirros-0.3.4-x86_64-disk.img # 下載容器中的對象到本地

[root@controller ~]# openstack container delete --recursive test-con # 強制刪除容器

[root@controller ~]# openstack object delete test-con? /root/cirros-0.3.4-x86_64-disk.img # 刪除容器里的對象

[root@controller ~]# openstack container delete test-con # 刪除容器,前提得刪除容器里的所有對象

Zun:

[root@controller ~]# openstack image create centos7.5 --public --container-format docker --disk-format raw --file CentOS7_1804.tar # 上傳鏡像

[root@controller ~]# openstack appcontainer run --name centos --image-driver glance --net network=test-net-nei centos7.5 # 創(chuàng)建容器

[root@controller ~]# openstack appcontainer delete --force centos7.5 # 刪除容器

Ceilometer:

[root@controller ~]# openstack alarm create --name cpu_hi \ # 告警名 cpu_hi

> --type gnocchi_resources_threshold \ # 類型

> --metric cpu_util \ # 測量值名稱 cpu_util

> --threshold 70.0 \ # 閥值 700

> --comparison-operator gt \ # 對比方式 大于

> --evaluation-periods 3 \ # 統(tǒng)計次數(shù) 3

> --alarm-action 'log://' \ # 轉為告警狀態(tài)提交的URL 'log://'

> --aggregation-method mean \ # 統(tǒng)計方式平均值

> --resource-type instance \ # 資源類型

> --resource-id INSTANCE_ID # 資源id

[root@controller ~]# openstack alarm update --enabled false cpu_hi # 告警信息不生效

[root@controller ~]# openstack alarm-history show ALARM_ID # 查看告警的歷史改變信息

[root@controller ~]# gnocchi resource-show INSTANCE_ID # 查看云主機所調用的資源

[root@controller ~]# gnocchi resource list # 查詢資源列表

[root@controller ~]# openstack alarm list # 查看告警信息

[root@controller ~]# openstack metric list # 查看測量值列表

[root@controller ~]# openstack alarm update delete cpu_hi # 刪除告警信息

Octavia:

[root@controller ~]# openstack image create amphora-x64-haproxy --disk-format qcow2 --container-format bare --private --tag amphora --file amphora-x64-haproxy.qcow2 # 上傳鏡像

[root@controller ~]# openstack loadbalancer create --name vip vip-network-id LB_MGMT_NET_ID # 創(chuàng)建負載均衡的ip服務瘟仿,

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
  • 序言:七十年代末箱锐,一起剝皮案震驚了整個濱河市,隨后出現(xiàn)的幾起案子劳较,更是在濱河造成了極大的恐慌驹止,老刑警劉巖,帶你破解...
    沈念sama閱讀 212,383評論 6 493
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件观蜗,死亡現(xiàn)場離奇詭異臊恋,居然都是意外死亡,警方通過查閱死者的電腦和手機嫂便,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 90,522評論 3 385
  • 文/潘曉璐 我一進店門捞镰,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人毙替,你說我怎么就攤上這事岸售。” “怎么了厂画?”我有些...
    開封第一講書人閱讀 157,852評論 0 348
  • 文/不壞的土叔 我叫張陵凸丸,是天一觀的道長。 經常有香客問我袱院,道長屎慢,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 56,621評論 1 284
  • 正文 為了忘掉前任忽洛,我火速辦了婚禮腻惠,結果婚禮上,老公的妹妹穿的比我還像新娘欲虚。我一直安慰自己集灌,他們只是感情好,可當我...
    茶點故事閱讀 65,741評論 6 386
  • 文/花漫 我一把揭開白布复哆。 她就那樣靜靜地躺著欣喧,像睡著了一般腌零。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上唆阿,一...
    開封第一講書人閱讀 49,929評論 1 290
  • 那天益涧,我揣著相機與錄音,去河邊找鬼驯鳖。 笑死闲询,一個胖子當著我的面吹牛,可吹牛的內容都是我干的臼隔。 我是一名探鬼主播嘹裂,決...
    沈念sama閱讀 39,076評論 3 410
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼摔握!你這毒婦竟也來了寄狼?” 一聲冷哼從身側響起,我...
    開封第一講書人閱讀 37,803評論 0 268
  • 序言:老撾萬榮一對情侶失蹤氨淌,失蹤者是張志新(化名)和其女友劉穎泊愧,沒想到半個月后,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體盛正,經...
    沈念sama閱讀 44,265評論 1 303
  • 正文 獨居荒郊野嶺守林人離奇死亡删咱,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內容為張勛視角 年9月15日...
    茶點故事閱讀 36,582評論 2 327
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了豪筝。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片痰滋。...
    茶點故事閱讀 38,716評論 1 341
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖续崖,靈堂內的尸體忽然破棺而出敲街,到底是詐尸還是另有隱情,我是刑警寧澤严望,帶...
    沈念sama閱讀 34,395評論 4 333
  • 正文 年R本政府宣布多艇,位于F島的核電站,受9級特大地震影響像吻,放射性物質發(fā)生泄漏峻黍。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 40,039評論 3 316
  • 文/蒙蒙 一拨匆、第九天 我趴在偏房一處隱蔽的房頂上張望姆涩。 院中可真熱鬧,春花似錦惭每、人聲如沸阵面。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,798評論 0 21
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽样刷。三九已至,卻和暖如春览爵,著一層夾襖步出監(jiān)牢的瞬間置鼻,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 32,027評論 1 266
  • 我被黑心中介騙來泰國打工蜓竹, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留箕母,地道東北人。 一個月前我還...
    沈念sama閱讀 46,488評論 2 361
  • 正文 我出身青樓俱济,卻偏偏與公主長得像嘶是,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子蛛碌,可洞房花燭夜當晚...
    茶點故事閱讀 43,612評論 2 350

推薦閱讀更多精彩內容