本文主要是提供一种新的思路。OpenStack的liberty版本比Juno更加容易部署,也使用了Linux bridge的方式,使得网络的问题进一步的减少。
那么本文提到的一种部署方式则是将OpenStack用命令行先在虚拟机上部署。然后可以导出为ova或者ovf格式的虚拟文件包。那么再另外的环境中只需要更改ip和配置文件,最后再更新数据库就可以了。
官方推荐controller和network节点放在一起,于是可以做2个虚拟文件。另一个是compute节点。基于的协议是ovf1.0可以导入virtualbox或者vmware的workstation或者vsphere(生产环境)
配置可以如下,Controller给2张或以上网卡,compute给1张或以上网卡(网卡桥接开混杂模式):
基本的步骤如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | CONTROLLER #改ip地址(eth0作为管理网络,eth1作为外网) vi / etc / network / interfaces #重启网卡 ifdown eth0 && ifup eth0 #更改host名字 vi / etc / hosts #更改NTP源(视具体环境而定) vi / etc / chrony / chrony .conf #编辑ip vi / etc / mysql / conf .d / mysqld_openstack .cnf #重启mysql数据库 service mysql restart #编辑ip vi / etc / mongodb .conf #重启mongobd service mongodb stop rm / var / lib / mongodb / journal / prealloc . * service mongodb start #编辑ip vi / etc / nova / nova .conf #同步数据库 su - s / bin / sh - c "nova-manage db sync" nova #编辑ip / etc / neutron / plugins / ml2 / linuxbridge_agent .ini(两个地方) #同步数据库 su - s / bin / sh - c " neutron - db - manage -- config - file / etc / neutron / neutron .conf \ -- config - file / etc / neutron / plugins / ml2 / ml2_conf .ini upgrade head" neutron (注意 vnc) |
1 2 3 4 5 6 7 8 9 10 11 12 | COMPUTE #编辑ip(eth0作为管理网络,eth1作为外网) vi / etc / network / interfaces #重启网卡 ifdown eth0 & amp ; & amp ; ifup eth0 ifdown eth1 & amp ; & amp ; ifup eth1 #更改host名字 vi / etc / hosts #编辑ip vi / etc / nova / nova .conf (两个地方 ) #编辑ip(只有一块网卡就不需要改了) vi / etc / neutron / plugins / ml2 / linuxbridge_agent .ini(两个地方) |
上述的步骤完全可以使用shell脚本和强大的文本编译工具sed和awk来搞定。最后甚至可以使用shell dialog设计对话框方便小白使用:
主菜单: 自动读取环境中网卡: 进行一系列的配置(省略接下去的几张配置图) 菜单一步步执行下来就会到最后一步install,等2-3分钟就安装完成了! log在根目录suc.txt和err.txt中。注:shell脚本暂不公开,但是这个方式是完全可以实现的,而且是多节点的方式,目前正在研究怎么在裸机上安装。
密码是admin/admin OpenStack中的密码都是官方文档上的默认密码 Liberty中的拓扑有点萌啊,这样就装好了!