centos65OpenStack_0">使用centos6.5搭建单节点OpenStack
条件:需要CentOS-6.5-x86_64-bin-DVD1、CentOS-6.5-x86_64-bin-DVD2、XianDian-IaaS-v1.4镜像
- 修改主机名
hostname controller
vim /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=controller
- 配置网络
##内部网络,我使用的是仅主机模式
[root@controller ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:0C:29:45:97:3D
TYPE=Ethernet
UUID=dab56baa-0af8-4811-9662-79118507986a
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=192.168.100.50
GATEWAY=192.168.100.1
NETMASK=255.255.255.0
##外部网络,使用NAT模式
[root@controller ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth1
HWADDR=00:0C:29:45:97:47
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=192.168.131.50
GATEWAY=192.168.131.2
NETMASK=255.255.255.0
DNS1=114.114.114.114
- 关闭防火墙
service iptables stop #关闭防火墙
chkconfig iptables off #设置开机不自启
- 关闭SELinux
setenforce 0 #临时关闭
sed -i '/SELINUX/{s/enforcing/permissive/}' /etc/selinux/config #永久关闭
-
配置yum源
mkdir /opt/centos #创建本地yum源目录
- 先卸载然后在挂载,执行如下图中命令(先挂载CentOS-6.5-x86_64-bin-DVD1)
cp -rvf /mnt/* /opt/centos/ ##复制有关文件到作为yum源目录下
umount /mnt ##取消挂载镜像
##重复以上操作挂载CentOS-6.5-x86_64-bin-DVD2
挂载XianDian-IaaS-v1.4
##挂载并复制
mount /dev/sr0 /mnt
cp -rvf /mnt/* /opt/
umount /mnt
yum clean all;yum list ##清除缓存并list
-
安装iaas-xiandian
yum install -y iaas-xiandian
-
修改全局配置文件
vim /etc/xiandian/openrc.sh
##修改以下内容
#--------------------system config--------------------##
#Controller Server Manager IP. example:x.x.x.x
HOST_IP=192.168.100.50
#Controller Server hostname. example:controller
HOST_NAME=controller
#Compute Node Manager IP. example:x.x.x.x
HOST_IP_NODE=192.168.100.50
#Compute Node hostname. example:compute
HOST_NAME_NODE=controller
#--------------------MySQL config---------------------##
#Password for MySQL root user . exmaple:000000
DB_PASS=000000
#--------------------Keystone config------------------##
#Password for Keystore admin user. exmaple:000000
ADMIN_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
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
#Password for Keystore nova user. exmaple:000000
#Password for Keystore nova user. exmaple:000000
NOVA_PASS=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=000000
#First Vlan ID in VLAN RANGE for VLAN Network. exmaple:101
#minvlan=
#Last Vlan ID in VLAN RANGE for VLAN Network. example:200
#maxvlan=
#--------------------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
#--------------------Swift config---------------------##
#Password for Keystore swift user. exmaple:000000
SWIFT_PASS=000000
OBJECT_DISK_1=sdb2
STORAGE_LOCAL_NET_IP_1=192.168.100.50
#The numbers of all the Swift Nodes. example:3
SWIFT_ZONE=1
BLOCK_DISK=sdb1
#--------------------Swift config---------------------##
#Password for Keystore swift user. exmaple:000000
SWIFT_PASS=000000
#The NO1. NODE Object Disk for Swift. example:md126p4. The 2nd will be OBJECT_DISK_2
OBJECT_DISK_1=sdb2
#The NO1. NODE IP for Swift Storage Network. example:x.x.x.x. The 2nd will be STORAGE_LOCAL_NET_IP_2
STORAGE_LOCAL_NET_IP_1=192.168.100.50
#The numbers of all the Swift Nodes. example:3
SWIFT_ZONE=1
#The number of this Swift Node. exmaple:1
SWIFT_NODE=1
- 安装Qpid服务
yum install -y qpid-cpp-server
vim /etc/qpidd.conf
##修改最后一行
auth=no
service qpidd start ##启动服务
chkconfig qpidd on ##开机自启
vim /etc/hosts
##在最后一行添加
192.168.100.50 controller
- 安装基本服务
###执行以下命令
iaas-install-mysql.sh
iaas-install-keystone.sh
iaas-install-glance.sh
iaas-install-nova-controller.sh
iaas-install-nova-compute.sh
iaas-install-neutron-controller.sh
iaas-install-neutron-compute
iaas-install-neutron-compute.sh
iaas-install-neutron-controller
iaas-install-neutron-controller-gre.sh
iaas-install-neutron-compute-gre.sh
iaas-install-dashboard.sh
- 登录192.168.100.50