硬件
VMware workstation虚拟机
Ubuntu14.04操作系统
虚拟机网络规划
管理网络:
eth0, 桥接模式
10.0.0.0/24
外部网络:
eth1, nat模式(需要关闭该网络中已有的dhcp服务)
192.168.10.0/24
数据网络:
eth2, lan模式
172.16.100.0/24
节点网卡配置
controller:
#管理网络
auto eth0
iface eth0 inet static
address 10.0.0.200
netmask 255.255.255.0
gateway 10.0.0.1
network:
#管理网络
auto eth0
iface eth0 inet static
address 10.0.0.201
netmask 255.255.255.0
gateway 10.0.0.1
#外部网络
auto eth1
iface eth1 inet manual
up ip link set dev $IFACE up
down ip link set dev $IFACE down
#数据网络
auto eth2
iface eth2 inet static
address 172.16.100.201
netmask 255.255.255.0
compute1:
#管理网络
auto eth0
iface eth0 inet static
address 10.0.0.211
netmask 255.255.255.0
gateway 10.0.0.1
#外部网络
auto eth1
iface eth1 inet manual
up ip link set dev $IFACE up
down ip link set dev $IFACE down
#数据网络
auto eth2
iface eth2 inet static
address 172.16.100.211
netmask 255.255.255.0
集群拓扑图
初始化apt-get源
所有节点初始化
root@:~# apt-get update
root@:~# apt-get remove apparmor -y
root@:~# apt-get install lrzsz dstat iftop iotop tofrodos dos2unix smartmontools numactl sysstat fio mcelog -y
root@:~# sed -i "s@ENABLED="false"@ENABLED="true"@g" /etc/default/sysstat && /etc/init.d/sysstat restart
root@:~# echo "deb http://ubuntu-cloud.archive.canonical.com/ubuntu" "trusty-updates/kilo main" > /etc/apt/sources.list.d/cloudarchive-kilo.list
root@:~# apt-get update
root@:~# apt-get dist-upgrade
root@:~# apt-get install ubuntu-cloud-keyring
配置hosts
所有节点初始化
10.0.0.200 controller
10.0.0.201 network
10.0.0.211 compute1
NTP
root@:~# apt-get install ntp
部署MySQL
部署在controller节点
root@controller:~# apt-get install mariadb-server python-mysqldb
root@controller:~# vi /etc/mysql/my.cnf
[mysqld]
bind-address = 10.0.0.100 #默认为管理网络ip,防止其他网络访问到核心数据库
default-storage-engine = innodb
innodb_file_per_table
collation-server = utf8_general_ci
init-connect = 'SET NAMES utf8'
character-set-server = utf8
root@controller:~# service mysql restart
部署RabbitMQ
部署在controller节点
root@controller:~# apt-get install rabbitmq-server
root@controller:~# rabbitmqctl delete_user guest
Deleting user "guest" ...
root@controller:~# rabbitmqctl add_user openstack openstack
Creating user "openstack" ...
root@controller:~# rabbitmqctl set_permissions openstack ".*" ".*" ".*"
Setting permissions for user "openstack" in vhost "/" ...
root@controller:~# netstat -tlnp | grep beam.smp
tcp 0 0 0.0.0.0:25672 0.0.0.0:* LISTEN 23592/beam.smp
tcp6 0 0 :::5672 :::* LISTEN 23592/beam.smp