# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.40.128
netmask 255.255.255.0
gateway 192.168.40.2
#控制节点暂不设eth1
并重启 service networking restart
(2)安装mysql数据库和消息队列rabbitmq
apt-get install -y mysql-server python-mysqldb
sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mysql/my.cnf
service mysql restart
apt-get install -y rabbitmq-server
(3)安装ntp时间服务器 这个非常重要 用于组件之间的实时同步
apt-get install -y ntp
(4)更改数据库密码
修改MySQL密码为passwd:
[iyunv@stonex ~]# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
...... 省略了一些行
mysql> select user,host,password from mysql.user;
查询用户的密码,都为空,用下面的命令设置root的密码为password
mysql> set password for root@localhost=password('password');
mysql> exit
(5)在mysql中添加各个组件的数据库并授权
mysql -u root -p
#Keystone
CREATE DATABASE keystone;
GRANT ALL PRIVILEGES ON keystone.* TO 'keystoneUser'@'%' IDENTIFIED BY 'keystonePass';
#Glance
CREATE DATABASE glance;
GRANT ALL PRIVILEGES ON glance.* TO 'glanceUser'@'%' IDENTIFIED BY 'glancePass';
#Quantum
CREATE DATABASE quantum;
GRANT ALL PRIVILEGES ON quantum.* TO 'quantumUser'@'%' IDENTIFIED BY 'quantumPass';
#Nova
CREATE DATABASE nova;
GRANT ALL PRIVILEGES ON nova.* TO 'novaUser'@'%' IDENTIFIED BY 'novaPass';
#Cinder
CREATE DATABASE cinder;
GRANT ALL PRIVILEGES ON cinder.* TO 'cinderUser'@'%' IDENTIFIED BY 'cinderPass';
quit;
(6)安装vlan和管理网桥的工具
apt-get install -y vlan bridge-utils
sed -i 's/#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/' /etc/sysctl.conf
# To save you from rebooting, perform the following 开启路由转发功能
sysctl net.ipv4.ip_forward=1
(7)安装keystone (前六步可以说是准备工作)
service keystone restart
keystone-manage db_sync
下面要开始创建keystone的user、tenant、service和role,这里直接借用源地址作者提供的两个脚本。
#Modify the **HOST_IP** and **EXT_HOST_IP** variables before executing the scripts
wget https://raw.github.com/mseknibilel/OpenStack-Grizzly-Install-Guide/OVS_MultiNode/KeystoneScripts/keystone_basic.sh
wget https://raw.github.com/mseknibilel/OpenStack-Grizzly-Install-Guide/OVS_MultiNode/KeystoneScripts/keystone_endpoints_basic.sh
如果是离线安装,脚本事先要下好
dd if=/dev/zero of=cinder-volumes bs=1 count=0 seek=2G
losetup /dev/loop2 cinder-volumes
fdisk /dev/loop2
#Type in the followings:
n
p
1
ENTER
ENTER
t
8e
w
Proceed to create the physical volume then the volume group:
pvcreate /dev/loop2
vgcreate cinder-volumes /dev/loop2
这种方法在重启后会失效 解决方法
https://github.com/mseknibilel/OpenStack-Folsom-Install-guide/blob/master/Tricks%26Ideas/load_volume_group_after_system_reboot.rst
重启
cd /etc/init.d/; for i in $( ls cinder-* ); do sudo service $i restart; done
(12)安装horizon
service apache2 restart; service memcached restart
通过
Check OpenStack Dashboard at http://192.168.40.128/horizon. We can login with the admin / admin_pass访问