使用VMware Workstation搭建云计算平台(前期准备)

1、两台虚拟机(controllercompute

2、每台虚拟机两个网卡(网络适配器),网络适配器1为仅主机模式,网络适配器2为NAT模式

3、虚拟网络编辑器:ip地址设置

     VM1  仅主机模式 192.168.100.0

     VM8  NAT模式     192.168.200.0  

4、网卡设置

controller:vi  /etc/sysconfig/network-scripts/ifcfg-ens33

ens33:

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens33
UUID=9ea9195b-dc93-425f-83c4-e686eeca4aad
DEVICE=ens33
ONBOOT=yes
IPADDR=192.168.100.10
PREFIX=24
GATEWAY=192.168.100.1

ens34:   vi  /etc/sysconfig/network-scripts/ifcfg-ens33

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens33
UUID=9ea9195b-dc93-425f-83c4-e686eeca4aad
DEVICE=ens33
ONBOOT=yes
IPADDR=192.168.200.10
PREFIX=24
GATEWAY=192.168.200.1

compute:

ens33:     vi  /etc/sysconfig/network-scripts/ifcfg-ens33

TYPE=Ethernet
PROXY_METHOD=none

BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens33
UUID=9ea9195b-dc93-425f-83c4-e686eeca4aad
DEVICE=ens33
ONBOOT=yes
IPADDR=192.168.100.20
PREFIX=24
GATEWAY=192.168.100.1

ens34:    vi  /etc/sysconfig/network-scripts/ifcfg-ens34

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens33
UUID=9ea9195b-dc93-425f-83c4-e686eeca4aad
DEVICE=ens33
ONBOOT=yes
IPADDR=192.168.200.20
PREFIX=24
GATEWAY=192.168.200.1

5、连接CRT

6、修改主机名

     controller/compute

     hostnamectl set-hostname controller/compute

7、关闭防火墙

     controller/compute

     systemctl stop firewalld

     systemctl disable firewalld

     setenforce 0

     vi /etc/selinux/config

     # SELINUX=permissive

     检查防火墙是否关闭(getenforce) 出现permissive,成功

     iptables -F

     iptables -X

     iptables -Z

     iptables-save

8、配置yum源

 controlller/compute:

     cd /opt

     mkdir centos iaas

     cd   /etc/yum.repos.d

     ls(如果有东西,全部删除掉:cd  /etc     rm  -rf  yum.repos.d    mkdir  yum.repos.d)

     controller:

     vi local.repo(同时CRT克隆controller会话)

     vi local前,克隆controller上执行挂载两个镜像

     mount -o loop   /root/CentOS-7-x86_64-DVD-1804.iso    /opt/centos/

     mount -o loop   /root/chinaskills_cloud_iaas.iso    /opt/iaas/

     vi local.repo内容:

 [centos]
name=centos
baseurl=file:///opt/centos
gpgcheck=0
enabled=1
[iaas]
name=iaas
baseurl=file:///opt/iaas/iaas-repo
gpgcheck=0
enabled=1           
                                                                          

controlller:

yum  install  -y  vsftpd

vi  /etc/vsftpd/vsftpd.conf

# Example config file /etc/vsftpd/vsftpd.conf
anon_root=/opt/     (添加的内容)
#
# The default compiled in settings are fairly paranoid. This sample file

systemctl  start  vsftpd

systemctl  enable  vsftpd

compute:

vi   local.repo

[centos]
name=centos
baseurl=ftp://192.168.100.10/centos
gpgcheck=0
enabled=1
[iaas]
name=iaas
baseurl=ftp://192.168.100.10/iaas/iaas-repo
gpgcheck=0
enabled=1

9、清除缓存,验证yum源是否成功

controller/compute:

yum  clean  all

yum  repolist

centos                                   centos                                  3971
iaas                                        iaas                                      3232
repolist: 7203                                                                                           (看到这个即成功)

10、编辑环境变量

controller/compute:

yum  install  -y  iaas-xiandian

controller:

vi  /etc/xiandian/opernrc.sh

##--------------------system Config--------------------##
##Controller Server Manager IP. example:x.x.x.x
HOST_IP=192.168.100.10

##Controller HOST Password. example:000000 
HOST_PASS=000000

##Controller Server hostname. example:controller
HOST_NAME=controller

##Compute Node Manager IP. example:x.x.x.x
HOST_IP_NODE=192.168.100.20

##Compute HOST Password. example:000000 
HOST_PASS_NODE=000000

##Compute Node hostname. example:compute
HOST_NAME_NODE=compute

##--------------------Chrony Config-------------------##
##Controller network segment IP.  example:x.x.0.0/16(x.x.x.0/24)
network_segment_IP=192.168.100.0/24

##--------------------Rabbit Config ------------------##
##user for rabbit. example:openstack
RABBIT_USER=openstack

##Password for rabbit user .example:000000
RABBIT_PASS=000000

##--------------------MySQL Config---------------------##
##Password for MySQL root user . exmaple:000000
DB_PASS=000000

##--------------------Keystone Config------------------##
##Password for Keystore admin user. exmaple:000000
DOMAIN_NAME=demo
ADMIN_PASS=000000
DEMO_PASS=000000

##Password for Mysql keystore user. exmaple:000000
KEYSTONE_DBPASS=000000

##--------------------Glance Config--------------------##
##Password for Mysql glance user. exmaple:000000
GLANCE_DBPASS=000000

##Password for Keystore glance user. exmaple:000000
GLANCE_PASS=000000

##--------------------Nova Config----------------------##
##Password for Mysql nova user. exmaple:000000
NOVA_DBPASS=000000

##Password for Keystore nova user. exmaple:000000
NOVA_PASS=000000

##--------------------Neturon Config-------------------##
##Password for Mysql neutron user. exmaple:000000
NEUTRON_DBPASS=000000

##Password for Keystore neutron user. exmaple:000000
NEUTRON_PASS=000000

##metadata secret for neutron. exmaple:000000
METADATA_SECRET=000000

##Tunnel Network Interface. example:x.x.x.x
INTERFACE_IP=192.168.100.10

##External Network Interface. example:eth1
INTERFACE_NAME=ens34

##External Network The Physical Adapter. example:provider
Physical_NAME=provider

##First Vlan ID in VLAN RANGE for VLAN Network. exmaple:101
minvlan=1

##Last Vlan ID in VLAN RANGE for VLAN Network. example:200
maxvlan=201

##--------------------Cinder Config--------------------##
##Password for Mysql cinder user. exmaple:000000
CINDER_DBPASS=000000

##Password for Keystore cinder user. exmaple:000000
CINDER_PASS=000000

##Cinder Block Disk. example:md126p3
#BLOCK_DISK=

##--------------------Swift Config---------------------##
##Password for Keystore swift user. exmaple:000000
SWIFT_PASS=000000

##The NODE Object Disk for Swift. example:md126p4.
#OBJECT_DISK=

##The NODE IP for Swift Storage Network. example:x.x.x.x.
STORAGE_LOCAL_NET_IP=192.168.100.20

##--------------------Heat Config----------------------##
##Password for Mysql heat user. exmaple:000000
HEAT_DBPASS=000000

##Password for Keystore heat user. exmaple:000000
HEAT_PASS=000000

##--------------------Zun Config-----------------------##
##Password for Mysql Zun user. exmaple:000000
ZUN_DBPASS=000000

##Password for Keystore Zun user. exmaple:000000
ZUN_PASS=000000

##Password for Mysql Kuryr user. exmaple:000000
KURYR_DBPASS=000000

##Password for Keystore Kuryr user. exmaple:000000
KURYR_PASS=000000

##--------------------Ceilometer Config----------------##
##Password for Gnocchi ceilometer user. exmaple:000000
CEILOMETER_DBPASS=000000

##Password for Keystore ceilometer user. exmaple:000000
CEILOMETER_PASS=000000

##--------------------AODH Config----------------##
##Password for Mysql AODH user. exmaple:000000
AODH_DBPASS=000000

##Password for Keystore AODH user. exmaple:000000
AODH_PASS=000000

##--------------------Barbican Config----------------##
##Password for Mysql Barbican user. exmaple:000000
BARBICAN_DBPASS=000000

##Password for Keystore Barbican user. exmaple:000000
BARBICAN_PASS=000000

scp  /etc/xiandian/openrc.sh  root@compute:/etc/xiandian/openrc.sh

compute:

vi  /etc/xiandian/openrc.sh

##--------------------system Config--------------------##
##Controller Server Manager IP. example:x.x.x.x
HOST_IP=192.168.100.10

##Controller HOST Password. example:000000 
HOST_PASS=000000

##Controller Server hostname. example:controller
HOST_NAME=controller

##Compute Node Manager IP. example:x.x.x.x
HOST_IP_NODE=192.168.100.20

##Compute HOST Password. example:000000 
HOST_PASS_NODE=000000

##Compute Node hostname. example:compute
HOST_NAME_NODE=compute

##--------------------Chrony Config-------------------##
##Controller network segment IP.  example:x.x.0.0/16(x.x.x.0/24)
network_segment_IP=192.168.100.0/24

##--------------------Rabbit Config ------------------##
##user for rabbit. example:openstack
RABBIT_USER=openstack

##Password for rabbit user .example:000000
RABBIT_PASS=000000

##--------------------MySQL Config---------------------##
##Password for MySQL root user . exmaple:000000
DB_PASS=000000

##--------------------Keystone Config------------------##
##Password for Keystore admin user. exmaple:000000
DOMAIN_NAME=demo
ADMIN_PASS=000000
DEMO_PASS=000000

##Password for Mysql keystore user. exmaple:000000
KEYSTONE_DBPASS=000000

##--------------------Glance Config--------------------##
##Password for Mysql glance user. exmaple:000000
GLANCE_DBPASS=000000

##Password for Keystore glance user. exmaple:000000
GLANCE_PASS=000000

##--------------------Nova Config----------------------##
##Password for Mysql nova user. exmaple:000000
NOVA_DBPASS=000000

##Password for Keystore nova user. exmaple:000000
NOVA_PASS=000000

##--------------------Neturon Config-------------------##
##Password for Mysql neutron user. exmaple:000000
NEUTRON_DBPASS=000000

##Password for Keystore neutron user. exmaple:000000
NEUTRON_PASS=000000

##metadata secret for neutron. exmaple:000000
METADATA_SECRET=000000

##Tunnel Network Interface. example:x.x.x.x
INTERFACE_IP=192.168.100.20

##External Network Interface. example:eth1
INTERFACE_NAME=ens34

##External Network The Physical Adapter. example:provider
Physical_NAME=provider

##First Vlan ID in VLAN RANGE for VLAN Network. exmaple:101
minvlan=1

##Last Vlan ID in VLAN RANGE for VLAN Network. example:200
maxvlan=201

##--------------------Cinder Config--------------------##
##Password for Mysql cinder user. exmaple:000000
CINDER_DBPASS=000000

##Password for Keystore cinder user. exmaple:000000
CINDER_PASS=000000

##Cinder Block Disk. example:md126p3
#BLOCK_DISK=

##--------------------Swift Config---------------------##
##Password for Keystore swift user. exmaple:000000
SWIFT_PASS=000000

##The NODE Object Disk for Swift. example:md126p4.
#OBJECT_DISK=

##The NODE IP for Swift Storage Network. example:x.x.x.x.
STORAGE_LOCAL_NET_IP=192.168.100.20

##--------------------Heat Config----------------------##
##Password for Mysql heat user. exmaple:000000
HEAT_DBPASS=000000

##Password for Keystore heat user. exmaple:000000
HEAT_PASS=000000

##--------------------Zun Config-----------------------##
##Password for Mysql Zun user. exmaple:000000
ZUN_DBPASS=000000

##Password for Keystore Zun user. exmaple:000000
ZUN_PASS=000000

##Password for Mysql Kuryr user. exmaple:000000
KURYR_DBPASS=000000

##Password for Keystore Kuryr user. exmaple:000000
KURYR_PASS=000000

##--------------------Ceilometer Config----------------##
##Password for Gnocchi ceilometer user. exmaple:000000
CEILOMETER_DBPASS=000000

##Password for Keystore ceilometer user. exmaple:000000
CEILOMETER_PASS=000000

##--------------------AODH Config----------------##
##Password for Mysql AODH user. exmaple:000000
AODH_DBPASS=000000

##Password for Keystore AODH user. exmaple:000000
AODH_PASS=000000

##--------------------Barbican Config----------------##
##Password for Mysql Barbican user. exmaple:000000
BARBICAN_DBPASS=000000

##Password for Keystore Barbican user. exmaple:000000
BARBICAN_PASS=000000

11、跑脚本

controller/compute:

cd /usr/local/bin

controller:

iaas-pre-host.sh

iaas-install-mysql.sh

iaas-install-keystone.sh

iaas-install-glance.sh 

iaas-install-nova-controller.sh

iaas-install-neutron-controller.sh

compute:

iaas-pre-host.sh

iaas-install-nova-compute.sh

iaas-install-neutron-compute.sh

controller:

iaas-install-dashboard.sh

12、谷歌浏览器

http://192.168.100.10/dashboard

  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值