搭建OpenStack平台

一 controller节点和compute节点两个节点都得配置

 1 改主机名

# 改主机名
[root@controller ~]# hostnamectl set-hostname controller
[root@controller ~]# hostname


# 改主机名
[root@compute ~]# hostnamectl set-hostname compute
[root@compute ~]# hostname

 2  域名

#  配置域名解析

[root@controller ~]# vi /etc/hosts
192.168.200.12 controller
192.168.200.21 compute



#  配置域名解析
[root@controller ~]# vi /etc/hosts
192.168.200.12 controller
192.168.200.21 compute

 3   关闭防火墙


systemctl stop firewalld #关闭防火墙

systemctl disable firewalld #开机禁用防火墙

  controller节点配置

 1  下载centos和xiandian包

进入下面的网址看怎么传输

怎么使用xftp 7文件传输

[root@controller ~]# mkdir /opt/{centos,openstack}
[root@controller ~]# mount -o loop /root/CentOS-7-x86_64-DVD-2207-02.iso /mnt/
mount: /dev/loop0 写保护,将以只读方式挂载
[root@controller ~]# cp -r /mnt/* /opt/centos/
[root@controller ~]# umount /mnt/
[root@controller ~]# mount -o loop /root/XianDian-IaaS-v1.4.iso /mnt/
mount: /dev/loop0 写保护,将以只读方式挂载
[root@controller ~]# cp -r /mnt/* /opt/openstack/
[root@controller ~]# umount /mnt/

 2  yum源文件处理

[root@controller ~]# mv /etc/yum.repos.d/* /media/
[root@controller ~]# vi /etc/yum.repos.d/local.repo
[centos]
name=centos
baseurl=file:///opt/centos
gpgcheck=0
enabled=1
[openstack]
name=openstack
baseurl=file:///opt/openstack/iaas-repo
gpgcheck=0
enabled=1
[root@controller ~]# yum clean all && yum repolist

 3  配置vsftpd

[root@controller ~]# yum install -y vsftpd
[root@controller ~]# echo "anon_root=/opt" >> /etc/vsftpd/vsftpd.conf
[root@controller ~]# systemctl restart vsftpd
[root@controller ~]# systemctl enable vsftpd

二 compute节点配置

1  yum源

[root@compute ~]# mv /etc/yum.repos.d/* /media/
[root@compute ~]# vi /etc/yum.repos.d/ftp.repo
[centos]
name=centos
baseurl=ftp://controller/centos
gpgcheck=0
enabled=1
[openstack]
name=openstack
baseurl=ftp://controller/openstack/iaas-repo 
gpgcheck=0
enabled=1
[root@controller ~]# yum clean all && yum repolist

三 controller节点和compute节点配置

controller和compute两个节点都运行

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

 四 comtroller节点配置

脚本

[root@controller ~]# vi /etc/xiandian/openrc.sh

 输入下面的命令删除‘#’这个符号

:%s/^.\{1\}//


#--------------------system Config--------------------##
#Controller Server Manager IP. example:x.x.x.x
HOST_IP=192.168.200.10       #controller节点的IP

#Controller Server hostname. example:controller
HOST_NAME=controller

#Compute Node Manager IP. example:x.x.x.x
HOST_IP_NODE=192.168.200.20      #compute节点的IP

#Compute Node hostname. example:compute
HOST_NAME_NODE=compute

#--------------------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

#External Network Interface. example:eth1
INTERFACE_NAME=eth1

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

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

#--------------------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=sdb1

#--------------------Trove Config--------------------##
#Password for Mysql Trove User. exmaple:000000
TROVE_DBPASS=000000

#Password for Keystore Trove User. exmaple:000000
TROVE_PASS=000000

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

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

#The NODE IP for Swift Storage Network. example:x.x.x.x.
STORAGE_LOCAL_NET_IP=192.168.200.20     #compute节点的IP

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

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

#--------------------Ceilometer Config----------------##
#Password for Mysql 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

 四 compute节点配置

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

 五 controller节点配置

脚本

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

[root@controller ~]# reboot    #执行完脚本要重启

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

[root@controller ~]# source /etc/keystone/admin-openrc.sh         #使环境生效

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

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

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

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

 五 compute节点配置

脚本

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

[root@controller ~]# reboot    #执行完脚本要重启

到这里就可以打开网站了,但是会报错。

 只供参考,参考,本人还在学习中,以上只能打开云计算基础架构服务平台网站,其他问题还在学习中。希望对你有所帮助吧

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值