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

#设置数据库的redo log即redo日志大小

innodb_log_file_size = 256MB

#数据库的redo log文件组即redo日志的个数配置

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

#通过命令行创建容器

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>(字节)的段中的文件,然后创建一个“清单”文件,该文件将下载所有段,就像它是原始文件一样。

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 # 查看路径中的数据片

[root@controller ~]# openstack container create test-con # 创建容器

[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 # 创建对象就是向容器中上传文件

[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 # 创建容器

[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 \ # 统计次数 3

> --alarm-action 'log://' \ # 转为告警状态提交的URL 'log://'

> --aggregation-method mean \ # 统计方式平均值

> --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 # 创建负载均衡的ip服务,

最后编辑于
?著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 214,172评论 6 493
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 91,346评论 3 389
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事?!?“怎么了?”我有些...
    开封第一讲书人阅读 159,788评论 0 349
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 57,299评论 1 288
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 66,409评论 6 386
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 50,467评论 1 292
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,476评论 3 412
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,262评论 0 269
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,699评论 1 307
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 36,994评论 2 328
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,167评论 1 343
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,827评论 4 337
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,499评论 3 322
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,149评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,387评论 1 267
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,028评论 2 365
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,055评论 2 352

推荐阅读更多精彩内容