亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
12345下一頁
最近訪問板塊 發(fā)新帖
查看: 72685 | 回復: 47
打印 上一主題 下一主題

[OpenStack] 跟著官方文檔一步一步架設openstack [復制鏈接]

論壇徽章:
7
雙子座
日期:2013-09-09 15:55:31CU大;照
日期:2013-09-18 15:22:06CU大;照
日期:2013-09-18 15:22:20CU大牛徽章
日期:2013-09-18 15:22:26CU大牛徽章
日期:2013-09-18 15:22:31CU大;照
日期:2013-09-18 15:22:37CU大;照
日期:2013-09-18 15:22:46
跳轉到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2013-11-27 23:29 |只看該作者 |倒序瀏覽
本帖最后由 milujite 于 2014-02-10 08:49 編輯

好久沒折騰了,最近突然興起,決定折騰一把openstack havana,目前openstack還是官方第一手資料比較先進,打算跟著官方文檔,一步一步架設openstack。并將整個過程整理出來。
11月27日:經(jīng)歷了兩個晚上,終于將keystone,glance,nova部屬完成
12月9日:回家了一周,今天回來迫不及待開機,完成dashboard安裝配置
12月18日:玩了幾天游戲,今天在辦公室用teamview連接到家里電腦,完成了cinder block service,新增一臺vmware虛擬機,作為block存儲節(jié)點。
2月10日:最近很忙,換工作,婚嫁,駕考都搞在一起了,回頭繼續(xù)更新

文章如果被轉載請注明出處http://72891.cn/forum.p ... ;extra=#pid24064569

論壇徽章:
7
雙子座
日期:2013-09-09 15:55:31CU大;照
日期:2013-09-18 15:22:06CU大;照
日期:2013-09-18 15:22:20CU大牛徽章
日期:2013-09-18 15:22:26CU大;照
日期:2013-09-18 15:22:31CU大牛徽章
日期:2013-09-18 15:22:37CU大;照
日期:2013-09-18 15:22:46
2 [報告]
發(fā)表于 2013-11-27 23:30 |只看該作者
先上openstack架構圖

論壇徽章:
7
雙子座
日期:2013-09-09 15:55:31CU大;照
日期:2013-09-18 15:22:06CU大;照
日期:2013-09-18 15:22:20CU大;照
日期:2013-09-18 15:22:26CU大;照
日期:2013-09-18 15:22:31CU大;照
日期:2013-09-18 15:22:37CU大牛徽章
日期:2013-09-18 15:22:46
3 [報告]
發(fā)表于 2013-11-27 23:32 |只看該作者
本帖最后由 milujite 于 2013-12-18 14:14 編輯

12月18日新增一個vmware虛擬機作為cinder服務器

我的實驗環(huán)境:我的實驗環(huán)境比較簡單,自己的臺式機電腦,controller和hypervisor都部署在vmware workstation里,每臺虛擬機配置如下:
  CPU:2*2
  內存:2048MB
  硬盤:16GB
  CPU設置:


OS Version:RHEL 6.4 x86_64
Controller:eth0:192.168.1.100/24        eth1:192.168.2.100/24
Hypervisor:eth0:192.168.1.101/24        eth1:不配置
Block:eth0:192.168.1.102/24            eth1:不配置
GATEWAY:192.168.1.1
DNS:8.8.8.8
Openstack Version:openstack-havana
官方文檔鏈接:http://docs.openstack.org/havana ... nstall/yum/content/

論壇徽章:
7
雙子座
日期:2013-09-09 15:55:31CU大牛徽章
日期:2013-09-18 15:22:06CU大牛徽章
日期:2013-09-18 15:22:20CU大;照
日期:2013-09-18 15:22:26CU大;照
日期:2013-09-18 15:22:31CU大;照
日期:2013-09-18 15:22:37CU大;照
日期:2013-09-18 15:22:46
4 [報告]
發(fā)表于 2013-11-27 23:34 |只看該作者
本帖最后由 milujite 于 2013-12-18 14:17 編輯

12月18日新增準備工作關閉SELINUX

第一章:安裝前的準備工作:
關閉 selinux
  1. [root@openstack ~]# vi /etc/selinux/config
  2. SELINUX=disabled
復制代碼
配置hosts
  1. [root@openstack ~]# vi /etc/hosts
  2. 127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
  3. 192.168.1.100 openstack
  4. 192.168.1.101 node01
  5. 192.168.1.102 storage
復制代碼
配置源
  1. [root@openstack ~]# vi /etc/yum.repo.d/rhel-epel.repo
  2. [RHEL-epel]
  3. name=epel
  4. baseurl=http://dl.fedoraproject.org/pub/epel/6/x86_64/
  5. enabled=1
  6. gpgcheck=0
  7. [root@openstack ~]# vi /etc/yum.repo.d/openstack-hanava.repo
  8. [openstack-havana]
  9. name=OpenStack Havana Repository for EPEL 6
  10. baseurl=http://repos.fedorapeople.org/repos/openstack/openstack-havana/epel-6
  11. enabled=1
  12. gpgcheck=0
復制代碼
掛載iso到/iso目錄,并設置以下源:
  1. [root@openstack ~]# vi /etc/yum.repos.d/rhel-iso.repo
  2. [RHEL-Server]
  3. name=Red Hat Enterprise Linux $releasever - $basearch - Server
  4. baseurl=file:///iso/Server
  5. enabled=1
  6. gpgcheck=0
  7. [RHEL-HighAvailability]
  8. name=Red Hat Enterprise Linux $releasever - $basearch - HighAvailability
  9. baseurl=file:///iso/HighAvailability
  10. enabled=1
  11. gpgcheck=0
  12. [RHEL-LoadBalancer]
  13. name=Red Hat Enterprise Linux $releasever - $basearch - LoadBalancer
  14. baseurl=file:///iso/LoadBalancer
  15. enabled=1
  16. gpgcheck=0
  17. [RHEL-ScalableFileSystem]
  18. name=Red Hat Enterprise Linux $releasever - $basearch - ScalableFileSystem
  19. baseurl=file:///iso/ScalableFileSystem
  20. enabled=1
  21. gpgcheck=0
  22. [RHEL-ResilientStorage]
  23. name=Red Hat Enterprise Linux $releasever - $basearch - ResilientStorage
  24. baseurl=file:///iso/ResilientStorage
  25. enabled=1
  26. gpgcheck=0
復制代碼
ntp服務:
  1. [root@openstack ~]# yum install ntp
  2. [root@openstack ~]# /etc/init.d/ntpd start
  3. [root@openstack ~]# chkconfig ntpd on
復制代碼
每臺機器都需要以上配置

論壇徽章:
7
雙子座
日期:2013-09-09 15:55:31CU大;照
日期:2013-09-18 15:22:06CU大;照
日期:2013-09-18 15:22:20CU大;照
日期:2013-09-18 15:22:26CU大牛徽章
日期:2013-09-18 15:22:31CU大牛徽章
日期:2013-09-18 15:22:37CU大;照
日期:2013-09-18 15:22:46
5 [報告]
發(fā)表于 2013-11-27 23:35 |只看該作者
本帖最后由 milujite 于 2013-11-28 00:28 編輯

第二章:MYSQL 部署:
  1. [root@openstack ~]# yum install mysql mysql-server mysql-python
  2. [root@openstack ~]# /etc/init.d/mysqld start
  3. [root@openstack ~]# chkconfig mysqld on
  4. [root@openstack ~]# /usr/bin/mysqladmin -u root password 'openstack'
  5. [root@openstack ~]# mysql -uroot -p
  6. mysql> use mysql
  7. Reading table information for completion of table and column names
  8. You can turn off this feature to get a quicker startup with -A

  9. Database changed
  10. mysql> update user set password=PASSWORD('openstack') where user='root';
  11. Query OK, 2 rows affected (0.00 sec)
  12. Rows matched: 3  Changed: 2  Warnings: 0

  13. mysql> select user,password,host from user;
  14. +------+-------------------------------------------+-----------+
  15. | user | password                                  | host      |
  16. +------+-------------------------------------------+-----------+
  17. | root | *3A4A03AC22526F6B591010973A741D59A71D728E | localhost |
  18. | root | *3A4A03AC22526F6B591010973A741D59A71D728E | openstack |
  19. | root | *3A4A03AC22526F6B591010973A741D59A71D728E | 127.0.0.1 |
  20. |      |                                           | localhost |
  21. |      |                                           | openstack |
  22. +------+-------------------------------------------+-----------+
  23. 5 rows in set (0.00 sec)

  24. mysql> flush privileges;
  25. Query OK, 0 rows affected (0.00 sec)
  26. [root@openstack ~]# mysql_secure_installation
  27. NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
  28.       SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

  29. In order to log into MySQL to secure it, we'll need the current password for the root user. If you've just installed MySQL, and you haven't set the root password yet, the password will be blank,so you should just press enter here.

  30. Enter current password for root (enter for none):
  31. OK, successfully used password, moving on...

  32. Setting the root password ensures that nobody can log into the MySQL
  33. root user without the proper authorisation.

  34. You already have a root password set, so you can safely answer 'n'.

  35. Change the root password? [Y/n] n
  36. ... skipping.

  37. By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them.  This is intended only for testing, and to make the installation go a bit smoother.  You should remove them before moving into a
  38. production environment.

  39. Remove anonymous users? [Y/n] y
  40. ... Success!

  41. Normally, root should only be allowed to connect from 'localhost'.  This ensures that someone cannot guess at the root password from the network.

  42. Disallow root login remotely? [Y/n] n
  43. ... skipping.

  44. By default, MySQL comes with a database named 'test' that anyone can access.  This is also intended only for testing, and should be removed before moving into a production environment.

  45. Remove test database and access to it? [Y/n] y
  46. - Dropping test database...
  47. ... Success!
  48. - Removing privileges on test database...
  49. ... Success!

  50. Reloading the privilege tables will ensure that all changes made so far
  51. will take effect immediately.

  52. Reload privilege tables now? [Y/n] y
  53. ... Success!

  54. Cleaning up...

  55. All done!  If you've completed all of the above steps, your MySQL installation should now be secure.

  56. Thanks for using MySQL!
復制代碼

論壇徽章:
7
雙子座
日期:2013-09-09 15:55:31CU大;照
日期:2013-09-18 15:22:06CU大;照
日期:2013-09-18 15:22:20CU大牛徽章
日期:2013-09-18 15:22:26CU大牛徽章
日期:2013-09-18 15:22:31CU大;照
日期:2013-09-18 15:22:37CU大;照
日期:2013-09-18 15:22:46
6 [報告]
發(fā)表于 2013-11-27 23:37 |只看該作者
本帖最后由 milujite 于 2013-11-28 00:29 編輯

第三章:安裝openstack-utils和qpidd message
  1. [root@openstack ~]# yum install crudini
  2. [root@openstack ~]# yum install openstack-utils
  3. [root@openstack ~]# yum install qpid-cpp-server memcached
  4. [root@openstack ~]# vi /etc/qpidd.conf
  5. auth=no
  6. [root@openstack ~]# /etc/init.d/qpidd start
  7. [root@openstack ~]# chkconfig qpidd on
復制代碼

論壇徽章:
7
雙子座
日期:2013-09-09 15:55:31CU大;照
日期:2013-09-18 15:22:06CU大;照
日期:2013-09-18 15:22:20CU大;照
日期:2013-09-18 15:22:26CU大;照
日期:2013-09-18 15:22:31CU大;照
日期:2013-09-18 15:22:37CU大;照
日期:2013-09-18 15:22:46
7 [報告]
發(fā)表于 2013-11-27 23:41 |只看該作者
本帖最后由 milujite 于 2013-11-28 00:28 編輯

第四章:安裝配置identity服務keystone
  1. [root@openstack ~]# yum install openstack-keystone python-keystoneclient
復制代碼
設置keystone的MySQL連接數(shù)據(jù)庫賬戶為keystone,密碼為openstack,數(shù)據(jù)庫主機名為openstack,數(shù)據(jù)庫為keystone
  1. [root@openstack ~]# openstack-config --set /etc/keystone/keystone.conf \
  2. > sql connection mysql://keystone:openstack@openstack/keystone
復制代碼
初始化keystone數(shù)據(jù)庫,要求與以上的keystone.conf配置相符,創(chuàng)建MySQL數(shù)據(jù)庫keystone,賬戶為keystone,密碼為openstack
  1. [root@openstack ~]# openstack-db --init --service keystone --password openstack
  2. Please enter the password for the 'root' MySQL user:
  3. Verified connectivity to MySQL.
  4. Creating 'keystone' database.
  5. Updating 'keystone' database password in /etc/keystone/keystone.conf
  6. Initializing the keystone database, please wait...
  7. Complete!
復制代碼
配置keystone token
  1. [root@openstack ~]# ADMIN_TOKEN=$(openssl rand -hex 10)
  2. [root@openstack ~]# echo $ADMIN_TOKEN
  3. d7942140d255a0a61a30
  4. [root@openstack ~]# openstack-config --set /etc/keystone/keystone.conf DEFAULT admin_token $ADMIN_TOKEN
  5. [root@openstack ~]# cat /etc/keystone/keystone.conf |grep 'admin_token ='
  6. admin_token = d7942140d255a0a61a30
復制代碼
創(chuàng)建keystone PKI簽名證書
  1. [root@openstack ~]# keystone-manage pki_setup --keystone-user keystone --keystone-group keystone
  2. 2013-11-26 20:34:32.777 2054 INFO keystone.common.openssl [-] openssl genrsa -out /etc/keystone/ssl/certs/cakey.pem 2048
  3. Generating RSA private key, 2048 bit long modulus
  4. .............................+++
  5. ......................................+++
  6. e is 65537 (0x10001)
  7. 2013-11-26 20:34:32.913 2054 INFO keystone.common.openssl [-] openssl req -new -x509 -extensions v3_ca -key /etc/keystone/ssl/certs/cakey.pem -out /etc/keystone/ssl/certs/ca.pem -days 3650 -config /etc/keystone/ssl/certs/openssl.conf -subj /C=US/ST=Unset/L=Unset/O=Unset/CN=www.example.com
  8. 2013-11-26 20:34:32.925 2054 INFO keystone.common.openssl [-] openssl genrsa -out /etc/keystone/ssl/private/signing_key.pem 2048
  9. Generating RSA private key, 2048 bit long modulus
  10. ........................+++
  11. ......................................+++
  12. e is 65537 (0x10001)
  13. 2013-11-26 20:34:33.051 2054 INFO keystone.common.openssl [-] openssl req -key /etc/keystone/ssl/private/signing_key.pem -new -out /etc/keystone/ssl/certs/req.pem -config /etc/keystone/ssl/certs/openssl.conf -subj /C=US/ST=Unset/L=Unset/O=Unset/CN=www.example.com
  14. 2013-11-26 20:34:33.062 2054 INFO keystone.common.openssl [-] openssl ca -batch -out /etc/keystone/ssl/certs/signing_cert.pem -config /etc/keystone/ssl/certs/openssl.conf -days 3650d -cert /etc/keystone/ssl/certs/ca.pem -keyfile /etc/keystone/ssl/certs/cakey.pem -infiles /etc/keystone/ssl/certs/req.pem
  15. Using configuration from /etc/keystone/ssl/certs/openssl.conf
  16. Check that the request matches the signature
  17. Signature ok
  18. The Subject's Distinguished Name is as follows
  19. countryName           :PRINTABLE:'US'
  20. stateOrProvinceName   :ASN.1 12:'Unset'
  21. localityName          :ASN.1 12:'Unset'
  22. organizationName      :ASN.1 12:'Unset'
  23. commonName            :ASN.1 12:'www.example.com'
  24. Certificate is to be certified until Nov 24 12:34:33 2023 GMT (3650 days)

  25. Write out database with 1 new entries
  26. Data Base Updated
  27. [root@openstack ~]# chown -R keystone:keystone /etc/keystone/* /var/log/keystone/keystone.log
復制代碼
設置keystone服務啟動
  1. [root@openstack ~]# service openstack-keystone start
  2. Starting keystone:                                         [  OK  ]
  3. [root@openstack ~]# chkconfig openstack-keystone on
復制代碼

論壇徽章:
7
雙子座
日期:2013-09-09 15:55:31CU大牛徽章
日期:2013-09-18 15:22:06CU大;照
日期:2013-09-18 15:22:20CU大;照
日期:2013-09-18 15:22:26CU大;照
日期:2013-09-18 15:22:31CU大;照
日期:2013-09-18 15:22:37CU大;照
日期:2013-09-18 15:22:46
8 [報告]
發(fā)表于 2013-11-27 23:43 |只看該作者
配置users/tenants/roles關聯(lián)
正常來說,identity service需要帳號密碼驗證,但是目前還未創(chuàng)建,因此需要使用之前創(chuàng)建的admin_token來驗證。

定義環(huán)境變量:
  1. [root@openstack ~]# export OS_SERVICE_TOKEN=d7942140d255a0a61a30
  2. [root@openstack ~]# export OS_SERVICE_ENDPOINT=http://openstack:35357/v2.0
復制代碼
創(chuàng)建管理用戶以及其他openstack service使用的tenant
  1. [root@openstack ~]# keystone tenant-create --name=admin --description="Admin Tenant"
  2. +-------------+----------------------------------+
  3. |   Property  |              Value               |
  4. +-------------+----------------------------------+
  5. | description |           Admin Tenant           |
  6. |   enabled   |               True               |
  7. |      id     | 1632f40c58bb4f7594af0c00af2103ad |
  8. |     name    |              admin               |
  9. +-------------+----------------------------------+

  10. [root@openstack ~]# keystone tenant-create --name=service --description="Service Tenant"
  11. +-------------+----------------------------------+
  12. |   Property  |              Value               |
  13. +-------------+----------------------------------+
  14. | description |          Service Tenant          |
  15. |   enabled   |               True               |
  16. |      id     | f9c647dd8c9046e4a628e50cfeefb870 |
  17. |     name    |             service              |
  18. +-------------+----------------------------------+
復制代碼
創(chuàng)建管理用戶admin,帳號名為admin,密碼為openstack,郵箱為keystone@localhost
  1. [root@openstack ~]# keystone user-create --name=admin --pass=openstack \
  2. --email=keystone@localhost
  3. +----------+----------------------------------+
  4. | Property |              Value               |
  5. +----------+----------------------------------+
  6. |  email   |        keystone@localhost        |
  7. | enabled  |               True               |
  8. |    id    | f81fa135a2cf4b35949b7e88ec99e0c1 |
  9. |   name   |              admin               |
  10. +----------+----------------------------------+
復制代碼
創(chuàng)建管理role
  1. [root@openstack ~]# keystone role-create --name=admin
  2. +----------+----------------------------------+
  3. | Property |              Value               |
  4. +----------+----------------------------------+
  5. |    id    | 9b2d58bd31b6493fa200eee77bb9302f |
  6. |   name   |              admin               |
  7. +----------+----------------------------------+
復制代碼
關聯(lián)tenants/roles給admin用戶
  1. [root@openstack ~]# keystone user-role-add --user=admin --tenant=admin --role=admin
復制代碼

論壇徽章:
7
雙子座
日期:2013-09-09 15:55:31CU大;照
日期:2013-09-18 15:22:06CU大;照
日期:2013-09-18 15:22:20CU大;照
日期:2013-09-18 15:22:26CU大;照
日期:2013-09-18 15:22:31CU大;照
日期:2013-09-18 15:22:37CU大;照
日期:2013-09-18 15:22:46
9 [報告]
發(fā)表于 2013-11-27 23:46 |只看該作者
定義identity service和api endpoint
  Identity service也用來追蹤openstack service以及這個服務在網(wǎng)絡中的位置。每個openstack服務在安裝時,需要使用keystone service-create來創(chuàng)建服務,并使用keystone endpoint-create制定該服務的api endpoint。
  現(xiàn)在,我們需要創(chuàng)建identy service本身,這樣以后的keystone命令將直接使用普通的身份驗證來代替admin_token身份驗證。

創(chuàng)建identity service
  1. [root@openstack ~]# keystone service-create --name=keystone --type=identity --description="Keystone Identity Service"
  2. +-------------+----------------------------------+
  3. |   Property  |              Value               |
  4. +-------------+----------------------------------+
  5. | description |    Keystone Identity Service     |
  6. |      id     | 75b34145ffa04951b4cf90e7ea175b0a |
  7. |     name    |             keystone             |
  8. |     type    |             identity             |
  9. +-------------+----------------------------------+
復制代碼
指定identity service的api endpoint,需要用到以上創(chuàng)建identity service返回的id。制定endpoint時,需要提供相應的public API/internal API/admin API。
  1. [root@openstack ~]# keystone endpoint-create \
  2. > --service-id=75b34145ffa04951b4cf90e7ea175b0a \
  3. > --publicurl=http://openstack:5000/v2.0 \
  4. > --internalurl=http://openstack:5000/v2.0 \
  5. > --adminurl=http://openstack:35357/v2.0
  6. +-------------+----------------------------------+
  7. |   Property  |              Value               |
  8. +-------------+----------------------------------+
  9. |   adminurl  |   http://openstack:35357/v2.0    |
  10. |      id     | df4f25de3a8d41a3a996f6745d7cb295 |
  11. | internalurl |    http://openstack:5000/v2.0    |
  12. |  publicurl  |    http://openstack:5000/v2.0    |
  13. |    region   |            regionOne             |
  14. |  service_id | 75b34145ffa04951b4cf90e7ea175b0a |
  15. +-------------+----------------------------------+
復制代碼
驗證identity service和API endpoint綁定,執(zhí)行以下命令將返回admin用戶的tenant id、user id、證書等等信息。
  1. [root@openstack ~]# unset OS_SERVICE_TOKEN OS_SERVICE_ENDPOINT
  2. [root@openstack ~]# keystone --os-username=admin --os-password=openstack \ --os-auth-url=http://openstack:35357/v2.0 token-get
  3. [root@openstack ~]# keystone --os-username=admin --os-password=openstack \
  4. --os-tenant-name=admin --os-auth-url=http://openstack:35357/v2.0 token-get
復制代碼
同樣也可以這樣來驗證
  1.   以上驗證也可以通過以下簡單方式進行:
  2. [root@openstack ~]# vi keystonerc
  3. export OS_USERNAME=admin
  4. export OS_PASSWORD=openstack
  5. export OS_TENANT_NAME=admin
  6. export OS_AUTH_URL=http://openstack:35357/v2.0
  7. [root@openstack ~]# source keystonerc
  8. [root@openstack ~]# keystone token-get

  9. [root@openstack ~]# keystone user-list
  10. +----------------------------------+-------+---------+--------------------+
  11. |                id                |  name | enabled |       email        |
  12. +----------------------------------+-------+---------+--------------------+
  13. | f81fa135a2cf4b35949b7e88ec99e0c1 | admin |   True  | keystone@localhost |
  14. +----------------------------------+-------+---------+--------------------+
復制代碼

論壇徽章:
7
雙子座
日期:2013-09-09 15:55:31CU大;照
日期:2013-09-18 15:22:06CU大;照
日期:2013-09-18 15:22:20CU大;照
日期:2013-09-18 15:22:26CU大;照
日期:2013-09-18 15:22:31CU大;照
日期:2013-09-18 15:22:37CU大;照
日期:2013-09-18 15:22:46
10 [報告]
發(fā)表于 2013-11-27 23:52 |只看該作者
本帖最后由 milujite 于 2013-11-28 00:29 編輯

第五章:安裝配置image service
      Image service包含兩個服務glance-api和glance-registry,前者用于發(fā)現(xiàn)、傳輸和存儲image,后者用于管理image的metadata。默認glance將image存儲在/var/lib/glance/images/,因此需要保證/var掛載點有足夠的空間。另外還有一個服務scrubber用于清理被刪除的image。

安裝openstack-glance
  1. [root@openstack ~]# yum install openstack-glance
復制代碼
配置glance數(shù)據(jù)庫,設置glance的MySQL連接數(shù)據(jù)庫賬戶為glance,密碼為openstack,數(shù)據(jù)庫主機名為openstack,數(shù)據(jù)庫為glance
  1. [root@openstack ~]# openstack-config --set /etc/glance/glance-api.conf \
  2. DEFAULT sql_connection mysql://glance:openstack@openstack/glance
  3. [root@openstack ~]# openstack-config --set /etc/glance/glance-registry.conf \
  4. DEFAULT sql_connection mysql://glance:openstack@openstack/glance
復制代碼
初始化openstack glance時,密碼要與以上的glance-api.conf/glance-registry.conf相符合。
  1. [root@openstack ~]# openstack-db --init --service glance --password openstack
  2. Please enter the password for the 'root' MySQL user:
  3. Verified connectivity to MySQL.
  4. Creating 'glance' database.
  5. Updating 'glance' database password in /etc/glance/glance-registry.conf /etc/glance/glance-api.conf
  6. Initializing the glance database, please wait...
  7. 2013-11-26 21:56:38.019 2711 INFO glance.db.sqlalchemy.migration [-] Upgrading database to version latest
  8. 2013-11-26 21:56:38.033 2711 INFO migrate.versioning.api [-] 0 -> 1...
  9. 2013-11-26 21:56:38.036 2711 INFO glance.db.sqlalchemy.migrate_repo.schema [-] creating table images
  10. 2013-11-26 21:56:38.113 2711 INFO migrate.versioning.api [-] done
  11. 2013-11-26 21:56:38.113 2711 INFO migrate.versioning.api [-] 1 -> 2...
  12. 2013-11-26 21:56:38.117 2711 INFO glance.db.sqlalchemy.migrate_repo.schema [-] creating table image_properties
  13. 2013-11-26 21:56:38.163 2711 INFO migrate.versioning.api [-] done
  14. 2013-11-26 21:56:38.163 2711 INFO migrate.versioning.api [-] 2 -> 3...
  15. 2013-11-26 21:56:38.202 2711 INFO migrate.versioning.api [-] done
  16. 2013-11-26 21:56:38.203 2711 INFO migrate.versioning.api [-] 3 -> 4...
  17. 2013-11-26 21:56:38.218 2711 INFO migrate.versioning.api [-] done
  18. 2013-11-26 21:56:38.219 2711 INFO migrate.versioning.api [-] 4 -> 5...
  19. 2013-11-26 21:56:38.234 2711 INFO migrate.versioning.api [-] done
  20. 2013-11-26 21:56:38.234 2711 INFO migrate.versioning.api [-] 5 -> 6...
  21. 2013-11-26 21:56:38.272 2711 INFO migrate.versioning.api [-] done
  22. 2013-11-26 21:56:38.272 2711 INFO migrate.versioning.api [-] 6 -> 7...
  23. 2013-11-26 21:56:38.290 2711 INFO migrate.versioning.api [-] done
  24. 2013-11-26 21:56:38.290 2711 INFO migrate.versioning.api [-] 7 -> 8...
  25. 2013-11-26 21:56:38.293 2711 INFO glance.db.sqlalchemy.migrate_repo.schema [-] creating table image_members
  26. 2013-11-26 21:56:38.366 2711 INFO migrate.versioning.api [-] done
  27. 2013-11-26 21:56:38.366 2711 INFO migrate.versioning.api [-] 8 -> 9...
  28. 2013-11-26 21:56:38.394 2711 INFO migrate.versioning.api [-] done
  29. 2013-11-26 21:56:38.394 2711 INFO migrate.versioning.api [-] 9 -> 10...
  30. 2013-11-26 21:56:38.399 2711 INFO migrate.versioning.api [-] done
  31. 2013-11-26 21:56:38.399 2711 INFO migrate.versioning.api [-] 10 -> 11...
  32. 2013-11-26 21:56:38.430 2711 INFO migrate.versioning.api [-] done
  33. 2013-11-26 21:56:38.430 2711 INFO migrate.versioning.api [-] 11 -> 12...
  34. 2013-11-26 21:56:38.564 2711 INFO migrate.versioning.api [-] done
  35. 2013-11-26 21:56:38.565 2711 INFO migrate.versioning.api [-] 12 -> 13...
  36. 2013-11-26 21:56:38.594 2711 INFO migrate.versioning.api [-] done
  37. 2013-11-26 21:56:38.594 2711 INFO migrate.versioning.api [-] 13 -> 14...
  38. 2013-11-26 21:56:38.599 2711 INFO glance.db.sqlalchemy.migrate_repo.schema [-] creating table image_tags
  39. 2013-11-26 21:56:38.636 2711 INFO migrate.versioning.api [-] done
  40. 2013-11-26 21:56:38.636 2711 INFO migrate.versioning.api [-] 14 -> 15...
  41. 2013-11-26 21:56:38.646 2711 INFO migrate.versioning.api [-] done
  42. 2013-11-26 21:56:38.646 2711 INFO migrate.versioning.api [-] 15 -> 16...
  43. 2013-11-26 21:56:38.702 2711 INFO migrate.versioning.api [-] done
  44. 2013-11-26 21:56:38.702 2711 INFO migrate.versioning.api [-] 16 -> 17...
  45. 2013-11-26 21:56:38.772 2711 INFO 017_quote_encrypted_swift_credentials [-] 'metadata_encryption_key' was not specified in the config file or a config file was not specified. This means that this migration is a NOOP.
  46. 2013-11-26 21:56:38.775 2711 INFO migrate.versioning.api [-] done
  47. 2013-11-26 21:56:38.775 2711 INFO migrate.versioning.api [-] 17 -> 18...
  48. 2013-11-26 21:56:38.781 2711 INFO glance.db.sqlalchemy.migrate_repo.schema [-] creating table image_locations
  49. 2013-11-26 21:56:38.795 2711 INFO migrate.versioning.api [-] done
  50. 2013-11-26 21:56:38.795 2711 INFO migrate.versioning.api [-] 18 -> 19...
  51. 2013-11-26 21:56:38.805 2711 INFO migrate.versioning.api [-] done
  52. 2013-11-26 21:56:38.806 2711 INFO migrate.versioning.api [-] 19 -> 20...
  53. 2013-11-26 21:56:38.842 2711 INFO migrate.versioning.api [-] done
  54. 2013-11-26 21:56:38.842 2711 INFO migrate.versioning.api [-] 20 -> 21...
  55. 2013-11-26 21:56:38.853 2711 INFO migrate.versioning.api [-] done
  56. 2013-11-26 21:56:38.853 2711 INFO migrate.versioning.api [-] 21 -> 22...
  57. 2013-11-26 21:56:38.881 2711 INFO migrate.versioning.api [-] done
  58. 2013-11-26 21:56:38.881 2711 INFO migrate.versioning.api [-] 22 -> 23...
  59. 2013-11-26 21:56:38.884 2711 INFO migrate.versioning.api [-] done
  60. 2013-11-26 21:56:38.884 2711 INFO migrate.versioning.api [-] 23 -> 24...
  61. 2013-11-26 21:56:38.889 2711 INFO migrate.versioning.api [-] done
  62. 2013-11-26 21:56:38.889 2711 INFO migrate.versioning.api [-] 24 -> 25...
  63. 2013-11-26 21:56:38.893 2711 INFO migrate.versioning.api [-] done
  64. 2013-11-26 21:56:38.893 2711 INFO migrate.versioning.api [-] 25 -> 26...
  65. 2013-11-26 21:56:38.963 2711 INFO migrate.versioning.api [-] done
  66. 2013-11-26 21:56:38.963 2711 INFO migrate.versioning.api [-] 26 -> 27...
  67. 2013-11-26 21:56:38.991 2711 INFO migrate.versioning.api [-] done
  68. 2013-11-26 21:56:38.991 2711 INFO migrate.versioning.api [-] 27 -> 28...
  69. 2013-11-26 21:56:39.009 2711 INFO migrate.versioning.api [-] done
  70. 2013-11-26 21:56:39.009 2711 INFO migrate.versioning.api [-] 28 -> 29...
  71. 2013-11-26 21:56:39.055 2711 INFO migrate.versioning.api [-] done
  72. Complete!
復制代碼
創(chuàng)建配置glance用戶
  1. [root@openstack ~]# keystone user-create --name=glance --pass=openstack --email=glance@localhost
  2. +----------+----------------------------------+
  3. | Property |              Value               |
  4. +----------+----------------------------------+
  5. |  email   |         glance@localhost         |
  6. | enabled  |               True               |
  7. |    id    | e037938e162a4a7c8c8b305d2ceb9e72 |
  8. |   name   |              glance              |
  9. +----------+----------------------------------+
復制代碼
關聯(lián)tenants/roles給glance用戶
  1. [root@openstack ~]# keystone user-role-add --user=glance --tenant=service --role=admin
復制代碼
設置image service驗證
  1. [root@openstack ~]# openstack-config --set /etc/glance/glance-api.conf keystone_authtoken auth_host openstack
  2. [root@openstack ~]# openstack-config --set /etc/glance/glance-api.conf keystone_authtoken admin_user glance
  3. [root@openstack ~]# openstack-config --set /etc/glance/glance-api.conf keystone_authtoken admin_tenant_name service
  4. [root@openstack ~]# openstack-config --set /etc/glance/glance-api.conf keystone_authtoken admin_password openstack
  5. [root@openstack ~]# openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken auth_host openstack
  6. [root@openstack ~]# openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken admin_user glance
  7. [root@openstack ~]# openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken admin_tenant_name service
  8. [root@openstack ~]# openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken admin_password openstack
  9.   修改etc/glance/glance-api-paste.ini和/etc/glance/glance-registry-paste.ini相應的驗證參數(shù)。
  10. [root@openstack ~]# cp /usr/share/glance/glance-api-dist-paste.ini /etc/glance/glance-api-paste.ini
  11. [root@openstack ~]# cp /usr/share/glance/glance-registry-dist-paste.ini /etc/glance/glance-registry-paste.ini
  12.   編輯找到/etc/glance/glance-registry-paste.ini和/etc/glance/glance-api-paste.ini找到[filter:authtoken]字段,分別設置為:
  13. [root@openstack ~]# vi /etc/glance/glance-api-paste.ini
  14. [filter:authtoken]
  15. paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
  16. delay_auth_decision = true
  17. auth_host=openstack
  18. admin_user=glance
  19. admin_tenant_name=service
  20. admin_password=openstack
  21. [root@openstack ~]# vi /etc/glance/glance-registry-paste.ini
  22. [filter:authtoken]
  23. paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
  24. auth_host=openstack
  25. admin_user=glance
  26. admin_tenant_name=service
  27. admin_password=openstack
復制代碼
在identity service中注冊image service
  1. [root@openstack ~]# keystone service-create --name=glance --type=image --description="Glance Image Service"
  2. +-------------+----------------------------------+
  3. |   Property  |              Value               |
  4. +-------------+----------------------------------+
  5. | description |       Glance Image Service       |
  6. |      id     | 5cf53ad726e6485784e569dd55bcf5ff |
  7. |     name    |              glance              |
  8. |     type    |              image               |
  9. +-------------+----------------------------------+
復制代碼
關聯(lián)image service和api endpoint
  1. [root@openstack ~]# keystone endpoint-create \
  2. > --service-id=5cf53ad726e6485784e569dd55bcf5ff  \
  3. > --publicurl=http://openstack:9292 \
  4. > --internalurl=http://openstack:9292 \
  5. > --adminurl=http://openstack:9292
  6. +-------------+----------------------------------+
  7. |   Property  |              Value               |
  8. +-------------+----------------------------------+
  9. |   adminurl  |      http://openstack:9292       |
  10. |      id     | c41f39bbe6ae45c39929a9075e5b29e0 |
  11. | internalurl |      http://openstack:9292       |
  12. |  publicurl  |      http://openstack:9292       |
  13. |    region   |            regionOne             |
  14. |  service_id | 5cf53ad726e6485784e569dd55bcf5ff |
  15. +-------------+----------------------------------+
復制代碼
設置image service相關服務啟動
  1. [root@openstack ~]# service openstack-glance-api start
  2. Starting openstack-glance-api:                             [  OK  ]
  3. [root@openstack ~]# service openstack-glance-registry start
  4. Starting openstack-glance-registry:                        [  OK  ]
  5. [root@openstack ~]# /etc/init.d/openstack-glance-scrubber start
  6. Starting openstack-glance-scrubber:                        [  OK  ]
  7. [root@openstack ~]# chkconfig openstack-glance-api on
  8. [root@openstack ~]# chkconfig openstack-glance-registry on
  9. [root@openstack ~]# chkconfig openstack-glance-scrubber on
復制代碼
驗證glance service
  1. [root@openstack ~]#wget http://cdn.download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-disk.img

  2. [root@openstack ~]# glance image-create --name="CirrOS 0.3.1" --disk-format=qcow2 --container-format=bare --is-public=true < cirros-0.3.1-x86_64-disk.img
  3. +------------------+--------------------------------------+
  4. | Property         | Value                                |
  5. +------------------+--------------------------------------+
  6. | checksum         | d972013792949d0d3ba628fbe8685bce     |
  7. | container_format | bare                                 |
  8. | created_at       | 2013-11-26T15:02:40                  |
  9. | deleted          | False                                |
  10. | deleted_at       | None                                 |
  11. | disk_format      | qcow2                                |
  12. | id               | c2b6c28b-ac3f-47de-9bc0-e72ea752f658 |
  13. | is_public        | True                                 |
  14. | min_disk         | 0                                    |
  15. | min_ram          | 0                                    |
  16. | name             | CirrOS 0.3.1                         |
  17. | owner            | None                                 |
  18. | protected        | False                                |
  19. | size             | 13147648                             |
  20. | status           | active                               |
  21. | updated_at       | 2013-11-26T15:02:40                  |
  22. +------------------+--------------------------------------+

  23. [root@openstack ~]# glance image-list
  24. +--------------------------------------+--------------+-------------+------------------+----------+--------+
  25. | ID                                   | Name         | Disk Format | Container Format | Size     | Status |
  26. +--------------------------------------+--------------+-------------+------------------+----------+--------+
  27. | c2b6c28b-ac3f-47de-9bc0-e72ea752f658 | CirrOS 0.3.1 | qcow2       | bare             | 13147648 | active |
  28. +--------------------------------------+--------------+-------------+------------------+----------+--------+
復制代碼
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復

  

北京盛拓優(yōu)訊信息技術有限公司. 版權所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關心和支持過ChinaUnix的朋友們 轉載本站內容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP