使用devstack/pike部署多節點實驗

streamr_letsgo發表於2018-05-07

第一步:安裝Ubuntu16.04 server並以stack為使用者名稱建立使用者

第二步:安裝git及相關配置

  • sudo apt-get update
  • sudo apt-get install git-core
  • git config –global user.name “testuser”
  • git config –global user.email “testuser@example.com”
  • sudo apt-get install software-properties-common
  • sudo add-apt-repository cloud-archive:pike

第三步:安裝Open vSwitch 2.5.X

  • apt-cache policy openvswitch-switch ( make sure Candidate is 2.5.x)
  • sudo apt-get install openvswitch-switch
  • sudo ovs-vsctl -V (make sure you have Open vSwitch 2.5.xinstalled)

第四步:獲取devstack指令碼

  • sudo mkdir /opt/stack
  • sudo chown stack:stack /opt/stack
  • cd /opt/stack/
  • git clone git://git.openstack.org/openstack-dev/devstack.git -b stable/pike

第五步:修改部分配置檔案避免訪問國外網站網速過慢

  • github訪問速度過慢:修改/opt/stack/devstack/stackrc 檔案, 找到GIT_BASE=${GIT_BASE:-git://git.openstack.org} 將這一行的源地址改為https://github.com

  • pip 下載速度過慢: 修改pip.conf檔案

找到pip.conf檔案,沒有的話在根目錄下建立.pip目錄,建立pip.conf,並寫入
$ sudo find -name pip.conf

修改該檔案:
[global]

index-url = http://pypi.douban.com/simple

trusted-host=pypi.douban.com

第六步:配置local.conf檔案

注意控制節點和計算節點安裝devstack的不同之處在於該配置檔案內容不同,具體如下:

  • 控制節點
[[local|localrc]]
############################################################
# Customize the following HOST_IP based on your installation
############################################################
MULTI_HOST=True
HOST_IP=192.168.100.30
SERVICE_HOST=192.168.100.30
SERVICE_PASSWORD=devstack
ADMIN_PASSWORD=devstack
SERVICE_TOKEN=devstack
DATABASE_PASSWORD=root
RABBIT_PASSWORD=password
ENABLE_HTTPD_MOD_WSGI_SERVICES=True
KEYSTONE_USE_MOD_WSGI=True

FIXED_RANGE=10.3.3.0/24

#ENABLED_SERVICES=placement-api

# Logging
LOGFILE=$DEST/logs/stack.sh.log
SCREEN_LOGDIR=$DEST/logs/screen
VERBOSE=True
ENABLE_DEBUG_LOG_LEVEL=True
ENABLE_VERBOSE_LOG_LEVEL=True

GIT_BASE=${GIT_BASE:-https://github.com}

USE_BARBICAN=True
TACKER_BRANCH=stable/pike
enable_plugin heat ${GIT_BASE}/openstack/heat $TACKER_BRANCH
enable_plugin networking-sfc ${GIT_BASE}/openstack/networking-sfc $TACKER_BRANCH
enable_plugin barbican ${GIT_BASE}/openstack/barbican $TACKER_BRANCH
enable_plugin mistral ${GIT_BASE}/openstack/mistral $TACKER_BRANCH
enable_plugin tacker https://gitee.com/SINET_gangliu/tacker stable/pike

# vnc config 
NOVA_VNC_ENABLED=True 
NOVNCPROXY_URL="http://$SERVICE_HOST:6080/vnc_auto.html" 
VNCSERVER_LISTEN=$HOST_IP 
VNCSERVER_PROXYCLIENT_ADDRESS=$VNCSERVER_LISTEN
  • 計算節點
[[local|localrc]]

MULTI_HOST=True 
HOST_IP=192.168.100.33  

LOGFILE=/opt/stack/logs/stack.sh.log 

# Credentials 
ADMIN_PASSWORD=devstack
MYSQL_PASSWORD=root
RABBIT_PASSWORD=password
SERVICE_PASSWORD=devstack
SERVICE_TOKEN=devstack

# Service information 
SERVICE_HOST=192.168.100.30 
MYSQL_HOST=192.168.100.30
RABBIT_HOST=192.168.100.30
GLANCE_HOSTPORT=192.168.100.30:9292 
Q_HOST=192.168.100.30
KEYSTONE_AUTH_HOST=192.168.100.30
KEYSTONE_SERVICE_HOST=192.168.100.30 

DATABASE_TYPE=mysql 
ENABLED_SERVICES=placement-client,placement-api,n-cpu,n-api,c-sch,c-api,c-vol,q-agt
#ENABLED_SERVICES=placement-client,placement-api,n-cpu,q-agt,neutron
Q_AGENT=openvswitch

# vnc config 
NOVA_VNC_ENABLED=True 
NOVNCPROXY_URL="http://192.168.100.30:6080/vnc_auto.html" 
VNCSERVER_LISTEN=0.0.0.0 
VNCSERVER_PROXYCLIENT_ADDRESS=$HOST_IP

#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 
GIT_BASE=https://github.com

第七步:分別在控制節點和計算節點執行安裝

cd devstack
./stack.sh

參考文件

  1. Devstack多節點部署實驗
  2. 使用DevStack執行OpenStack Juno多節點安裝過程總結
  3. openstack devstack 指令碼安裝(多結點,計算結點安裝)
  4. Install via Devstack

相關文章