這系列的文章只是我自己的 OpenStack Juno 安裝記錄,不過基本上內容都跟官方文件一樣
只是把一些細節整合起來,讓安裝時的設定稍微沒那麼繁瑣一點
但如果想知道各個步驟的原因以及用途,建議還是應該回頭去看看官方的安裝文件。
安裝環境的硬體、網路配置介紹請參考前文:三主機安裝 OpenStack Juno(一):安裝環境介紹
系統環境與前置工作
- 作業系統為 Ubuntu 14.04.1。
- 將會在 Compute Node 上安裝的各元件版本如下(使用 apt-show-versions):
12nova-compute:all
/trusty-updates
1:2014.2.1-0ubuntu1~cloud0 uptodate
sysfsutils:amd64
/trusty
2.1.0+repack-3ubuntu1 uptodate
- 編輯 /etc/hosts 設定節點的別名,將其他節點在 Administrative Network 的位址皆記錄下來。
12192.168.18.1 controller
192.168.18.2 network
Compute Node 安裝流程
安裝 Nova Compute
- 安裝 Nova Compute 套件
1apt-get
install
nova-compute sysfsutils
- 編輯 /etc/nova/nova.conf 設定檔:
(1) 設定資料庫連線資訊。假設 Nova 存取 MariaDB 的帳號是 nova、密碼是 qwer、連線位址是 controller、資料庫名稱是 nova。
(2) 依據在 Controller Node 的 Message Service 設定的資料,編輯 Nova Controller 存取 RabbitMQ 的相關設定。
(3) 設定跟 Controller Node 連接的管理介面 IP,以及讓其他連線透過 VNC 服務或者 Proxy 連上 Nova 的相關規則。
(4) 設定 Nova 的網路使用 Neutron 的驅動程式,同時設定存取 Neutron 資料庫的方法。
123456789101112131415161718192021222324252627282930313233343536373839404142434445[DEFAULT]
# Message service
rpc_backend = rabbit
rabbit_host = controller
rabbit_port = 5672
rabbit_use_ssl =
false
rabbit_userid = opnovacompute
rabbit_password = nova
rabbit_virtual_host = openstack
# Authentication
auth_strategy = keystone
# Address of management network
my_ip = 192.168.18.3
# Enable remote console access with proxy that listens only management network
vnc_enabled = True
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = 192.168.18.3
novncproxy_base_url = http:
//controller
:6080
/vnc_auto
.html
# Network configuration
network_api_class = nova.network.neutronv2.api.API
security_group_api = neutron
linuxnet_interface_driver = nova.network.linux_net.LinuxOVSInterfaceDriver
firewall_driver = nova.virt.firewall.NoopFirewallDriver
[keystone_authtoken]
auth_uri = http:
//controller
:5000
/v2
.0
identity_uri = http:
//controller
:35357
admin_tenant_name = service
admin_user = nova
admin_password = qwer
[glance]
host = controller
[neutron]
url = http:
//controller
:9696
auth_strategy = keystone
admin_auth_url = http:
//controller
:35357
/v2
.0
admin_tenant_name = service
admin_username = neutron
admin_password = qwer
- 刪除安裝套件自動建立的 !SQLite 資料庫檔,避免 Nova 誤用。
1rm
-f
/var/lib/nova/nova
.sqlite
- 重新啟動 Nova 服務。
1service nova-compute restart
安裝 Neutron Network 相關套件
這部份動作的目的,是要讓 Nova 在運作時,要將 VM 的網路操作轉送給 Neutron。- 編輯 /etc/sysctl.conf,設定系統的網路參數。
12net.ipv4.conf.all.rp_filter=0
net.ipv4.conf.default.rp_filter=0
- 使變更生效。
1sysctl -p
- 安裝 Network 元件。
1apt-get
install
neutron-plugin-ml2 neutron-plugin-openvswitch-agent
- 編輯 /etc/neutron/neutron.conf,設定網路相關參數:
(1) 設定 Neutron 使用 flat 與 generic routing encapsulation (GRE) 型態提供網路服務。
(2) 設定 flat 網路為外部網路的提供者。
(3) 以 Open vSwitch 套件作為提供網路服務的驅動程式。
(4) 啟用 security group 以及 OVS 提供的 iptables 防火牆等。
(5) 設定 Tunnel 的介面 IP。
123456789101112131415161718192021222324[DEFAULT]
...
rpc_backend = rabbit
rabbit_host = controller
rabbit_port = 5672
rabbit_use_ssl =
false
rabbit_userid = opnovanetwork
rabbit_password = nova
rabbit_virtual_host = openstack
auth_strategy = keystone
# Enable the Modular Layer 2 (ML2) plug-in, router service, and overlapping IP addresses
core_plugin = ml2
service_plugins = router
allow_overlapping_ips = True
[keystone_authtoken]
...
auth_uri = http:
//controller
:5000
/v2
.0
identity_uri = http:
//controller
:35357
admin_tenant_name = service
admin_user = neutron
admin_password = qwer
- 編輯 /etc/neutron/plugins/ml2/ml2_conf.ini,以設定 Modular Layer 2 plug-in,透過 Open vSwitch (OVS) 建立虛擬網路:
12345678910111213141516171819202122[ml2]
...
type_drivers = flat,gre
tenant_network_types = gre
mechanism_drivers = openvswitch
[ml2_type_gre]
...
tunnel_id_ranges = 1:1000
[securitygroup]
...
enable_security_group = True
enable_ipset = True
firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
[ovs]
local_ip = 192.168.17.3
enable_tunneling = True
[agent]
tunnel_types = gre
- 重新啟動相關服務。
1service openvswitch-switch restart && service nova-compute restart && service neutron-plugin-openvswitch-agent restart
沒有留言:
張貼留言