openstack平台的搭建(先电版)

2019-04-13 12:27发布

前言:本段文字是笔记做完临时加载的。该平台是基于南京第55所研发的openstack平台搭建。 软件资料稍后会以云盘的形式发出, 一,材料准备 (1) 硬件: 两台双网卡服务器 一台命名为 controller IP地址: eth0: 192.168.100.10/24 eth1:192.168.200.10/24 一台命名为 compute IP地址: eth0: 192.168.100.20/24 eth1:192.168.200.20/24 软件: CentOS-6.5-x86_64-bin.iso XianDian-IaaS-v1.4.iso 二,环境搭建 (1):配置域名解析 全部节点下修改配置文件/etc/hosts 增加如下内容 192.168.100.10 controller 192.168.100.20 compute (2)配置环境 a,配置防火墙规则 # iptables -F //清除所有chains链(INPUT/OUTPUT/FORWARD)中所有的rule规则 # iptables -Z //清楚所有chains链(INPUT/OUTPUNT/FORWARD)中包及字节计数器 # iptables -X //清除用户自定义的chains链(INPUT/OUTPUT/FORWARD)中的rule规则 # service iptables save //保存修改的iptables规则 # service iptables stop //关闭防火墙 # chkconfig iptables off //开机不启动防火墙 b,配置Selinux 修改配置文件/etc/selinux/config SELINUX=permissive //表示系统会收到警告消息,但是不会受到限制,作为selinux的debug模式用处 ---------------------------------------------------------------------------------------------------------------------------- (3)配置yum源(无特殊说明,只配置controller) 1,清除本地所有yum配置文件(两个节点都执行) # rm -rf /etc/yum.repo.d/*
2,建立临时挂载的文件夹 # mkdir /linshi
3,将所准备的软件全部上传到/var
4,在/var文件夹下 挂载CentOS-6.5-x86_64-bin.iso # mount -o loop CentOS-6.5-x86_64-bin.iso /linshi
5,配置yum配置文件 local.repo # vi /etc/yum.repo.d/local.repo 内容初步修改为 [centos] name=centos baseurl=file:///linshi gpgcheck=0 enabled=1 6,建立yum源文件 # mkdir /opt/centos6.5
7,检测yum配置情况 # yum clean all # yum list
8,安装rsync # yum -y install rsync
9,拷贝yum文件到本地服务器 # rsync -apv /linshi/* /opt/centos6.5
10,取消挂载 # umount /linshi
11,挂载XianDian-IaaS-v1.4.iso [root@/var] # mount -o loop XianDian-IaaS-v1.4.iso /linshi
12,拷贝yum文件到本地服务器 # rsync -y /linshi/* /opt
13,取消挂载 # umount /linshi
14,重新修改local.repo(两个节点都执行) # vi /etc/yum.repo.d/local.repo controller: 内容修改为 [centos] name=centos baseurl=file:///opt/centos6.5 gpgcheck=0 enabled=1 [iaas] name=iaas baseurl=file:///opt/iaas-repo gpgcheck=0 enabled=1 ----------------------------------------- compute: 内容修改为 [centos] name=centos baseurl=file:///opt/centos6.5 gpgcheck=0 enabled=1 [iaas] name=iaas baseurl=file:///opt/iaas-repo gpgcheck=0 enabled=1
15.安装vftp服务器 # cd /opt/centos6.5/Packages # rpm -ivh vsftp(按TAB补全,因版本号不同) # vi /etc/vsftpd/vsftp.conf 末尾添加如下内容 anon_root=/opt
# service vsftpd start //开启vsftp服务 # chkconfig vsftpd on //开机自启 *此时可在能通信的任何一台电脑的浏览器查看/opt下的文件 ftp://192.168.100.10/
16,测试yum源(两个节点都执行) # yum clean all # yum list 确认无误后重启两台服务器 # reboot ---------------------------------------------------------------------------------------------------------------------------- (4)安装时钟服务(ntp)(两个节点都执行) controller&compute: # yum -y install ntp
controller: # vi /etc/ntpd.conf //修改配置文件 删除:server 0/1/2/3 添加:server 127.127.1.1 fudge 127.127.1.0 stratum 10 #serivce ntpd start//启动ntpd服务 #chkconfig ntpd on //开机启动ntpd服务
compute: # ntpdate controller //查看时间差 * 返回诸如这样的信息 6 Aug 09:48:16 ntpdate[5323]: step time server 192.168.100.10 offset 0.815595 sec # chkconfig ntpd on //开机自启 ---------------------------------------------------------------------------------------------------------------------------- (5)安装消息代理服务(只在controller节点安装) # yum -y install qpid-cpp-server # vi /etc/qpidd.conf 将末尾的auth=yes改为no # service qpidd start //开启qpidd服务 # chkconfig qpidd on //开机自启 ---------------------------------------------------------------------------------------------------------------------------- (6)安装xiandian(两个节点都执行) # yum -y install iaas-xiandian # yum -y install openstack-utils openstack-selinux # yum -y upgrade//更新软件包 # vi /etc/xiandian/openrc.sh 修改system Mysql keystone Glance Noce Neturon config *文章最后会粘贴需修改部分 其余暂未做改变 #yum -y install openssh-clients //安装ssh两个节点都执行 controller: # scp /etc/xiandian/operc.sh compute:/etc/xiandian/ * 务必检查compute下节点的配置文件 切记!切记!切记! ---------------------------------------------------------------------------------------------------------------------------- (7)执行脚本安装 *(请仔细分辨那个节点需执行那个脚本,且大部分可用TAB补全) *脚本均在/usr/local/bin/目录下 a,执行控制节点脚本 controller: # iaas-install-mysql.sh # iaas-install-keystone.sh # iaas-install-glance.sh
此时重启环境变量 # source /etckeystone/admin-openrc.sh
进入/opt/image/ # cd /opt/image/ # glance image-create --name "centos6.5" --disk-format qcow2 --container-format bare --is-public True --progress < centos(TAB补全)
b,安装nove controller: # iaas-install-nova-controller.sh compute # iaas-install-nova-compute.sh * 两个脚本均执行完再进行下一步
c,安装neutron controller: # iaas-install-neutron-controller.sh # iaas-install-neutron-controller-gre.sh computr: # iaas-install-neutron-compute.sh # iaas-install-neutron-compute-gre.sh
d安装dsahboard.sh(仅控制节点) # iaas-install-dashboard.sh # setsebool -P httpd_can_network_connect on ------------------------------------------------------------------------------------------------ 此刻环境配置已经全部完成,在浏览器输入 192.168.100.10/dashboard/即可访问web界面 用户名admin 密码000000
环境变量需修改部分
##--------------------system config--------------------## ##Controller Server Manager IP. example:x.x.x.x HOST_IP=192.168.100.10
##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 Node hostname. example:compute HOST_NAME_NODE=compute
##--------------------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