OpenStack —— DevStack一鍵自動化安裝

一、DevStack介紹

? ? Devstack目前是支持Ubuntu16.04和CentOS 7,而且Devstack官方建議使用Ubuntu16.04,所以我們使用Ubuntu 16.04進行安裝。

? ? 默認無論是Devstack和OpenStack,都是采用Master的代碼進行安裝,這樣經常會出現,今天安裝成功,明天失敗,代碼時刻在變化。所以我們不僅僅要指定OpenStack的版本,還需要指定Devstack的版本,才能提供安裝成功的概率。

二、DevStack的安裝

1、環境準備

? ? 我使用的操作系統為Ubuntu 16.04的版本,默認的軟件包源是國外的,速度相對來說比較慢,所以我們修改文件/etc/apt/sources.list,使用如下命令更改:

sed?-i?'s/us.archive.ubuntu.com/cn.archive.ubuntu.com/g'?/etc/apt/sources.list
sed?-i?'s/security.ubuntu.com/cn.archive.ubuntu.com/g'?/etc/apt/sources.list

? ?更新一下源。

apt-get?update

2、下載devstack

? ? 安裝devstack痛苦的其中一個原因,是OpenStack代碼,都需要從github下載,這樣由于網絡的原因,經常導致各種錯誤,簡直讓人崩潰,各種錯誤,目前國內已經提供了完整的OpenStack的github的mirror:http://git.trystack.cn,這樣Devstack成功概率會大大提高。

? ? 另外devstack還會下載image,下載的過程也是非常緩慢。trystack也提供大家常用的image下載:http://images.trystack.cn。

? ? 目前官方github上面保留著三個穩定的版本,我們這邊安裝Ocata版。

apt-get?install?git
git?clone?http://git.trystack.cn/openstack-dev/devstack.git?-b?stable/ocata

3、創建stack用戶

? ? 目前Devstack腳本已經不支持直接使用root身份運行,你需要創建stack用戶運行。

cd?devstack/tools/
./create-stack-user.sh

? ?修改devstack目錄權限,讓stack用戶可以運行。

cd?../..
mv?devstack?/opt/stack?
chown?-R?stack:stack?/opt/stack/devstack

4、配置pip源

? ? OpenStack很多組件需要從pip源下載,默認是國外的源,我們需要設置為國內的源,以便可以快速的進行配置,在root和stack的加目錄下面都配置一下。

? ? 首先分別在家目錄下面都創建.pip的目錄,然后在目錄下面創建文件pip.conf,內容如下:

mkdir?.pip
cat?>>?.pip/pip.conf?<<EOF
[global]
trusted-host?=??pypi.douban.com
index-url?=?http://pypi.douban.com/simple
EOF

5、配置文件

su?-?stack
cd?devstack
cp?samples/local.conf?.

? ?對文件local.conf進行簡單修改,如下內容:

[[local|localrc]]
ADMIN_PASSWORD=secret
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
LOGFILE=$DEST/logs/stack.sh.log
LOGDAYS=2
SWIFT_HASH=66a3d6b56c1f479c8b4e70ab5c2000f5
SWIFT_REPLICAS=1
SWIFT_DATA_DIR=$DEST/data#?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

6、安裝

? ? 中途可能會出現多次錯誤,大部分都是因為網絡的原因,重復運行命令即可。

./stack.sh

三、驗證

? ? 經過長時間的等待之后,根據網絡狀態,大約1個小時的時間,出現下面的界面即可是安裝完成。

wKiom1nODQugEd_9AADjRoQLG8o900.jpg

? ?然后我們進行登錄查看。

wKioL1nODUHjUqhZAAA-KN85XG4753.jpg

? ? 可以看到登錄成功,服務都運行正常。

wKioL1nODWvREMMpAAG_Ca61RRI061.jpg

附錄:

1、All-In-One Single Machine

[[local|localrc]]
FLOATING_RANGE=192.168.1.224/27
FIXED_RANGE=10.11.12.0/24
FIXED_NETWORK_SIZE=256
FLAT_INTERFACE=eth0
ADMIN_PASSWORD=secret
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD#?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
  • Set?FLOATING_RANGE?to a range not used on the local network, i.e. 192.168.1.224/27. This configures IP addresses ending in 225-254 to be used as floating IPs.

  • Set?FIXED_RANGE?and?FIXED_NETWORK_SIZE?to configure the internal address space used by the instances.

  • Set?FLAT_INTERFACE?to the Ethernet interface that connects the host to your local network. This is the interface that should be configured with the static IP address mentioned above.

  • Set the administrative password. This password is used for the?admin?and?demo?accounts set up as OpenStack users.

  • Set the MySQL administrative password. The default here is a random hex string which is inconvenient if you need to look at the database directly for anything.

  • Set the RabbitMQ password.

  • Set the service password. This is used by the OpenStack services (Nova, Glance, etc) to authenticate with Keystone.


2、Multi-Node Lab

Configure Cluster Controller

[[local|localrc]]
HOST_IP=192.168.42.11
FLAT_INTERFACE=eth0
FIXED_RANGE=10.4.128.0/20
FIXED_NETWORK_SIZE=4096
FLOATING_RANGE=192.168.42.128/25
MULTI_HOST=1
LOGFILE=/opt/stack/logs/stack.sh.log
ADMIN_PASSWORD=secret
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD#?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

Configure Compute Nodes

[[local|localrc]]
HOST_IP=192.168.42.12????#?change?this?per?compute?node
FLAT_INTERFACE=eth0
FIXED_RANGE=10.4.128.0/20
FIXED_NETWORK_SIZE=4096
FLOATING_RANGE=192.168.42.128/25
MULTI_HOST=1
LOGFILE=/opt/stack/logs/stack.sh.log
ADMIN_PASSWORD=secret
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
DATABASE_TYPE=mysql
SERVICE_HOST=192.168.42.11
MYSQL_HOST=$SERVICE_HOST
RABBIT_HOST=$SERVICE_HOST
GLANCE_HOSTPORT=$SERVICE_HOST:9292
ENABLED_SERVICES=n-cpu,q-agt,n-api-meta,c-vol,placement-client
NOVA_VNC_ENABLED=True
NOVNCPROXY_URL="http://$SERVICE_HOST:6080/vnc_auto.html"
VNCSERVER_LISTEN=$HOST_IP
VNCSERVER_PROXYCLIENT_ADDRESS=$VNCSERVER_LISTEN#?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



另外一個模板

devstack-controller

[[local|localrc]]
MULTI_HOST=true?
HOST_IP=172.18.2.100?#?management?&?api?network?
LOGFILE=/opt/stack/logs/stack.sh.log
#?Credentials?
ADMIN_PASSWORD=secret
MYSQL_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
SERVICE_TOKEN=abcdefghijklmnopqrstuvwxyz
#?enable?neutron-ml2-vlan?
disable_service?n-net?
enable_service?q-svc,q-agt,q-dhcp,q-l3,q-meta,neutron,q-lbaas,q-fwaas,q-***?
Q_AGENT=linuxbridge?
ENABLE_TENANT_VLANS=True?
TENANT_VLAN_RANGE=3001:4000?
PHYSICAL_NETWORK=default
LOG_COLOR=False?
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

devstack-compute

[[local|localrc]]
MULTI_HOST=true?
HOST_IP=172.18.2.101?#?management?&?api?network
#?Credentials?
ADMIN_PASSWORD=secret
MYSQL_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
SERVICE_TOKEN=abcdefghijklmnopqrstuvwxyz
#?Service?information
SERVICE_HOST=172.18.2.100
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
CEILOMETER_BACKEND=mongodb?
DATABASE_TYPE=mysql
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
LOG_COLOR=False?
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

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? wKioL1nODYiDRQSxAACmb4CVfN4311.jpg

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/540551.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/540551.shtml
英文地址,請注明出處:http://en.pswp.cn/news/540551.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

[轉載] Python學習筆記——運維和Shell

參考鏈接&#xff1a; 在C / C&#xff0c;Python&#xff0c;PHP和Java中交換兩個變量 目錄 什么是運維 運維第一工具-shell編程 shell歷史 執行腳本 基本語法 Shell腳本語法 條件測試&#xff1a;test [ if/then/elif/else/fi case/esac for/do/done …

scala java混合_Scala特性混合

scala java混合Scala | 特性混合 (Scala | Trait Mixins ) In Scala, the number of traits can be extended using a class or an abstract class. This is known as Trait Mixins. For extending, only traits, the blend of traits, class or abstract class are valid. If …

Scala鑄造

Scala中的類型 (Types in Scala) Type also know as data type tells the compiler about the type of data that is used by the programmer. For example, if we initialize a value or variable as an integer the compiler will free up 4 bytes of memory space and it wi…

/ 卡路里_最大卡路里

/ 卡路里Problem statement: 問題陳述&#xff1a; Shivang is very foodie but he has a diet plan. He has an array of elements indicating the calorie of food he can consume on that day. In his diet plan, he can’t eat on for three consecutive days. But since …

[轉載] Python類中的私有變量和公有變量

參考鏈接&#xff1a; Python中的私有變量 我們這里就直奔主題&#xff0c;不做基礎鋪墊&#xff0c;默認你有一些Python類的基礎&#xff0c;大家在看這篇博客的時候&#xff0c;如果基礎知識忘了&#xff0c;可以去菜鳥教程 從一個簡單的類開始 class A(): #定義一…

OpenCV探索之路(二十五):制作簡易的圖像標注小工具

搞圖像深度學習的童鞋一定碰過圖像數據標注的東西&#xff0c;當我們訓練網絡時需要訓練集數據&#xff0c;但在網上又沒有找到自己想要的數據集&#xff0c;這時候就考慮自己制作自己的數據集了&#xff0c;這時就需要對圖像進行標注。圖像標注是件很枯燥又很費人力物力的一件…

固件的完整形式是什么?

FW&#xff1a;前進 (FW: Forward) FW is an abbreviation of "Forward". FW是“ Forward”的縮寫 。 It is an expression, which is commonly used in Gmail or messaging platform. It is also written as FWD or Fwd or Fw. It shows that the email has been s…

[轉載] python __slots__ 詳解(上篇)

參考鏈接&#xff1a; Python的__name __(特殊變量) python中的new-style class要求繼承Python中的一個內建類型&#xff0c; 一般繼承object&#xff0c;也可以繼承list或者dict等其他的內建類型。 在python新式類中&#xff0c;可以定義一個變量__slots__&#xff0c;它的作…

委托BegionInvoke和窗體BegionInvoke

委托BegionInvoke是指通過委托方法執行多線程任務&#xff0c;例如&#xff1a; //定義委托成員變量 delegate void dg_DeleAirport(); //指定委托函數 dg_DeleAirport dga AirportBLL.DeleteHistoryTransAirport; //通過BeginInvoke以異步線程方式執行委托函數&#xff0c;可…

圖論 弦_混亂的弦

圖論 弦Problem statement: 問題陳述&#xff1a; You are provided an input string S and the string "includehelp". You need to figure out all possible subsequences "includehelp" in the string S? Find out the number of ways in which the s…

[轉載] Python列表操作

參考鏈接&#xff1a; Python中的基本運算符 Python列表&#xff1a; 序列是Python中最基本的數據結構。序列中的每個元素都分配一個數字 - 它的位置&#xff0c;或索引&#xff0c;第一個索引是0&#xff0c;第二個索引是1&#xff0c;依此類推&#xff1b; Python有6個序列的…

「原創」從馬云、馬化騰、李彥宏的對話,看出三人智慧差在哪里?

在今年中國IT領袖峰會上&#xff0c;馬云、馬化騰、李彥宏第一次單獨合影&#xff0c;同框畫面可以說很難得了。BAT關心的走勢一直是同行們競相捕捉的熱點&#xff0c;所以三位大Boss在這次大會上關于人工智能的見解&#xff0c;也受到廣泛關注與多方解讀。馬云認為機器比人聰明…

python 注釋含注釋_Python注釋

python 注釋含注釋Python注釋 (Python comments) Comments in Python are used to improve the readability of the code. It is useful information given by the programmer in source code for a better understanding of code and logic that they have used to solve the …

C2的完整形式是什么?

C2&#xff1a;核心2 (C2: Core 2) C2 is an abbreviation of "Core 2" or "Intel Core 2". C2是“ Core 2”或“ Intel Core 2”的縮寫 。 It is a family of Intels processor which was launched on the 27th of July, 2006. It comprises a series of…

scala特性_Scala | 特性應用

scala特性特性應用 (Trait App) Scala uses a trait called "App" which is used to convert objects into feasible programs. This conversion is done using the DelayedInit and the objects are inheriting the trait named App will be using this function. T…

[轉載] Python3中的表達式運算符

參考鏈接&#xff1a; Python中的除法運算符 1&#xff1a;Python常用表達式運算符 yield 生成器函數send協議 lambda args:expression 創建匿名函數 x if y else z 三元選擇表達式(當y為真時&#xff0c;x才會被計算) x or y 邏輯或(僅但x為假時y才會被計算) x and …

字符串矩陣轉換成長字符串_字符串矩陣

字符串矩陣轉換成長字符串Description: 描述&#xff1a; In this article, we are going to see how backtracking can be used to solve following problems? 在本文中&#xff0c;我們將看到如何使用回溯來解決以下問題&#xff1f; Problem statement: 問題陳述&#xf…

pythonchallenge_level2

level2 地址&#xff1a;http://www.pythonchallenge.com/pc/def/ocr.html。 源碼&#xff1a;gitcode.aliyun.com:qianlizhixing12/PythonChallenge.git。 問題&#xff1a;找出頁面源碼一點提示注釋中的稀有字符。 #!/usr/bin/env python3 # -*- coding:UTF-8 -*-# Level 2im…