热门标签 | HotTags
当前位置:  开发笔记 > 后端 > 正文

在Ubuntu12.04中部署多节点OpenStackGrizzly

我这里用三台机器来部署,你也可以横向扩展计算节点,下面是网络情况:controlnode:eth0(172.16.0.51),eth1(192.168.8.51)networknode:eth0(172.16.0.52),eth1(10.10.10.52),eth2(192.168.8.52)computenode:e

我这里用三台机器来部署,你也可以横向扩展计算节点,下面是网络情况:

control node:  eth0(172.16.0.51), eth1(192.168.8.51)
network node : eth0(172.16.0.52), eth1(10.10.10.52), eth2(192.168.8.52)
compute node : eth0(172.16.0.53), eth1(10.10.10.53)

管理网络: 172.16.0.0/16
业务网络: 10.10.10.0/24
外部网络: 192.168.8.0/24
下面是引用 mirantis 的一张图:


这里我的三个节点的网卡都连在了一个交换机上。因为我没有做 Grizzly 的本地 apt 源,计算节点还需要去公网 apt-get 包,所以我会在计算节点上临时设置一个虚拟网卡让它来装包。

文档更新:

2013.04.01    在计算节点上安装了 nova-compute 和 nova-conductor,而 nova-conductor 只需在控制节点安装就行了。同时发现网络节点在重启机器后,eth2 网卡没有激活,需要手工 up, 添加命令到 rc.local 中。

网络设置
cat /etc/network/interfaces
auto eth0
iface eth0 inet static
        address 172.16.0.51
        netmask 255.255.0.0
auto eth1
iface eth1 inet static
        address 192.168.8.51
        netmask 255.255.255.0
        gateway 192.168.8.1
        dns-nameservers 8.8.8.8
添加源

添加 Grizzly 源,并升级系统

cat > /etc/apt/sources.list.d/grizzly.list << _GEEK_
deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/grizzly main
deb  http://ubuntu-cloud.archive.canonical.com/ubuntu precise-proposed/grizzly main
_GEEK_
apt-get update
apt-get upgrade
apt-get install ubuntu-cloud-keyring
MySQL & RabbitMQ
apt-get install mysql-server python-mysqldb

使用sed编辑 /etc/mysql/my.cnf 文件的更改绑定地址(0.0.0.0)从本地主机(127.0.0.1)
禁止 mysql 做域名解析,防止 连接 mysql 出现错误和远程连接 mysql 慢的现象。
然后重新启动mysql服务.

sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mysql/my.cnf
sed -i '44 i skip-name-resolve' /etc/mysql/my.cnf
/etc/init.d/mysql restart
apt-get install rabbitmq-server
NTP
apt-get install ntp

配置NTP服务器计算节点控制器节点之间的同步:

sed -i 's/server ntp.ubuntu.com/server ntp.ubuntu.com\nserver 127.127.1.0\nfudge 127.127.1.0 stratum 10/g' /etc/ntp.conf
service ntp restart
vim /etc/sysctl.conf
net.ipv4.ip_forward=1
Keystone
apt-get install keystone

在 mysql 里创建 keystone 数据库并授权:

mysql -uroot -p
create database keystone;
grant all on keystone.* to 'keystone'@'%' identified by 'keystone';
quit;

修改 /etc/keystone/keystone.conf 配置文件:

admin_token = www.longgeek.com
debug = True
verbose = True
[sql]
connection = mysql://keystone:keystone@172.16.0.51/keystone       #必须写到 [sql] 下面
[signing]
token_format = UUID

启动 keystone 然后同步数据库

/etc/init.d/keystone restart
keystone-manage db_sync

用脚本来创建 user、role、tenant、service、endpoint,下载脚本:

wget http://download.longgeek.com/openstack/grizzly/keystone.sh

修改脚本内容:

ADMIN_PASSWORD=${ADMIN_PASSWORD:-password}     #租户 admin 的密码
SERVICE_PASSWORD=${SERVICE_PASSWORD:-password}              #nova,glance,cinder,quantum,swift的密码
export SERVICE_TOKEN="www.longgeek.com"    # token
export SERVICE_ENDPOINT="http://172.16.0.51:35357/v2.0"
SERVICE_TENANT_NAME=${SERVICE_TENANT_NAME:-service}      #租户 service,包含了nova,glance,ciner,quantum,swift等服务
KEYSTONE_REGION=RegionOne
KEYSTONE_IP="172.16.0.51"
#KEYSTONE_WLAN_IP="172.16.0.51"
SWIFT_IP="172.16.0.51"
#SWIFT_WLAN_IP="172.16.0.51"
COMPUTE_IP=$KEYSTONE_IP
EC2_IP=$KEYSTONE_IP
GLANCE_IP=$KEYSTONE_IP
VOLUME_IP=$KEYSTONE_IP
QUANTUM_IP=$KEYSTONE_IP

执行脚本:

sh keystone.sh

这里变量对于 keystone.sh 里的设置:

# cat > /root/export.sh << _GEEK_
export OS_TENANT_NAME=admin      #这里如果设置为 service 其它服务会无法验证.
export OS_USERNAME=admin
export OS_PASSWORD=password
export OS_AUTH_URL=http://172.16.0.51:5000/v2.0/
export OS_REGION_NAME=RegionOne
export SERVICE_TOKEN=www.longgeek.com
export SERVICE_ENDPOINT=http://172.16.0.51:35357/v2.0/
_GEEK_
# echo 'source /root/export.sh' >> /root/.bashrc
# source /root/export.sh

验证 keystone 的安装,做一个简单测试:

apt-get install curl openssl
curl http://172.16.0.51:35357/v2.0/endpoints -H 'x-auth-token: www.longgeek.com' | python -mjson.tool
Glance
apt-get install glance

创建一个 glance 数据库并授权:

mysql -uroot -p
create database glance;
grant all on glance.* to 'glance'@'%' identified by 'glance';

更新 /etc/glance/glance-api.conf 文件:

verbose = True
debug = True
sql_connection = mysql://glance:glance@172.16.0.51/glance
workers = 4
registry_host = 172.16.0.51
notifier_strategy = rabbit
rabbit_host = 172.16.0.51
rabbit_userid = guest
rabbit_password = guest
[keystone_authtoken]
auth_host = 172.16.0.51
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = glance
admin_password = password
[paste_deploy]
config_file = /etc/glance/glance-api-paste.ini
flavor = keystone

更新 /etc/glance/glance-registry.conf 文件:

verbose = True
debug = True
sql_connection = mysql://glance:glance@172.16.0.51/glance
[keystone_authtoken]
auth_host = 172.16.0.51
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = glance
admin_password = password
[paste_deploy]
config_file = /etc/glance/glance-registry-paste.ini
flavor = keystone

启动 glance-api 和 glance-registry 服务并同步到数据库:

/etc/init.d/glance-api restart
/etc/init.d/glance-registry restart
glance-manage version_control 0
glance-manage db_sync

测试 glance 的安装,上传一个镜像。下载 Cirros 镜像并上传:

wget https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img
glance image-create --name='cirros' --public --container-format=ovf --disk-format=qcow2 < ./cirros-0.3.0-x86_64-disk.img
glance image-list
Cinder

安装 Cinder 需要的包:

apt-get install cinder-api cinder-common cinder-scheduler cinder-volume python-cinderclient iscsitarget open-iscsi iscsitarget-dkms

配置 iscsi 并启动服务:

sed -i 's/false/true/g' /etc/default/iscsitarget
/etc/init.d/iscsitarget restart
/etc/init.d/open-iscsi restart

创建 cinder 数据库并授权用户访问:

mysql -uroot -p
create database cinder;
grant all on cinder.* to 'cinder'@'%' identified by 'cinder';
quit;

修改 /etc/cinder/cinder.conf:

cat /etc/cinder/cinder.conf
[DEFAULT]
# LOG/STATE
verbose = True
debug = False
iscsi_helper = ietadm
auth_strategy = keystone
volume_group = cinder-volumes
volume_name_template = volume-%s
state_path = /var/lib/cinder
volumes_dir = /var/lib/cinder/volumes
rootwrap_config = /etc/cinder/rootwrap.conf
api_paste_config = /etc/cinder/api-paste.ini
# RPC
rabbit_host = 172.16.0.51
rabbit_password = guest
rpc_backend = cinder.openstack.common.rpc.impl_kombu
# DATABASE
sql_connection = mysql://cinder:cinder@172.16.0.51/cinder
# API
osapi_volume_extension = cinder.api.contrib.standard_extensions

修改 /etc/cinder/api-paste.ini 文件末尾 [filter:authtoken] 字段 :

[filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
service_protocol = http
service_host = 172.16.0.51
service_port = 5000
auth_host = 172.16.0.51
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = cinder
admin_password = password
signing_dir = /var/lib/cinder

创建一个卷组,命名为 cinder-volumes:

这里用文件模拟分区。

dd if=/dev/zero of=/opt/cinder-volumes bs=1 count=0 seek=5G
losetup /dev/loop2 /opt/cinder-volumes
fdisk /dev/loop2
#Type in the followings:
n
p
1
ENTER
ENTER
t
8e
w

分区现在有了,创建物理卷和卷组:

pvcreate /dev/loop2
vgcreate cinder-volumes /dev/loop2

这个卷组在系统重启会失效,把它写到 rc.local 中:

echo 'losetup /dev/loop2 /opt/cinder-volumes' >> /etc/rc.local

同步数据库并重启服务:

cinder-manage db sync
/etc/init.d/cinder-api restart
/etc/init.d/cinder-schduler restart
/etc/init.d/cinder-volume restart
Quantum

安装 Quantum server 和 OpenVSwitch 包:

apt-get install quantum-server quantum-plugin-openvswitch

创建 quantum 数据库并授权用户访问:

mysql -uroot -p
create database quantum;
grant all on quantum.* to 'quantum'@'%' identified by 'quantum';
quit;

编辑 OVS 插件配置文件 /etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini:

[DATABASE]
sql_connection = mysql://quantum:quantum@172.16.0.51/quantum
reconnect_interval = 2
[OVS]
tenant_network_type = gre
enable_tunneling = True
tunnel_id_ranges = 1:1000
[AGENT]
polling_interval = 2
[SECURITYGROUP]

编辑 /etc/quantum/quanqum.conf 文件:

[DEFAULT]
debug = True
verbose = True
state_path = /var/lib/quantum
bind_host = 0.0.0.0
bind_port = 9696
core_plugin = quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2
api_paste_config = /etc/quantum/api-paste.ini
control_exchange = quantum
rabbit_host = 172.16.0.51
rabbit_password = guest
rabbit_port = 5672
rabbit_userid = guest
notification_driver = quantum.openstack.common.notifier.rpc_notifier
default_notification_level = INFO
notification_topics = notifications
[QUOTAS]
[DEFAULT_SERVICETYPE]
[SECURITYGROUP]
[AGENT]
root_helper = sudo quantum-rootwrap /etc/quantum/rootwrap.conf
[keystone_authtoken]
auth_host = 172.16.0.51
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = quantum
admin_password = password
signing_dir = /var/lib/quantum/keystone-signing
/etc/init.d/quantum-server restart
Nova

安装 Nova 相关软件包:

apt-get install nova-api nova-cert novnc nova-conductor nova-consoleauth nova-scheduler nova-novncproxy

创建 nova 数据库,授权 nova 用户访问它:

mysql -uroot -p
create database nova;
grant all on nova.* to 'nova'@'%' identified by 'nova';
quit;

在 /etc/nova/api-paste.ini 中修改 autotoken 验证部分:

[filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
auth_host = 172.16.0.51
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = nova
admin_password = password
signing_dir = /tmp/keystone-signing-nova
# Workaround for https://bugs.launchpad.net/nova/+bug/1154809
auth_version = v2.0

修改 /etc/nova/nova.conf, 类似下面这样:

[DEFAULT]
# LOGS/STATE
debug = False
verbose = True
logdir = /var/log/nova
state_path = /var/lib/nova
lock_path = /var/lock/nova
rootwrap_config = /etc/nova/rootwrap.conf
dhcpbridge = /usr/bin/nova-dhcpbridge
# SCHEDULER
compute_scheduler_driver = nova.scheduler.filter_scheduler.FilterScheduler
## VOLUMES
volume_api_class = nova.volume.cinder.API
# DATABASE
sql_connection = mysql://nova:nova@172.16.0.51/nova
# COMPUTE
libvirt_type = kvm
compute_driver = libvirt.LibvirtDriver
instance_name_template = instance-%08x
api_paste_config = /etc/nova/api-paste.ini
# COMPUTE/APIS: if you have separate configs for separate services
# this flag is required for both nova-api and nova-compute
allow_resize_to_same_host = True
# APIS
osapi_compute_extension = nova.api.openstack.compute.contrib.standard_extensions
ec2_dmz_host = 172.16.0.51
s3_host = 172.16.0.51
metadata_host = 172.16.0.51
metadata_listen = 0.0.0.0
# RABBITMQ
rabbit_host = 172.16.0.51
rabbit_password = guest
# GLANCE
image_service = nova.image.glance.GlanceImageService
glance_api_servers = 172.16.0.51:9292
# NETWORK
network_api_class = nova.network.quantumv2.api.API
quantum_url = http://172.16.0.51:9696
quantum_auth_strategy = keystone
quantum_admin_tenant_name = service
quantum_admin_username = quantum
quantum_admin_password = password
quantum_admin_auth_url = http://172.16.0.51:35357/v2.0
libvirt_vif_driver = nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriver
linuxnet_interface_driver = nova.network.linux_net.LinuxOVSInterfaceDriver
firewall_driver = nova.virt.libvirt.firewall.IptablesFirewallDriver
# NOVNC CONSOLE
novncproxy_base_url = http://192.168.8.51:6080/vnc_auto.html
# Change vncserver_proxyclient_address and vncserver_listen to match each compute host
vncserver_proxyclient_address = 192.168.8.51
vncserver_listen = 0.0.0.0
# AUTHENTICATION
auth_strategy = keystone
[keystone_authtoken]
auth_host = 172.16.0.51
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = nova
admin_password = password
signing_dir = /tmp/keystone-signing-nova

同步数据库,启动 nova 相关服务:

nova-manage db sync
cd /etc/init.d/; for i in $( ls nova-* ); do sudo /etc/init.d/$i restart; done

检查 nova 相关服务笑脸

nova-manage service list
Binary           Host                                 Zone             Status     State Updated_At
nova-consoleauth control                              internal         enabled    :-)   2013-03-31 09:55:43
nova-cert        control                              internal         enabled    :-)   2013-03-31 09:55:42
nova-scheduler   control                              internal         enabled    :-)   2013-03-31 09:55:41
nova-conductor   control                              internal         enabled    :-)   2013-03-31 09:55:42
Horizon
apt-get install openstack-dashboard memcached

如果你不喜欢 Ubuntu 的主题,可以禁用它,使用默认界面:

vim /etc/openstack-dashboard/local_settings.py
# Enable the Ubuntu theme if it is present.
#try:
#    from ubuntu_theme import *
#except ImportError:
#    pass

重新加载 apache2 和 memcache:

/etc/init.d/apache2 restart
/etc/init.d/memcached restart

现在可以通过浏览器 http://192.168.8.51/horizon 使用 admin:password 来登录界面。

网络设置
# cat /etc/network/interfaces
auto eth0
iface eth0 inet static
        address 172.16.0.52
        netmask 255.255.0.0
auto eth1
iface eth1 inet static
        address 10.10.10.52
        netmask 255.255.255.0
auto eth2
iface eth2 inet manual
# /etc/init.d/networking restart
# ifconfig eth2 192.168.8.52/24 up
# route add default gw 192.168.8.1 dev eth2
# echo 'nameserver 8.8.8.8' > /etc/resolv.conf
添加源

添加 Grizzly 源,并升级系统

cat > /etc/apt/sources.list.d/grizzly.list << _GEEK_
deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/grizzly main
deb  http://ubuntu-cloud.archive.canonical.com/ubuntu precise-proposed/grizzly main
_GEEK_
apt-get update
apt-get upgrade
apt-get install ubuntu-cloud-keyring

设置 ntp 和开启路由转发:

# apt-get install ntp
# sed -i 's/server ntp.ubuntu.com/server 172.16.0.51/g' /etc/ntp.conf
# service ntp restart
# vim /etc/sysctl.conf
net.ipv4.ip_forward=1
# sysctl -p
OpenVSwitch
apt-get install openvswitch-switch openvswitch-brcompat

设置 ovs-brcompatd 启动:

sed -i 's/# BRCOMPAT=no/BRCOMPAT=yes/g' /etc/default/openvswitch-switch

启动 openvswitch-switch:

/etc/init.d/openvswitch-switch restart
 * ovs-brcompatd is not running            # brcompatd 没有启动,尝试再次启动.
 * ovs-vswitchd is not running
 * ovsdb-server is not running
 * Inserting openvswitch module
 * /etc/openvswitch/conf.db does not exist
 * Creating empty database /etc/openvswitch/conf.db
 * Starting ovsdb-server
 * Configuring Open vSwitch system IDs
 * Starting ovs-vswitchd
 * Enabling gre with iptables

再次启动,直到 ovs-brcompatd、ovs-vswitchd、ovsdb-server等服务都启动:

# /etc/init.d/openvswitch-switch restart
# lsmod | grep brcompat
brcompat               13512  0
openvswitch            84038  7 brcompat

如果还是启动不了 brcompat,执行下面命令:

/etc/init.d/openvswitch-switch force-reload-kmod
ovs-vsctl add-br br-int        # br-int 用于 vm 整合
ovs-vsctl add-br br-ex              # br-ex 用于从互联网上访问 vm
ovs-vsctl add-port br-ex eth2       # br-ex 桥接到 eth2

做完上面操作后,eth2 这个网卡是没有工作的,需修改网卡配置文件:

# ifconfig eth2 0
# ifconfig br-ex 192.168.8.52/24
# route add default gw 192.168.8.1 dev br-ex
# echo 'nameserver 8.8.8.8' > /etc/resolv.conf
# vim /etc/network/interfaces
auto eth0
iface eth0 inet static
        address 172.16.0.52
        netmask 255.255.0.0
auto eth1
iface eth1 inet static
        address 10.10.10.52
        netmask 255.255.255.0
auto eth2
iface eth2 inet manual
        up ifconfig $IFACE 0.0.0.0 up
        down ifconfig $IFACE down
auto br-ex
iface br-ex inet static
        address 192.168.8.52
        netmask 255.255.255.0
        gateway 192.168.8.1
        dns-nameservers 8.8.8.8

重启网卡可能会出现:

 /etc/init.d/networking restart
RTNETLINK answers: File exists
Failed to bring up br-ex.

br-ex 可能有 ip 地址,但没有网关和 DNS,需要手工配置一下,或者重启机器. 重启机器后就正常了

文档更新:发现网络节点的 eth2 网卡在系统重启后没有激活,写入到 rc.local中:

echo 'ifconfig eth2 up' >> /etc/rc.local
ovs-vsctl list-br
ovs-vsctl show
Quantum

安装 Quantum openvswitch agent, l3 agent 和 dhcp agent:

apt-get install quantum-plugin-openvswitch-agent quantum-dhcp-agent quantum-l3-agent

更改 /etc/quantum/quantum.conf:

[DEFAULT]
debug = True
verbose = True
state_path = /var/lib/quantum
lock_path = $state_path/lock
bind_host = 0.0.0.0
bind_port = 9696
core_plugin = quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2
api_paste_config = /etc/quantum/api-paste.ini
control_exchange = quantum
rabbit_host = 172.16.0.51
rabbit_password = guest
rabbit_port = 5672
rabbit_userid = guest
notification_driver = quantum.openstack.common.notifier.rpc_notifier
default_notification_level = INFO
notification_topics = notifications
[QUOTAS]
[DEFAULT_SERVICETYPE]
[AGENT]
root_helper = sudo quantum-rootwrap /etc/quantum/rootwrap.conf
[keystone_authtoken]
auth_host = 172.16.0.51
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = quantum
admin_password = password
signing_dir = /var/lib/quantum/keystone-signing

编辑 OVS 插件配置文件 /etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini:

[DATABASE]
sql_connection = mysql://quantum:quantum@172.16.0.51/quantum
reconnect_interval = 2
[OVS]
enable_tunneling = True
tenant_network_type = gre
tunnel_id_ranges = 1:1000
local_ip = 10.10.10.52
integration_bridge = br-int
tunnel_bridge = br-tun
[AGENT]
polling_interval = 2
[SECURITYGROUP]

编辑 /etc/quantum/l3_agent.ini:

[DEFAULT]
debug = True
verbose = True
use_namespaces = True
external_network_bridge = br-ex
signing_dir = /var/cache/quantum
admin_tenant_name = service
admin_user = quantum
admin_password = password
auth_url = http://172.16.0.51:35357/v2.0
l3_agent_manager = quantum.agent.l3_agent.L3NATAgentWithStateReport
root_helper = sudo quantum-rootwrap /etc/quantum/rootwrap.conf
interface_driver = quantum.agent.linux.interface.OVSInterfaceDriver

编辑 /etc/quantum/dhcp_agent.ini:

[DEFAULT]
debug = True
verbose = True
use_namespaces = True
signing_dir = /var/cache/quantum
admin_tenant_name = service
admin_user = quantum
admin_password = password
auth_url = http://172.16.0.51:35357/v2.0
dhcp_agent_manager = quantum.agent.dhcp_agent.DhcpAgentWithStateReport
root_helper = sudo quantum-rootwrap /etc/quantum/rootwrap.conf
state_path = /var/lib/quantum
interface_driver = quantum.agent.linux.interface.OVSInterfaceDriver
dhcp_driver = quantum.agent.linux.dhcp.Dnsmasq

编辑 /etc/quantum/metadata_agent.ini:

[DEFAULT]
debug = True
auth_url = http://172.16.0.51:35357/v2.0
auth_region = RegionOne
admin_tenant_name = service
admin_user = quantum
admin_password = password
state_path = /var/lib/quantum
nova_metadata_ip = 172.16.0.51
nova_metadata_port = 8775

启动 quantum 所有服务:

service quantum-plugin-openvswitch-agent restart
service quantum-dhcp-agent restart
service quantum-l3-agent restart
service quantum-metadata-agent restart
网络设置
cat /etc/network/interfaces
auto eth0
iface eth0 inet static
        address 172.16.0.53
        netmask 255.255.0.0
auto eth1
iface eth1 inet static
        address 10.10.10.53
        netmask 255.255.255.0

* 因为没有内网 apt 源,所以临时设置个虚拟网卡来 apt-get:

ifconfig eth0:0 192.168.8.53/24 up
route add default gw 192.168.8.1 dev eth0:0
echo 'nameserver 8.8.8.8' >> /etc/resolv.conf
添加源

添加 Grizzly 源,并升级系统:

echo 'deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/grizzly main' > /etc/apt/sources.list.d/grizzly.list
apt-get update
apt-get upgrade
apt-get install ubuntu-cloud-keyring

设置 ntp 和开启路由转发:

# apt-get install ntp
# sed -i 's/server ntp.ubuntu.com/server 172.16.0.51/g' /etc/ntp.conf
# service ntp restart
# vim /etc/sysctl.conf
net.ipv4.ip_forward=1
# sysctl -p
OpenVSwitch
apt-get install openvswitch-switch openvswitch-brcompat

设置 ovs-brcompatd 启动:

sed -i 's/# BRCOMPAT=no/BRCOMPAT=yes/g' /etc/default/openvswitch-switch
echo 'brcompat' >> /etc/module

启动 openvswitch-switch:

/etc/init.d/openvswitch-switch restart
 * ovs-brcompatd is not running            # brcompatd 没有启动,尝试再次启动.
 * ovs-vswitchd is not running
 * ovsdb-server is not running
 * Inserting openvswitch module
 * /etc/openvswitch/conf.db does not exist
 * Creating empty database /etc/openvswitch/conf.db
 * Starting ovsdb-server
 * Configuring Open vSwitch system IDs
 * Starting ovs-vswitchd
 * Enabling gre with iptables

再次启动,直到 ovs-brcompatd、ovs-vswitchd、ovsdb-server等服务都启动:

# /etc/init.d/openvswitch-switch restart
# lsmod | grep brcompat
brcompat               13512  0
openvswitch            84038  7 brcompat

如果还是启动不了 brcompat,执行下面命令:

/etc/init.d/openvswitch-switch force-reload-kmod
ovs-vsctl add-br br-int
Quantum

安装 Quantum openvswitch agent:

apt-get install quantum-plugin-openvswitch-agent

编辑 OVS 插件配置文件 /etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini:

[DATABASE]
sql_connection = mysql://quantum:quantum@172.16.0.51/quantum
reconnect_interval = 2
[OVS]
enable_tunneling = True
tenant_network_type = gre
tunnel_id_ranges = 1:1000
local_ip = 10.10.10.53
integration_bridge = br-int
tunnel_bridge = br-tun
[AGENT]
polling_interval = 2
[SECURITYGROUP]

编辑 /etc/quantum/quantum.conf:

[DEFAULT]
debug = True
verbose = True
state_path = /var/lib/quantum
lock_path = $state_path/lock
bind_host = 0.0.0.0
bind_port = 9696
core_plugin = quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2
api_paste_config = /etc/quantum/api-paste.ini
control_exchange = quantum
rabbit_host = 172.16.0.51
rabbit_password = guest
rabbit_port = 5672
rabbit_userid = guest
notification_driver = quantum.openstack.common.notifier.rpc_notifier
default_notification_level = INFO
notification_topics = notifications
[QUOTAS]
[DEFAULT_SERVICETYPE]
[AGENT]
root_helper = sudo quantum-rootwrap /etc/quantum/rootwrap.conf
[keystone_authtoken]
auth_host = 172.16.0.51
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = quantum
admin_password = password
signing_dir = /var/lib/quantum/keystone-signin
service quantum-plugin-openvswitch-agent restart
Nova
apt-get install nova-compute

在 /etc/nova/api-paste.ini 中修改 autotoken 验证部分:

[filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
auth_host = 172.16.0.51
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = nova
admin_password = password
signing_dir = /tmp/keystone-signing-nova
# Workaround for https://bugs.launchpad.net/nova/+bug/1154809
auth_version = v2.0

修改 /etc/nova/nova.conf, 类似下面这样:

[DEFAULT]
# LOGS/STATE
debug = False
verbose = True
logdir = /var/log/nova
state_path = /var/lib/nova
lock_path = /var/lock/nova
rootwrap_config = /etc/nova/rootwrap.conf
dhcpbridge = /usr/bin/nova-dhcpbridge
# SCHEDULER
compute_scheduler_driver = nova.scheduler.filter_scheduler.FilterScheduler
## VOLUMES
volume_api_class = nova.volume.cinder.API
osapi_volume_listen_port=5900
# DATABASE
sql_connection = mysql://nova:nova@172.16.0.51/nova
# COMPUTE
libvirt_type = kvm
compute_driver = libvirt.LibvirtDriver
instance_name_template = instance-%08x
api_paste_config = /etc/nova/api-paste.ini
# COMPUTE/APIS: if you have separate configs for separate services
# this flag is required for both nova-api and nova-compute
allow_resize_to_same_host = True
# APIS
osapi_compute_extension = nova.api.openstack.compute.contrib.standard_extensions
ec2_dmz_host = 172.16.0.51
s3_host = 172.16.0.51
metadata_host=172.16.0.51
metadata_listen=0.0.0.0
# RABBITMQ
rabbit_host = 172.16.0.51
rabbit_password = guest
# GLANCE
image_service = nova.image.glance.GlanceImageService
glance_api_servers = 172.16.0.51:9292
# NETWORK
network_api_class = nova.network.quantumv2.api.API
quantum_url = http://172.16.0.51:9696
quantum_auth_strategy = keystone
quantum_admin_tenant_name = service
quantum_admin_username = quantum
quantum_admin_password = password
quantum_admin_auth_url = http://172.16.0.51:35357/v2.0
libvirt_vif_driver = nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriver
linuxnet_interface_driver = nova.network.linux_net.LinuxOVSInterfaceDriver
firewall_driver = nova.virt.libvirt.firewall.IptablesFirewallDriver
# NOVNC CONSOLE
novncproxy_base_url = http://192.168.8.51:6080/vnc_auto.html
# Change vncserver_proxyclient_address and vncserver_listen to match each compute host
vncserver_proxyclient_address = 172.16.0.53
vncserver_listen = 0.0.0.0
# AUTHENTICATION
auth_strategy = keystone
[keystone_authtoken]
auth_host = 172.16.0.51
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = nova
admin_password = password
signing_dir = /tmp/keystone-signing-nova

启动 nova-compute 服务:

service nova-compute restart

检查 nova 相关服务笑脸:

发现 compute 节点已经加入:

nova-manage service list
Binary           Host                                 Zone             Status     State Updated_At
nova-consoleauth control                              internal         enabled    :-)   2013-03-31 11:38:32
nova-cert        control                              internal         enabled    :-)   2013-03-31 11:38:31
nova-scheduler   control                              internal         enabled    :-)   2013-03-31 11:38:31
nova-conductor   control                              internal         enabled    :-)   2013-03-31 11:38:27
nova-compute     compute1                             nova             enabled    :-)   2013-03-31 11:38:26

创建 quantum 网络和虚拟机参照这里。


推荐阅读
  • 如何实现织梦DedeCms全站伪静态
    本文介绍了如何通过修改织梦DedeCms源代码来实现全站伪静态,以提高管理和SEO效果。全站伪静态可以避免重复URL的问题,同时通过使用mod_rewrite伪静态模块和.htaccess正则表达式,可以更好地适应搜索引擎的需求。文章还提到了一些相关的技术和工具,如Ubuntu、qt编程、tomcat端口、爬虫、php request根目录等。 ... [详细]
  • 本文介绍了在开发Android新闻App时,搭建本地服务器的步骤。通过使用XAMPP软件,可以一键式搭建起开发环境,包括Apache、MySQL、PHP、PERL。在本地服务器上新建数据库和表,并设置相应的属性。最后,给出了创建new表的SQL语句。这个教程适合初学者参考。 ... [详细]
  • Webmin远程命令执行漏洞复现及防护方法
    本文介绍了Webmin远程命令执行漏洞CVE-2019-15107的漏洞详情和复现方法,同时提供了防护方法。漏洞存在于Webmin的找回密码页面中,攻击者无需权限即可注入命令并执行任意系统命令。文章还提供了相关参考链接和搭建靶场的步骤。此外,还指出了参考链接中的数据包不准确的问题,并解释了漏洞触发的条件。最后,给出了防护方法以避免受到该漏洞的攻击。 ... [详细]
  • 这是原文链接:sendingformdata许多情况下,我们使用表单发送数据到服务器。服务器处理数据并返回响应给用户。这看起来很简单,但是 ... [详细]
  • 本文介绍了在Mac上搭建php环境后无法使用localhost连接mysql的问题,并通过将localhost替换为127.0.0.1或本机IP解决了该问题。文章解释了localhost和127.0.0.1的区别,指出了使用socket方式连接导致连接失败的原因。此外,还提供了相关链接供读者深入了解。 ... [详细]
  • Linux磁盘的分区、格式化的观察和操作步骤
    本文介绍了如何观察Linux磁盘的分区状态,使用lsblk命令列出系统上的所有磁盘列表,并解释了列表中各个字段的含义。同时,还介绍了使用parted命令列出磁盘的分区表类型和分区信息的方法。在进行磁盘分区操作时,根据分区表类型选择使用fdisk或gdisk命令,并提供了具体的分区步骤。通过本文,读者可以了解到Linux磁盘分区和格式化的基本知识和操作步骤。 ... [详细]
  • 本文介绍了Linux系统中正则表达式的基础知识,包括正则表达式的简介、字符分类、普通字符和元字符的区别,以及在学习过程中需要注意的事项。同时提醒读者要注意正则表达式与通配符的区别,并给出了使用正则表达式时的一些建议。本文适合初学者了解Linux系统中的正则表达式,并提供了学习的参考资料。 ... [详细]
  • Ubuntu 9.04中安装谷歌Chromium浏览器及使用体验[图文]
    nsitionalENhttp:www.w3.orgTRxhtml1DTDxhtml1-transitional.dtd ... [详细]
  • imx6ull开发板驱动MT7601U无线网卡的方法和步骤详解
    本文详细介绍了在imx6ull开发板上驱动MT7601U无线网卡的方法和步骤。首先介绍了开发环境和硬件平台,然后说明了MT7601U驱动已经集成在linux内核的linux-4.x.x/drivers/net/wireless/mediatek/mt7601u文件中。接着介绍了移植mt7601u驱动的过程,包括编译内核和配置设备驱动。最后,列举了关键词和相关信息供读者参考。 ... [详细]
  • 成功安装Sabayon Linux在thinkpad X60上的经验分享
    本文分享了作者在国庆期间在thinkpad X60上成功安装Sabayon Linux的经验。通过修改CHOST和执行emerge命令,作者顺利完成了安装过程。Sabayon Linux是一个基于Gentoo Linux的发行版,可以将电脑快速转变为一个功能强大的系统。除了作为一个live DVD使用外,Sabayon Linux还可以被安装在硬盘上,方便用户使用。 ... [详细]
  • Ubuntu安装常用软件详细步骤
    目录1.GoogleChrome浏览器2.搜狗拼音输入法3.Pycharm4.Clion5.其他软件1.GoogleChrome浏览器通过直接下载安装GoogleChro ... [详细]
  • mac php错误日志配置方法及错误级别修改
    本文介绍了在mac环境下配置php错误日志的方法,包括修改php.ini文件和httpd.conf文件的操作步骤。同时还介绍了如何修改错误级别,以及相应的错误级别参考链接。 ... [详细]
  • 分享css中提升优先级属性!important的用法总结
    web前端|css教程css!importantweb前端-css教程本文分享css中提升优先级属性!important的用法总结微信门店展示源码,vscode如何管理站点,ubu ... [详细]
  • 2016 linux发行版排行_灵越7590 安装 linux (manjarognome)
    RT之前做了一次灵越7590黑苹果炒作业的文章,希望能够分享给更多不想折腾的人。kawauso:教你如何给灵越7590黑苹果抄作业​zhuanlan.z ... [详细]
  • 本文介绍了在Web应用系统中,数据库性能是导致系统性能瓶颈最主要的原因之一,尤其是在大规模系统中,数据库集群已经成为必备的配置之一。文章详细介绍了主从数据库架构的好处和实验环境的搭建方法,包括主数据库的配置文件修改和设置需要同步的数据库等内容。MySQL的主从复制功能在国内外大型网站架构体系中被广泛采用,本文总结了作者在实际的Web项目中的实践经验。 ... [详细]
author-avatar
lLing微_308
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有