物理機操做系統:ubuntu-16.04.4-server-amd64
controller:192.168.18.61 ubuntu61
compute:192.168.18.62 ubuntu62
compute:192.168.18.63 ubuntu63html
vi /etc/apt/source.list
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiversehtml5
apt-get updatepython
apt-get install python-pip
檢驗是否安裝成功:pip -Vgit
cd /home
git clone https://git.openstack.org/openstack-dev/devstack -b stable/pike
國內源
git clone https://git.openstack.org/openstack-dev/devstack -b stable/pikeubuntu
cd /home/devstack/tools/ ./create-stack-user.sh cd /home/ mv devstack /opt/stack chown -R stack:stack /opt/stack/devstack chmod 777 /dev/pts/0
分別爲root和stack用戶設置使用國內的pip源api
mkdir ~/.pip vi ~/.pip/pip.conf [global] index-url = https://pypi.douban.com/simple download_cache = ~/.cache/pip [install] use-mirrors = true mirrors = http://pypi.douban.com/
su - stack $ mkdir ~/.pip $ vi ~/.pip/pip.conf [global] index-url = https://pypi.douban.com/simple download_cache = ~/.cache/pip [install] use-mirrors = true mirrors = http://pypi.douban.com/
cd /opt/stack/devstack vi local.conf [[local|localrc]] 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 #初次安裝設置true,重複安裝設置爲False #RECLONE=False RECLONE=True MULTI_HOST=true HOST_IP=192.168.18.61 LOGFILE=/opt/stack/logs/stack.sh.log ADMIN_PASSWORD=123456 MYSQL_PASSWORD=123456 RABBIT_PASSWORD=123456 SERVICE_PASSWORD=123456 SERVICE_TOKEN=abcdefghijklmnopqrstuvwxyz disable_service n-net enable_service q-svc enable_service q-agt enable_service q-dhcp enable_service q-l3 enable_service q-meta enable_service q-metering enable_service neutron Q_USE_SECGROUP=True FLOATING_RANGE="192.168.18.0/24" FIXED_RANGE="10.0.0.0/24" Q_FLOATING_ALLOCATION_POOL=start=192.168.18.220,end=192.168.18.230 PUBLIC_NETWORK_GATEWAY="192.168.18.3" Q_L3_ENABLED=True PUBLIC_INTERFACE=enp7s0f0 Q_USE_PROVIDERNET_FOR_PUBLIC=True OVS_PHYSICAL_BRIDGE=br-ex PUBLIC_BRIDGE=br-ex OVS_BRIDGE_MAPPINGS=public:br-ex Q_PLUGIN=ml2 ENABLE_TENANT_VLANS=True LOG_COLOR=True LOGDIR=/opt/stack/logs SCREEN_LOGDIR=$LOGDIR/screen chown -R stack:stack /opt/stack/devstack/local.conf
su - stack cd devstack/ ./stack.sh
中間若是出錯
./unstack.sh 後從新安裝
仍是出錯,
./clean.sh 後從新安裝ide
安裝完成輸出
=========================
DevStack Component Timing
=========================
Total runtime 3375url
run_process 15 test_with_retry 6 apt-get-update 11 pip_install 756 osc 237 wait_for_service 25 git_timed 546 dbsync 239 apt-get 361 ========================= This is your host IP address: 192.168.18.61 This is your host IPv6 address: ::1 Horizon is now available at http://192.168.18.61/dashboard Keystone is serving at http://192.168.18.61/identity/ The default users are: admin and demo The password: 123456
同controller節點操做一致:spa
更新apt源 安裝 python-pip 下載devstack 建立stack用戶 設置pip的鏡像源
編輯local.conf操作系統
cd /opt/stack/devstack vi local.conf [[local|localrc]] 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 RECLONE=False MULTI_HOST=true HOST_IP=192.168.18.62 LOGFILE=/opt/stack/logs/stack.sh.log ADMIN_PASSWORD=123456 MYSQL_PASSWORD=123456 RABBIT_PASSWORD=123456 SERVICE_PASSWORD=123456 SERVICE_TOKEN=abcdefghijklmnopqrstuvwxyz SERVICE_HOST=192.168.18.61 MYSQL_HOST=$SERVICE_HOST RABBIT_HOST=$SERVICE_HOST GLANCE_HOSTPORT=$SERVICE_HOST:9292 Q_HOST=$SERVICE_HOST KEYSTONE_AUTH_HOST=$SERVICE_HOST KEYSTONE_SERVICE_HOST=$SERVICE_HOST ENABLED_SERVICES=n-cpu,q-agt,neutron Q_PLUGIN=ml2 ENABLE_TENANT_VLANS=True NEUTRON_CREATE_INITIAL_NETWORKS=False enable_service placement-api NOVA_VNC_ENABLED=True NOVNCPROXY_URL="http://$SERVICE_HOST:6080/vnc_auto.html" VNCSERVER_LISTEN=$HOST_IP VNCSERVER_PROXYCLIENT_ADDRESS=$VNCSERVER_LISTEN LOG_COLOR=True disable_service tempest
切換到stack用戶,執行安裝腳本
su - stack
cd devstack/
./stack.sh
安裝完成輸出
========================= DevStack Component Timing ========================= Total runtime 275 run_process 4 apt-get-update 8 pip_install 109 osc 14 wait_for_service 16 apt-get 28 ========================= This is your host IP address: 192.168.18.62 This is your host IPv6 address: ::1 WARNING: Using lib/neutron-legacy is deprecated, and it will be removed in the future Services are running under systemd unit files. For more information see: https://docs.openstack.org/devstack/latest/systemd.html DevStack Version: pike Change: 73d848772186bf674e12f6253263aed9e164413a Merge "Bump the Cinder LVM backing file size to 24Gb." into stable/pike 2018-04-21 05:10:38 +0000 OS Version: Ubuntu 16.04 xenial
最後,要讓計算節點註冊在控制節點上運行
root@ubuntu61:/opt/stack/devstack/tools# ./discover_hosts.sh