【原創-長文】openstack 版本D安裝配置及本次安裝中遇到的問題

openstack配置

?

一、硬件及操作系統要求

硬件:IBM服務器R410 兩臺、網線、顯示器、鍵盤若干,100M光纖(硬性要求)

操作系統:兩臺服務器均安裝Ubuntu server 12.04 LTS

二、安裝步驟(server-1server-2公共部分)

1.?安裝操作系統:

第一臺主機名server-1;用戶名openstack;密碼admin

第二胎主機名server-2;用戶名openstack;密碼admin

注意事項:

使用光盤安裝操作系統,如采用u盤安裝的方式,會出現“找不到光驅”的錯誤

應盡量選擇使用光盤安裝的方式;

兩臺服務器安裝的語言,最好選擇英文版本,否則在查看系統版本的時候可能會有差別導致下載組件時候出現錯誤,中文版本總是更新不到最新的組件;

兩臺服務器應選擇相同的時區。

2.?配置網絡:

server-1server-2命令行輸入如下命令

sudo vi /etc/network/interfaces

i進入編輯模式

輸入以下內容(server-1):

auto lo

iface lo inet loopback

auto eth0

iface eth0 inet static

?address 218.206.179.205

?netmask 255.255.255.0

?broadcast 218.206.179.255

?gateway 218.206.179.1

?dns-nameservers 218.206.176.4

auto eth1

iface eth1 inet static

?address 10.204.252.168

?netmask 255.255.255.0

?network

?????broadcast

????? gateway 10.204.252.1

輸入以下內容(server-2):

auto lo

iface lo inet loopback

auto eth0

iface eth0 inet static

?address 218.206.179.236

?netmask 255.255.255.0

?broadcast 218.206.179.255

?gateway 218.206.179.1

?dns-nameservers 218.206.176.4

auto eth1

iface eth1 inet static

?address 10.204.252.138

?netmask 255.255.255.0

?network

?????broadcast

????? gateway 10.204.252.1

完成以上兩臺服務器網絡配置之后,按esc,輸入: x

重啟網絡,命令行輸入如下命令

sudo /etc/init.d/networking restart(restart前面有空格)

重啟網絡后,ping一下外網(如qq)測試網絡是否連通

3.?更新

server-1server-2的命令行中輸入如下命令:

sudo apt-get update(軟件列表及依賴更新)

sudo apt-get upgrade(當前列表下軟件版本更新)

4.?安裝NTP時間同步服務器

server-1server-2的命令行中輸入如下命令:

sudo apt-get install ntp

vi打開server-1文件/etc/ntp.conf增加以下三行內容,目的是讓本服務器時間與外部服務器時間同步

server ntp.ubuntu.com

server 127.127.1.0

fudge 127.127.1.0 stratum 10

vi打開server-2文件/etc/ntp.conf 增加一行內容,目的是與server-1同步

server 218.206.179.205(可能有bug

完成后重啟NTP服務,server-1server-2命令行輸入

sudo server ntp restart

5.?安裝bridge

server-1server-2命令行輸入

sudo apt-get -y install bridge-utils

然后重啟網絡

/etc/init.d/networking restart(restart前有空格)

三、server-1安裝

1.安裝RabbitMQMemcache

RabbitMQ是用來做調度使用。Memcache是給Dashboard使用。

命令行輸入

sudo apt-get install -y rabbitmq-server memcached python-memcache kvm libvirt-bin

???????? 2.安裝MySQL數據庫,為了方便起見,使用的MySQL數據庫

?????????????????? 命令行輸入

sudo apt-get install mysql-server python-mysqldb

編輯/etc/mysql/my.cnf, 允許網絡訪問mysql

#bind-address = 127.0.0.1

bind-address = 0.0.0.0(可能有bug

然后重啟mysql服務

restart mysql

?

mysql 根用戶名root 密碼 admin

??????????????????

???????? mysql創建root密碼,在此使用“admin”。隨后編輯mysql配置文件

???????? /etc/mysql/my.cnf,將綁定地址從127.0.0.1改為0.0.0.0,如下所示:

bind-address = 0.0.0.0????

重啟MySQL服務器讓其開始監聽所有端口:

sudo restart mysql

??????????????????

?????????????????? 然后按順序依次輸入以下命令:

?????????????????? mysql -uroot -p123456

CREATE DATABASE nova;

GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY '123456';

CREATE DATABASE glance;

GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY '123456';

CREATE DATABASE keystone;

GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%'IDENTIFIED BY '123456';

quit

注意:以上分號不要省略

doc版本有個user的創建,步驟未執行

?

???????? 3 安裝keystone

?????????????????? 命令行輸入:

sudo apt-get install keystone python-keystone python-keystoneclient

vi編輯器編輯/etc/keystone/keystone.conf文件如下:

[DEFAULT]

#bind_host = 0.0.0.0

public_port = 5000

admin_port = 35357

#admin_token = ADMIN

admin_token = admin

[sql]

#connection = sqlite:var/lib/keystone/keystone.db

connection = mysql://keystone:123456@218.206.179.205/keystone (這兒改成server-1ip

然后重啟服務、同步數據庫,命令行輸入:

sudo service keystone restart

sudo keystone-manage db_sync

?

導入數據和endpoint

為了方便,你可以直接使用下面2個腳本來進行全部的設置

1.keystone_data.sh 導入用戶信息-創建租戶用戶和角色

Keystone Data

wget http://www.chenshake.com/wp-content/uploads/2012/07/keystone_data.sh_.txt

mv keystone_data.sh_.txt keystone_data.sh

chmod +x keystone_data.sh

然后編輯keystone_data.sh

第一行是登陸dashboard的密碼。

第三行是上面設置的KeystoneToken

注意 sh文件對應的位置改成如下加黑的部分。

ADMIN_PASSWORD=${ADMIN_PASSWORD:-123456}

SERVICE_PASSWORD=${SERVICE_PASSWORD:-$ADMIN_PASSWORD}

export SERVICE_TOKEN="admin"

export SERVICE_ENDPOINT="http://localhost:35357/v2.0"

SERVICE_TENANT_NAME=${SERVICE_TENANT_NAME:-service}

ENABLED_SERVICES="swift"

?

然后運行腳本

./keystone_data.sh

沒任何輸出,就表示正確,可以通過下面命令檢查

echo $?

顯示0,就表示腳本正確運行,千萬不要重復運行腳本

?

?

2.endpoints.sh 設置endpoint--提供服務的入口點

命令行輸入如下

wget http://www.chenshake.com/wp-content/uploads/2012/07/endpoints.sh_.txt

mv endpoints.sh_.txt endpoints.sh

chmod +x endpoints.sh

再輸入:

./endpoints.sh -m 218.206.179.205 -u keystone -D keystone -p 123456 -T admin -K 218.206.179.205 -R RegionOne -E "http://localhost:35357/v2.0" -S 218.206.179.205

以上縮寫分別代表如下信息

-m mysql_hostname

-u mysql_username

-D mysql_database

-p mysql_password

-K keystone 服務器IP

-R keystone_region

-E keystone_endpoint_url

-S swift proxy節點IP

-T keystone_token

?

export OS_TENANT_NAME=admin

export OS_USERNAME=admin

export OS_PASSWORD=123456

export OS_AUTH_URL=http://localhost:5000/v2.0/

然后檢查環境變量,在命令行輸入:

export | grep OS_

會顯示:

declare -x OS_AUTH_URL="http://localhost:5000/v2.0/"

declare -x OS_PASSWORD="123456"

declare -x OS_TENANT_NAME="admin"

declare -x OS_USERNAME="admin"

?

報錯:修改keystone_data.sh的時候,不影響使用

查看各種列表:

keystone endpoint-list

keystone tenant-list

keystone user-list

keystone role-list

4.安裝glance

?????????????????? 命令行輸入:

sudo apt-get install glance glance-api glance-client glance-common glance-registry python-glance

編輯 /etc/glance/glance-api-paste.ini/etc/glance/glance-registry-paste.ini,兩個文件,都是修改文檔最后3行,改成如下的內容

#admin_tenant_name = %SERVICE_TENANT_NAME%

#admin_user = %SERVICE_USER%

#admin_password = %SERVICE_PASSWORD%

admin_tenant_name = service

admin_user = glance

admin_password = 123456

#dashboard password

編輯/etc/glance/glance-registry.conf,改成使用mysql驗證

#sql_connection = sqlite:var/lib/glance/glance.sqlite

sql_connection = mysql://glance:123456@122.204.144.201/glance

編輯/etc/glance/glance-registry.conf /etc/glance/glance-api.conf ,都在文件末尾添加兩行,目的是讓glance使用keystone授權

[paste_deploy]

flavor = keystone
然后同步數據庫

sudo glance-manage version_control 0

sudo glance-manage db_sync

注意:如果有輸出的話多打幾遍命令

上述改動全部完成后,重啟glance-apiglance-registry服務:

sudo restart glance-api

sudo restart glance-registry

設置如下環境變量,將其寫入 ~/.bashrc中:

export SERVICE_TOKEN=admin

export OS_TENANT_NAME=admin

export OS_USERNAME=admin

export OS_PASSWORD=admin

export OS_AUTH_URL="http://localhost:5000/v2.0/"

export SERVICE_ENDPOINT=http://localhost:35357/v2.0

然后測試一下,命令行輸入如下命令,沒有輸出,表示正常,因為目前還沒有鏡像。

glance index

5.?????? 安裝nova

命令行輸入:下面的命令需要一起復制,是一條命令

apt-get install nova-api nova-cert nova-compute nova-compute-kvm nova-doc

nova-network nova-objectstore nova-scheduler nova-volume rabbitmq-server novnc nova-consoleauth

??????????????? 編輯/etc/nova/nova.conf 文件,改成如下內容,ip根據自己的主機修改成如下格式

--dhcpbridge_flagfile=/etc/nova/nova.conf

--dhcpbridge=/usr/bin/nova-dhcpbridge

--logdir=/var/log/nova

--state_path=/var/lib/nova

--lock_path=/run/lock/nova

--allow_admin_api=true

--use_deprecated_auth=false

--auth_strategy=keystone

--scheduler_driver=nova.scheduler.simple.SimpleScheduler

--s3_host=218.206.179.205

--ec2_host=218.206.179.205

--rabbit_host=218.206.179.205

--cc_host=218.206.179.205

--nova_url=http://218.206.179.205:8774/v1.1/

--routing_source_ip=218.206.179.205

--glance_api_servers=218.206.179.205:9292

--image_service=nova.image.glance.GlanceImageService

--iscsi_ip_prefix=10.204.252

--sql_connection=mysql://nova:123456@218.206.179.205/nova

--ec2_url=http://218.206.179.205:8773/services/Cloud

--keystone_ec2_url=http://218.206.179.205:5000/v2.0/ec2tokens

--api_paste_config=/etc/nova/api-paste.ini

--libvirt_type=kvm

--libvirt_use_virtio_for_bridges=true

--start_guests_on_host_boot=true

--resume_guests_state_on_host_boot=true

# vnc specific configuration

--novnc_enabled=true

--novncproxy_base_url=http://218.206.179.205:6080/vnc_auto.html

--vncserver_proxyclient_address=218.206.179.205

--vncserver_listen=218.206.179.205

# network specific settings

--network_manager=nova.network.manager.FlatDHCPManager

--public_interface=eth0

--flat_interface=eth1

--flat_network_bridge=br100

--fixed_range=10.204.252.158/25

--floating_range=218.206.179.205/25

--network_size=32

--flat_network_dhcp_start=10.204.252.198

--flat_injected=False

--force_dhcp_release

--iscsi_helper=tgtadm

--connection_type=libvirt

--root_helper=sudo nova-rootwrap

--verbose

?????? 創建一個物理卷

sudo pvcreate /dev/sda3(此卷是本次安裝中出現的,具體情況按安裝的時候來)

然后輸入:

sudo vgcreate nova-volumes /dev/sda3

修改 /etc/nova文件夾的屬主及 /etc/nova/nova.conf文件的訪問權限:

sudo chown -R nova:nova /etc/nova

sudo chmod 644 /etc/nova/nova.conf

進入 /etc/nova/api-paste.ini文件,找到末尾三行:

admin_tenant_name = %SERVICE_TENANT_NAME%

admin_user = %SERVICE_USER%

admin_password = %SERVICE_PASSWORD%

用之前創建的名字進行替換編輯完畢如下所示:

admin_tenant_name = service

admin_user = nova

admin_password = nova

MySQL數據庫進行同步:

sudo nova-manage db sync

為實例提供IP池:

sudo nova-manage network create private --fixed_range_v4=10.204.252.158/25--num_networks=1 --bridge=br100 --bridge_interface=eth1 --network_size=128

輸出環境變量:

export OS_TENANT_NAME=admin

export OS_USERNAME=admin

export OS_PASSWORD=admin

export OS_AUTH_URL="http://localhost:5000/v2.0/"

???????? 重啟服務,命令行一次輸入以下命令

???????? sudo restart libvirt-bin

sudo restart nova-network

sudo restart nova-compute

sudo restart nova-api

sudo restart nova-objectstore

sudo restart nova-scheduler

sudo restart nova-volume

sudo restart nova-consoleauth

測試nova是否正確安裝,若所有組件都是微笑,說明nova已經正確安裝完畢。

sudo nova-manage service list

?

6.?????? OpenStack管理面板

執行下列命令安裝管理面板:

sudo apt-get install openstack-dashboard

重啟Apache

sudo service apache2 restart

?

?

live cd啟動系統,進入圖形化安裝界面,選擇試用ubuntu,進入桌面打開ubuntu自帶分區軟件,將原來的大分區分割成兩個小的分區,下一步要將分出來的新分區格式化為LVM8e)格式的分區,打開終端,輸入 :sudo fdisk -l,根據剛才分給的大小判斷新分區的磁盤號,再輸入sudo fdisk /dev/sd*(星號具體根據前一條命令中來定),然后在fdisk命令下輸入t,選擇剛創建好的分區,輸入8e,將剛創建好的2個分區轉換為8e格式。輸入w保存退出,之后運行一下partprobe 命令激活剛創建的分區

?

sudo restart libvirt-bin; sudo restart nova-network; sudo restart nova-compute; sudo restart nova-api; sudo restart nova-objectstore; sudo restart nova-scheduler; sudo restart nova-volume; sudo restart nova-consoleauth; 如果不行 restart換成start

?

apache2 restart失敗

編輯 /etc/apache2/apache2.conf

最后一行輸入 ServerName 127.0.7.1(不一定有用)

?

轉載于:https://www.cnblogs.com/xiawen/archive/2013/06/04/3116990.html

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

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

相關文章

基于pt100溫度計仿真_基于8pt網格的設計系統

基于pt100溫度計仿真重點 (Top highlight)This article is the 2nd in a two part series — to the previous chapter in which I demonstrate how to establish an 8pt grid.本文是該系列文章的第二部分 ,這是上一章 的第二部分 ,在上一章中&#xff0…

GL ERROR - after deleteUnusedTextures() glError (0x502)

最近用百度提供的javascript API開發地圖時,html頁面在手機瀏覽器中拖動地圖時會出現GL ERROR - after deleteUnusedTextures() glError (0x502)的異常,看了下國外論壇異常的說法,經調試,找出解決辦法,異常原因還是和布…

利用 k8s 建立軟件商店_為企業建立應用商店

利用 k8s 建立軟件商店It’s June 2019. I’m sitting in a conference room in Research Triangle Park in North Carolina. At the end of the table are the two executives that have been tapped to lead a new endeavor on behalf of IBM’s $34 billion acquisition of …

[轉]gcc生成動態庫靜態庫

http://blog.csdn.net/hzn407487204/article/details/5323254轉載于:https://www.cnblogs.com/hengli/archive/2013/06/07/3125354.html

蘋果復興_類型復興的故事:來自Type West的經驗教訓

蘋果復興Last Fall, I began the 去年秋天,我開始 在舊金山的Type West program at the Letterform檔案庫中Letterform Archive in San Francisco. For those of you who don’t know, the Letterform Archive is creative heaven — a type nerd’s letter art co…

C#調用ATL COM

作者:朱金燦 來源:http://blog.csdn.net/clever101 簡單介紹C#程序如何調用ATL編寫的COM組件。 首先新建一個ATL工程,具體如下: 1. 填寫工程名稱和路徑,如下圖: 2. 選擇工程的服務器類型為動態鏈接庫&a…

浪潮世科和浪潮軟件什么關系_社交圖形浪潮

浪潮世科和浪潮軟件什么關系Nowadays, the cornucopia of graphics seems like a given. However, it was not so long ago that infographics were scarce and lived in closed ecosystems. The majority of graphics were published in newspapers, magazines, or books, and…

PHP圖形圖像的典型應用 --常用圖像的應用(驗證碼)

php生成動態的驗證碼&#xff0c;是php防止惡意登陸或者注冊等常規手段-廢話不多說&#xff0c;直接看例子。&#xff08;只是一個簡單的應用&#xff0c;如果要安全或者更復雜的&#xff0c;請期待我以后的文章&#xff09; PHP生成驗證碼核心文件 (checks.php): <?php/*成…

接口練習

前臺代碼&#xff1a; <form id"form1" runat"server"> <div> 見面時間:<asp:TextBox ID"MeetTime" runat"server"></asp:TextBox><br /> 見面地點:<asp:TextBox ID"MeetAddr…

寫saas創業的書_我在SaaS創業公司擔任UX設計師的第一個月中學到的三件事

寫saas創業的書I recently transitioned from being a copywriter at an ad agency to a UX Designer at a SaaS startup. To add more multidisciplinary skills into the mix, I graduated with a Bachelor in Accountancy.我最近從一名廣告代理商的撰稿人過渡到了SaaS初創公…

ui項目答辯中學到了什么_我在UI設計9年中學到的12件事

ui項目答辯中學到了什么重點 (Top highlight)I know these can seem a bit clich but I will try to explain everything from my own experience.我知道這些內容似乎有些陳詞濫調&#xff0c;但我會嘗試根據自己的經驗來解釋所有內容。 第一名 (No.1 Never assume) The first…

linux下命令行的使用:使用sed命令操作文件

用該命令sed刪除文件test.txt中包含某個字符串abc的行: sed /adc/d test.txt >result.txt 在文件test.txt中刪除從開頭到含有某個字符串abc的行 sed 1,/abc/d test.txt >result.txt 獲取文件test.txt中包含字符串abc的行 cat test.txt |grep "abc" > resul…

ux的重要性_UX中清晰的重要性

ux的重要性重點 (Top highlight)Times, since the very first occurrences of web design in the 90’s, have changed a lot design-wise. The particular technology and its applications got more stable. Human-computer interaction (HCI) was deeply researched, design…

工欲善其事,必先利其器

vs2010中一些常用的快捷鍵、組合鍵&#xff1a; 1、快速格式化 CtrlED 2、注釋選中部分 CtrlEC 3、停止調試 ShiftF5 4、取消注釋選中部分 CtrlEU 5、顯示解決方案資源管理器 CtrlWS 6、快速折疊 CtrlMO 7、封裝一個字段 CtrlRE 8、查看屬性 CtrlWP 9…

可靠消息最終一致性設計_如何最終啟動您的設計產品組合

可靠消息最終一致性設計It’s not a secret that most designers procrastinate on their portfolios whether it is to update them or to create them in the first place.大多數設計師在更新產品組合時還是拖延產品組合并不是秘密。 首先創建它們 。 Hopefully, by the e…

臺式機共享筆記本的無線網絡(只需要一根網線)

以windowsXP系統為例 一、筆記本的設置方法&#xff1a; 1.先將筆記本的無線連接共享給有線網卡 將鼠標放到桌面的 網上鄰居 上&#xff0c;按鼠標右鍵&#xff0c;選屬性&#xff0c;再將鼠標放到無線連接上&#xff0c;又是按鼠標右鍵&#xff0c;選屬性&#xff0c;在彈出的…

游戲用戶體驗指標_電子游戲如何超越游戲化的用戶體驗

游戲用戶體驗指標游戲UX (GAMES UX) During a time when the time spent on video games has reached record breaking heights, due to excessive time indoors, gamification has more of a place now than ever before.d uring的時候花在視頻游戲的時間已經達到了 破紀錄的高…

JAVA編程心得-JAVA實現CRC-CCITT(XMODEM)算法

CRC即循環冗余校驗碼&#xff08;Cyclic Redundancy Check&#xff09;&#xff1a;是數據通信領域中最常用的一種差錯校驗碼&#xff0c;其特征是信息字段和校驗字段的長度可以任意選定。 1 byte checksum CRC-16 CRC-16 (Modbus) CRC-16 (Sick) …

什么字體字母和數字大小一樣_字母和字體如何適應我們的屏幕

什么字體字母和數字大小一樣Writing went through many iterations before it became what is today. Times New Roman wasn’t the default script for ancient Egyptians, in fact, paper didn’t even exist when the first words were written.寫作經歷了許多迭代&#xff…

jenkins 通過批處理自動構建 非標準項目

之前介紹了java和vs2010的項目構建&#xff0c;這些都是比較常見的&#xff0c;所以都用專門的工具。但但難免會遇到一些不常見的項目&#xff0c;下面介紹通過批處理進行構建&#xff0c;并用jenkins調用.我們這里使用plc語言&#xff0c;沒有標準環境&#xff0c;只有使用bat…