二、安装计算节点:devstack-compute
步骤:
1、安装虚拟机和操作系统:
内存至少4G,硬盘容量至少在40G以上
CPU一定开启虚拟化,一个默认网卡设置成NAT,添加一个网卡,设置成仅主机模式,然后启动虚拟机,安装操作系统。
安装完毕,进入系统
设置root密码:sudo passwd
sudo和su是不一样的,
sudo:输入当前用户的密码 allen
su:输入切换后的用户密码
2、通过Xshell远程连接虚拟机:SSH(secure shell)协议:安全外壳协议
注:若连接不成功,修改ssh_config /etc/ssh/
vi /etc/ssh/ssh_config PemitRootLogin yes
service ssh restart
问题1:没有sshd_config文件,需要安装openssh-server:apt-get install openssh-
server
问题2:vi编辑器无法编辑,需要安装vim编辑器:apt-get install vim
3、配置网卡:
auto eth0 iface eth0 inet static address 192.168.213.11 netmask 255.255.255.0 gateway 192.168.213.2 dns-nameserver 114.114.114.114
auto eth1 iface eth1 inet manual
4、修改Ubuntu14.04的apt源为国内的阿里云的源:
cp /etc/apt/sources.list /etc/apt/sources.list.back vi /etc/apt/sources.list deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
配置DNS服务器:
vi /etc/resolv.conf nameserver 8.8.8.8 nameserver 8.8.4.4
更新软件源和软件:
apt-get update apt-get upgrade
5、安装pip并修改pip源:
apt-get install python-pip mkdir ~/.pip vi ~/.pip/pip.conf
添加
[global] index-url = http://pypi.douban.com/simple/ trusted-host = pypi.douban.com
6、安装git:
apt-get install git
7、下载devstack:
git clone http://git.trystack.cn/openstack-dev/devstack.git -b stable/ocata
8、创建stack用户:
devstack/tools/create-stack-user.sh mv devstack /opt/stack chown -R stack:stack /opt/stack/devstack
9、切换到stack用户并修改pip源:
su stack mkdir ~/.pip vi ~/.pip/pip.conf
添加
[global] index-url = http://pypi.douban.com/simple/ trusted-host = pypi.douban.com
10、设置Devstack的配置文件:
[[local|localrc]] MULTI_HOST=true HOST_IP=192.168.213.11 # management & api network # Credentials ADMIN_PASSWORD=admin MYSQL_PASSWORD=secret RABBIT_PASSWORD=secret SERVICE_PASSWORD=secret SERVICE_TOKEN=abcdefghijklmnopqrstuvwxyz # Service information SERVICE_HOST=192.168.213.10 MYSQL_HOST=$SERVICE_HOST RABBIT_HOST=$SERVICE_HOST GLANCE_HOSTPORT=$SERVICE_HOST:9292 Q_HOST=$SERVICE_HOST KEYSTONE_AUTH_HOST=$SERVICE_HOST KEYSTONE_SERVICE_HOST=$SERVICE_HOST CEILOMETER_BACKEND=mongodb DATABASE_TYPE=mysql ENABLED_SERVICES=n-cpu,q-agt,neutron Q_AGENT=linuxbridge ENABLE_TENANT_VLANS=True TENANT_VLAN_RANGE=3001:4000 PHYSICAL_NETWORK=default # vnc config NOVA_VNC_ENABLED=True NOVNCPROXY_URL="http://$SERVICE_HOST:6080/vnc_auto.html" VNCSERVER_LISTEN=$HOST_IP VNCSERVER_PROXYCLIENT_ADDRESS=$VNCSERVER_LISTEN LOG_COLOR=False LOGDIR=$DEST/logs SCREEN_LOGDIR=$LOGDIR/screen # use TryStack git mirror GIT_BASE=http://git.trystack.cn NOVNC_REPO=http://git.trystack.cn/kanaka/noVNC.git SPICE_REPO=http://git.trystack.cn/git/spice/spice-html5.git
11、开始部署:
./stack.sh