双节点部署open stack
一.基础环境配置
controller节点
[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eno16777736
compute节点
修改主机名
controller节点
[root@localhost ~]# hostnamectl set-hostname controller
[root@localhost ~]# bash
[root@controller ~]#
compute节点
[root@localhost ~]# hostnamectl set-hostname compute
[root@localhost ~]# bash
[root@compute ~]#
上传基础镜像
controller节点
配置yum源
创建目录
[root@controller ~]# mkidr /opt/centos
-bash: mkidr: command not found
[root@controller ~]# mkdir /opt/centos
[root@controller ~]# mkdir /opt/iaas
挂载yum源
mount CentOS-7-x86_64-DVD-1511.iso /opt/centos/
mount: /dev/loop0 is write-protected, mounting read-only
[root@controller ~]# mount XianDian-IaaS-v2.2.iso /opt/iaas/
mount: /dev/loop1 is write-protected, mounting read-only
删除文件目录
[root@controller ~]# rm -rf /etc/yum.repos.d/*
进入添加
vi /etc/yum.repos.d/local.repo
查看是否成功
conpute节点
[root@compute ~]# rm -rf /etc/yum.repos.d/*
[root@compute ~]# vi /etc/yum.repos.d/ftp.repo
[root@compute ~]# vi /etc/yum.repos.d/ftp.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
配置防火墙
[root@controller ~]# yum install -y vsftpd
[root@controller ~]# vi /etc/vsftpd/vsftpd.conf
anon_root=/opt ##中添加一行
[root@controller ~]# systemctl restart vsftpd
[root@controller ~]# setenforce 0
进入 /etc/selinux/config 目录
换成disabled
[root@controller ~]# systemctl stop firewalld
[root@controller ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
[root@controller ~]# iptables -F
[root@controller ~]# iptables -X
[root@controller ~]# iptables -Z
[root@controller ~]# iptables-save
compute节点
[root@compute ~]# systemctl stop firewalld
[root@compute ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
[root@compute ~]# setenforce 0
[root@compute ~]# vi /etc/selinux/config
[root@compute ~]# iptables -F
[root@compute ~]# iptables -X
[root@compute ~]# iptables -Z
[root@compute ~]# iptables-save
查看
[root@compute ~]# yum repolist
安装iaas-xiandian服务
[root@controller ~]# yum install iaas-xiandian -y
[root@compute ~]# yum install iaas-xiandian -y
修改配置文件后操作
# 第一条,将文件中的##换成@
# 第二条,将文件中的#去掉
# 第三条,将文件中的@换回##
sed -i s/##/@/g /etc/xiandian/openrc.sh
sed -i s/#//g /etc/xiandian/openrc.sh
sed -i s/@/##/g /etc/xiandian/openrc.sh
修改 /etc/xiandian/openrc.sh
[root@controller ~]#vi /etc/xiandian/openrc.sh
HOST_IP=192.168.200.110
HOST_NAME=controller
HOST_IP_NODE=192.168.100.20
HOST_NAME_NODE=compute
RABBIT_USER=openstack
RABBIT_PASS=000000
DB_PASS=000000
DOMAIN_NAME=demo
ADMIN_PASS=000000
DEMO_PASS=000000
KEYSTONE_DBPASS=000000
GLANCE_DBPASS=000000
GLANCE_PASS=000000
NOVA_DBPASS=000000
NOVA_PASS=000000
NEUTRON_DBPASS=000000
NEUTRON_PASS=000000
METADATA_SECRET=000000
INTERFACE_NAME=eno33554960
minvlan=
maxvlan=
CINDER_DBPASS=000000
CINDER_PASS=000000
# 根据自己硬盘分区情况
BLOCK_DISK=sdb1
TROVE_DBPASS=000000
TROVE_PASS=000000
SWIFT_PASS=000000
# 根据自己硬盘分区情况
OBJECT_DISK=sdb2
STORAGE_LOCAL_NET_IP=192.168.200.120
HEAT_DBPASS=
HEAT_PASS=
CEILOMETER_DBPASS=
CEILOMETER_PASS=
AODH_DBPASS=
AODH_PASS=
跑脚本
1.安装基础服务
# 两个节点都跑
[root@localhost ~]# iaas-pre-host.sh
2.安装mysql数据库
[root@controller~]# iaas-install-mysql.sh
3.安装keystone 认证服务
[root@controller ~]# iaas-install-keystone.sh
4.安装Glance镜像服务
[root@controller ~]# iaas-install-glance.sh
5.安装Nova 计算服务
[root@controller ~]# iaas-install-nova-controller.sh
[root@compute~]# iaas-install-nova-compute.sh
6安装Neutron 网络服务
[root@controller ~]# iaas-install-neutron-controller.sh
[root@controller ~]# iaas-install-neutron-controller-gre.sh
[root@compute~]# iaas-install-neutron-compute.sh
[root@compute~]# iaas-install-neutron-compute-gre.sh
7.安装Dashboard 服务
[root@controller ~]# iaas-install-dashboard.sh
8.安装 Cinder 块存储服务
[root@controller ~]# iaas-install-cinder-controller.sh
[root@compute~]# iaas-install-cinder-compute.sh
9.安装Swift 对象存储服务
[root@controller ~]# iaas-install-swift-controller.sh
[root@compute ~]# iaas-install-swift-compute.sh
10.访问 Dashboard 服务
打开浏览器,访问 http://192.168.200.110/dashborad 地址,输入环境变量文件找那个填写的密码,域为 德莫,用户名为admin,密码为000000,然后单击 “链接”按钮。