ccis_lab:openstack:install_guide:lab_network
目錄表
Openstack multi-node network architecture:Network
0x00 Basic Installation
- 更改編碼
LANG="en_US.utf8"
- 為了讓網卡代號為我們習慣的 ethx 這邊修改 grub
GRUB_DEFAULT=0 GRUB_HIDDEN_TIMEOUT_QUIET=true GRUB_TIMEOUT=2 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` GRUB_CMDLINE_LINUX_DEFAULT="net.ifnames=0 biosdevname=0" GRUB_CMDLINE_LINUX=""
- 這邊要設定網卡
- eth0 為 management network, 使用 192.168.10.0/24 網段
- eth1 為 internal network, 這邊是用自訂網段,我們使用 192.168.20.0/24 網段
- 要特別注意的是 gateway 不要設到兩個 (含 DHCP) 不然機器會不曉得把封包往哪送
- gateway 設為 ctrl 的 managerment network,network node 無法直接從外部連進來,會通過 ctrl node 的 NAT
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). source /etc/network/interfaces.d/* # The loopback network interface auto lo iface lo inet loopback # The primary network interface auto eth0 iface eth0 inet dhcpstatic address 192.168.10.2 netmask 255.255.255.0 gateway 192.168.10.1 auto eth1 iface eth1 inet static address 192.168.20.2 netmask 255.255.255.0 dns-nameserver 192.168.10.1 dns-search mitaka.openstack
- 因為修改 grub 後網卡名稱改變了,/etc/network/interface 也要一起修改之後才能 reboot,否則直接 reboot 會發現網卡只剩 lo0
# update-grub # reboot
- 修改 hosts 讓機器可以認到 hostname,127.0.1.1 的那行把它移除
127.0.0.1 localhost 192.168.10.1 network.mitaka.openstack ctrl # The following lines are desirable for IPv6 capable hosts ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters
- 確認 hostname:這邊再安裝 ubuntu 時應該就設了,如果有更動記得在此變更,要跟 /etc/hosts match
network
- 更新 pkg
# apt-get update # apt-get upgrade
- 安裝 ubuntu-cloud-keyring 套件:Ubuntu Cloud Archive 是一個 online software repository,讓我們在 Ubuntu LTS version 上可以下載到最新版本的 Openstack,而 ubuntu-cloud-keyring 是 Ubuntu Cloud Archive 的 GnuPG keys
# apt-get install ubuntu-cloud-keyring
- 更新 pkg 與所有相依套件並重啟系統
# apt-get -y dist-upgrade # reboot
- 清理系統,移除所有不再被需要的套件
# apt-get -y autoremove --purge
0x01 NTP
- 為了讓 Openstack 系統中所有 Node 時間同步,這邊需要使用 NTP
- 這邊 NTP server 也可以參考官網使用 chrony 這套
- 安裝 ntp 套件
# apt-get -y install ntp
- 這邊修正預設 pool,改為 ctrl NTP server
- 關閉原本聽在所有介面的設定,只聽 192.168.10.2(management interface)
... #pool 0.ubuntu.pool.ntp.org iburst #pool 1.ubuntu.pool.ntp.org iburst #pool 2.ubuntu.pool.ntp.org iburst #pool 3.ubuntu.pool.ntp.org iburst #pool ntp.ubuntu.com pool ctrl.mitaka.openstack interface ignore wildcard interface listen 192.168.10.2 ...
- 重啟 NTP service
# service ntp restart
- 驗證
# ntpq -p
0x03 OpenvSwitch
- 安裝套件
# apt-get -y install openvswitch-switch
ccis_lab/openstack/install_guide/lab_network.txt · 上一次變更: 由 127.0.0.1