openstack devstack 脚本安装(多结点,计算结点安装)
2013-11-19 15:07
429 查看
Install a couple of packages to bootstrap configuration:
apt-get install -y git sudo
Network Configuration
The first iteration of the lab uses OpenStack's FlatDHCP network controller so only a single network will be required. It should be on its own subnet without DHCP; the host IPs and floating IP pool(s) will come out of this block. This example uses the following:
Gateway: 192.168.42.1
Physical nodes: 192.168.42.11-192.168.42.99
Floating IPs: 192.168.42.128-192.168.42.254
Configure each node with a static IP in /etc/network/interfaces:
auto eth0
iface eth0 inet static
address 192.168.42.11
netmask 255.255.255.0
gateway 192.168.42.1
Installation shake and bake
Add the DevStack User
OpenStack runs as a non-root user that has sudo access to root. There is nothing special about the name, we'll use stack here. Every node must use the same name and preferably uid. If you created a user during the OS install you can use it and give it sudo priviledges below. Otherwise create the stack user:
groupadd stack
useradd -g stack -s /bin/bash -d /opt/stack -m stack
This user will be making many changes to your system during installation and operation so it needs to have sudo priviledges to root without a password:
echo "stack ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
From here on use the stack user. Logout and login as the stack user.
Set Up Ssh
Set up the stack user on each node with an ssh key for access:
mkdir ~/.ssh; chmod 700 ~/.ssh
echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCyYjfgyPazTvGpd8OaAvtU2utL8W6gWC4JdRS1J95GhNNfQd657yO6s1AH5KYQWktcE6FO/xNUC2reEXSGC7ezy+sGO1kj9Limv5vrvNHvF1+wts0Cmyx61D2nQw35/Qz8BvpdJANL7VwP/cFI/p3yhvx2lsnjFE3hN8xRB2LtLUopUSVdBwACOVUmH2G+2BWMJDjVINd2DPqRIA4Zhy09KJ3O1Joabr0XpQL0yt/I9x8BVHdAx6l9U0tMg9dj5+tAjZvMAFfye3PJcYwwsfJoFxC8w/SLtqlFX7Ehw++8RtvomvuipLdmWCy+T9hIkl+gHYE4cS3OIqXH7f49jdJf jesse@spacey.local" > ~/.ssh/authorized_keys
###################################################################
cd /etc/apt/
wget http://mirrors.163.com/.help/sources.list.precise mv sources.list sources.list_copy
mv sources.list.precise sources.list
cat >>sources.list<<EOF
deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-proposed/folsom main
deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/folsom main
EOF
cat sources.list_copy >> sources.list
########################################
更新操作:
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 5EDB1B62EC4926EA
apt-get update
Download DevStack
Grab the latest version of DevStack from github:
git clone git://github.com/openstack-dev/devstack.git
cd devstack
Up to this point all of the steps apply to each node in the cluster. From here on there are some differences between the cluster controller (aka 'head node') and the compute nodes.
####################
Configure Compute Nodes
The compute nodes only run the OpenStack worker services. For additional machines, create a localrc with:
HOST_IP=192.168.42.12 # change this per compute node
FLAT_INTERFACE=eth0
FIXED_RANGE=10.4.128.0/20
FIXED_NETWORK_SIZE=4096
FLOATING_RANGE=192.168.42.128/25
MULTI_HOST=1
LOGFILE=/opt/stack/logs/stack.sh.log
ADMIN_PASSWORD=labstack
MYSQL_PASSWORD=supersecret
RABBIT_PASSWORD=supersecrete
SERVICE_PASSWORD=supersecrete
SERVICE_TOKEN=xyzpdqlazydog
MYSQL_HOST=192.168.42.11
RABBIT_HOST=192.168.42.11
GLANCE_HOSTPORT=192.168.42.11:9292
ENABLED_SERVICES=n-cpu,n-net,n-api,c-sch,c-api,c-vol
cinder:
pvcreate /dev/sda6
vgcreate stack-volumes /dev/sda6
Fire up OpenStack:
./stack.sh
A stream of activity ensues. When complete you will see a summary of stack.sh's work, including the relevant URLs, accounts and passwords to poke at your shiny new OpenStack. The most recent log file is available in stack.sh.log.
apt-get install -y git sudo
Network Configuration
The first iteration of the lab uses OpenStack's FlatDHCP network controller so only a single network will be required. It should be on its own subnet without DHCP; the host IPs and floating IP pool(s) will come out of this block. This example uses the following:
Gateway: 192.168.42.1
Physical nodes: 192.168.42.11-192.168.42.99
Floating IPs: 192.168.42.128-192.168.42.254
Configure each node with a static IP in /etc/network/interfaces:
auto eth0
iface eth0 inet static
address 192.168.42.11
netmask 255.255.255.0
gateway 192.168.42.1
Installation shake and bake
Add the DevStack User
OpenStack runs as a non-root user that has sudo access to root. There is nothing special about the name, we'll use stack here. Every node must use the same name and preferably uid. If you created a user during the OS install you can use it and give it sudo priviledges below. Otherwise create the stack user:
groupadd stack
useradd -g stack -s /bin/bash -d /opt/stack -m stack
This user will be making many changes to your system during installation and operation so it needs to have sudo priviledges to root without a password:
echo "stack ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
From here on use the stack user. Logout and login as the stack user.
Set Up Ssh
Set up the stack user on each node with an ssh key for access:
mkdir ~/.ssh; chmod 700 ~/.ssh
echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCyYjfgyPazTvGpd8OaAvtU2utL8W6gWC4JdRS1J95GhNNfQd657yO6s1AH5KYQWktcE6FO/xNUC2reEXSGC7ezy+sGO1kj9Limv5vrvNHvF1+wts0Cmyx61D2nQw35/Qz8BvpdJANL7VwP/cFI/p3yhvx2lsnjFE3hN8xRB2LtLUopUSVdBwACOVUmH2G+2BWMJDjVINd2DPqRIA4Zhy09KJ3O1Joabr0XpQL0yt/I9x8BVHdAx6l9U0tMg9dj5+tAjZvMAFfye3PJcYwwsfJoFxC8w/SLtqlFX7Ehw++8RtvomvuipLdmWCy+T9hIkl+gHYE4cS3OIqXH7f49jdJf jesse@spacey.local" > ~/.ssh/authorized_keys
###################################################################
cd /etc/apt/
wget http://mirrors.163.com/.help/sources.list.precise mv sources.list sources.list_copy
mv sources.list.precise sources.list
cat >>sources.list<<EOF
deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-proposed/folsom main
deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/folsom main
EOF
cat sources.list_copy >> sources.list
########################################
更新操作:
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 5EDB1B62EC4926EA
apt-get update
Download DevStack
Grab the latest version of DevStack from github:
git clone git://github.com/openstack-dev/devstack.git
cd devstack
Up to this point all of the steps apply to each node in the cluster. From here on there are some differences between the cluster controller (aka 'head node') and the compute nodes.
####################
Configure Compute Nodes
The compute nodes only run the OpenStack worker services. For additional machines, create a localrc with:
HOST_IP=192.168.42.12 # change this per compute node
FLAT_INTERFACE=eth0
FIXED_RANGE=10.4.128.0/20
FIXED_NETWORK_SIZE=4096
FLOATING_RANGE=192.168.42.128/25
MULTI_HOST=1
LOGFILE=/opt/stack/logs/stack.sh.log
ADMIN_PASSWORD=labstack
MYSQL_PASSWORD=supersecret
RABBIT_PASSWORD=supersecrete
SERVICE_PASSWORD=supersecrete
SERVICE_TOKEN=xyzpdqlazydog
MYSQL_HOST=192.168.42.11
RABBIT_HOST=192.168.42.11
GLANCE_HOSTPORT=192.168.42.11:9292
ENABLED_SERVICES=n-cpu,n-net,n-api,c-sch,c-api,c-vol
cinder:
pvcreate /dev/sda6
vgcreate stack-volumes /dev/sda6
Fire up OpenStack:
./stack.sh
A stream of activity ensues. When complete you will see a summary of stack.sh's work, including the relevant URLs, accounts and passwords to poke at your shiny new OpenStack. The most recent log file is available in stack.sh.log.
相关文章推荐
- openstack devstack 脚本安装(多结点,控制结点安装)
- Openstack 开发人员安装脚本解读 [stack.sh]
- OpenStack for icehouse的自动化安装脚本——计算节点
- Openstack 开发人员安装脚本解读 [stack.sh]
- openstack folsom 一个日本同行的脚本安装(多结点,计算结点)
- openstack多节点部署 采用devstack ubuntu11.10 nova多计算结点
- 学习OpenStack之 (3):Devstack Screen 使用技巧
- OpenStack(kilo版本)计算服务Nova的安装部署
- openstack nova数据库计算结点IP地址
- Openstack Folsom Centos6.3 计算节点的安装
- openstack 之 使用virtualbox 脚本自动安装mirantis openstack
- OpenStack安装后的验证/初始化脚本
- [部署篇5]VMWare搭建Openstack——计算节点的基础部署和Nova的安装
- CentOS 6.5 Openstack Icehouse 安装指南 -6 计算 nova
- 基于centos7.3 安装devstack ocata版本
- openstack(liberty): devstack之screen
- 模块化安装与删除openstack的dev(control、compute)与folsom(control)版本
- OpenStack for icehouse的自动化安装脚本——控制节点