您好,登錄后才能下訂單哦!
????OpenStack部署方式很多,常見的個人部署方式有DevStack、Rdo、all-in-one、multi-node、multi-HA-node等;企業部署方式有Ansible、SaltStack、Puppet、TripleO、Kolla、Fuel等。其中DevStack是眾多開發者們的首選安裝方式或工具,該方式主要是通過配置參數,執行shell腳本來安裝一個OpenStack的開發環境。
????OpenStack開源社區每年都會開兩次設計峰會(Design Summit),發布兩個正式版本。從2010年的首個版本至今,一共已經出了18個版本,每個版本都有獨立名字,取自當次設計峰會所在城市中選一個地名,而且從A開始,然后B、C……。最新的版本是Rocky,字母R正好排序第18位。本文部署的版本為Pike。
本文OpenStack的控制節點和計算節點都是Esxi上新建的虛機,具體配置如下:
控制節點配置:
計算節點配置:
ubuntu安裝詳見:Ubuntu16.04.5以lvm方式安裝全記錄
控制節點和計算節點安裝步驟相同,只是第6步中的配置不同,實際安裝過程中應先裝控制節點再裝計算節點,本文以計算節點安裝為例記錄搭建過程。
1.pip安裝
root@openstack-computer:~#?pip The?program?'pip'?is?currently?not?installed.?You?can?install?it?by?typing: apt?install?python-pip root@openstack-computer:~#?apt?install?-y?python-pip
2.代碼下載
root@openstack-computer:~#?git?clone?https://git.openstack.org/openstack-dev/devstack?-b?stable/pike
本文的安裝版本為pike
3.創建用戶stack
root@openstack-computer:~#?ll total?36 drwx------??4?root?root?4096?Nov?29?17:02?./ drwxr-xr-x?23?root?root?4096?Nov?29?16:32?../ -rw-------??1?root?root???49?Nov?29?16:47?.bash_history -rw-r--r--??1?root?root?3106?Oct?23??2015?.bashrc drwx------??2?root?root?4096?Nov?29?16:47?.cache/ drwxr-xr-x?17?root?root?4096?Nov?29?17:02?devstack/ -rw-r--r--??1?root?root??148?Aug?17??2015?.profile -rw-------??1?root?root?3413?Nov?29?16:51?.viminfo -rw-------??1?root?root??128?Nov?29?16:47?.Xauthority root@openstack-computer:~#?devstack/tools/create-stack-user.sh Creating?a?group?called?stack Creating?a?user?called?stack Giving?stack?user?passwordless?sudo?privileges
4.修改pip源
root用戶修改pip源
root@openstack-computer:~#?mkdir?~/.pip root@openstack-computer:~#?view?~/.pip/pip.conf [global] trusted-host=mirrors.aliyun.com index-url=https://mirrors.aliyun.com/pypi/simple/
stack用戶修改pip源
root@openstack-computer:~#?su?-?stack stack@openstack-computer:~$?mkdir?~/.pip stack@openstack-computer:~$?view?~/.pip/pip.conf [global] trusted-host=mirrors.aliyun.com index-url=https://mirrors.aliyun.com/pypi/simple/
5.移動devstack目錄
將devstack目錄由root的家目錄移至/opt/stack
root@openstack-computer:~#?mv?devstack?/opt/stack root@openstack-computer:~#?chown?-R?stack:stack?/opt/stack/devstack
6.新建配置文件
控制節點:
[[local|localrc]] MULTI_HOST=true #?management?&?api?network HOST_IP=172.27.34.37 LOGFILE=/opt/stack/logs/stack.sh.log #?Credentials ADMIN_PASSWORD=admin MYSQL_PASSWORD=loong576 RABBIT_PASSWORD=loong576 SERVICE_PASSWORD=loong576 SERVICE_TOKEN=loong576 #?enable?neutron-ml2-vlan disable_service?n-net #?Enable?LBaaS?v2 enable_plugin?neutron-lbaas?https://git.openstack.org/openstack/neutron-lbaas?stable/pike enable_plugin?octavia?https://git.openstack.org/openstack/octavia?stable/pike enable_plugin?neutron-lbaas-dashboard?https://git.openstack.org/openstack/neutron-lbaas-dashboard?stable/pike #?enable?FWaaS?v2 enable_plugin?neutron-fwaas?https://git.openstack.org/openstack/neutron-fwaas?stable/pike enable_plugin?neutron-fwaas-dashboard?https://git.openstack.org/openstack/neutron-fwaas-dashboard?stable/pike enable_service?q-lbaasv2,octavia,o-cw,o-hk,o-hm,o-api,q-***,q-fwaas-v2,q-svc,q-agt,q-dhcp,q-l3,q-meta,neutron Q_AGENT=linuxbridge ENABLE_TENANT_VLANS=True TENANT_VLAN_RANGE=3001:4000 PHYSICAL_NETWORK=default #?logging LOG_COLOR=True LOGDIR=$DEST/logs SCREEN_LOGDIR=$LOGDIR/screen #?use?TryStack?git?mirror 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
控制節點ip為:172.27.34.37,admin密碼為admin,后面web登陸會用到。q-***星號為v and p and n
計算節點:
stack@openstack-computer:~$?more?/opt/stack/devstack/local.conf? [[local|localrc]] MULTI_HOST=true #?management?&?api?network HOST_IP=172.27.34.38 #?Credentials ADMIN_PASSWORD=admin MYSQL_PASSWORD=loong576 RABBIT_PASSWORD=loong576 SERVICE_PASSWORD=loong576 SERVICE_TOKEN=loong576 #?Service?information SERVICE_HOST=172.27.34.37 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_AGENT=linuxbridge ENABLE_TENANT_VLANS=True TENANT_VLAN_RANGE=3001:4000 PHYSICAL_NETWORK=default #?vnc?config NOVA_VNC_ENABLED=True NOVNCPROXY_URL="http://$SERVICE_HOST:6080/vnc_auto.html" VNCSERVER_LISTEN=$HOST_IP VNCSERVER_PROXYCLIENT_ADDRESS=$VNCSERVER_LISTEN #?Logging LOG_COLOR=True LOGDIR=$DEST/logs SCREEN_LOGDIR=$LOGDIR/screen #?use?TryStack?git?mirror 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 enable_service?placement-api
HOST_IP=172.27.34.38為計算節點ip
本文中參數Q_AGENT配置為linuxbridge,表示網絡選擇為Linux Bridge方式,如果選擇Open vSwitch,則Q_AGENT=openvswitch。
7.部署openstack
stack@openstack-computer:~/devstack$?./stack.sh
控制節點安裝完成:
計算節點安裝完成:
8.登陸web
地址為:http://172.27.34.37,用戶名密碼為配置文件中的admin/admin
至此完成OpenStack安裝。
9.卸載
若修改了local.conf則需先卸載再重新安裝
卸載命令
stack@openstack-controller:~/devstack$?./unstack.sh stack@openstack-controller:~/devstack$?./clean.sh
搭建腳本已上傳github:https://github.com/loong576/openstack-devstack.git
本文參考:
http://cloudman.cc/
https://docs.openstack.org/devstack/latest/guides/devstack-with-lbaas-v2.html
https://docs.openstack.org/neutron-fwaas-dashboard/latest/contributor/devstack-plugin.html
?
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。