GithubHelp home page GithubHelp logo

set-up-glance's Introduction

Hướng dẫn cài đặt và cấu hình dịch vụ Glance trong OpenStack

Trước khi cài đặt và cấu hình dịch vụ Image, chúng ta cần tạo cơ sở dữ liệu, các dịch vụ cần thiết và các API endpoints.

#####1. Tạo cơ sở dữ liệu, thực hiện theo các bước sau:

a. Sử dụng cơ sở dữ liệu truy cập người dùng kết nối với cơ sở dữ liệu máy chủ:

   $ mysql -u root -p

b. Tạo cơ sở dữ liệu glance:

    CREATE DATABASE glance;

c. Cấp quyền truy cập thích hợp cho cơ sở dữ liệu glance:

    GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' \
      IDENTIFIED BY 'GLANCE_DBPASS';
    GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' \
      IDENTIFIED BY 'GLANCE_DBPASS';

'GLANCE_DBPASS': password thích hợp

Thoát khỏi cơ sỡ dữ liệu truy cập người dùng

#####2. Chuyển sang quyền admin để truy cập CLI:

   $ source admin-openrc.sh

#####3. Tạo các chính sách dịch vụ a. Tạo user tên là glance:

   $ keystone user-create --name glance --pass GLANCE_PASS

GLANCE_PASS: điền pass thích hợp

b. Gán quyền admin cho người dùng glance:

    $ keystone user-role-add --user glance --tenant service --role admin

c. Tạo đối tượng dịch vụ cho glance:

    $ keystone service-create --name glance --type image \
      --description "OpenStack Image Service" 

#####4. Tạo các API endpoints cho dịch vụ Image:

    $ keystone endpoint-create \
      --service-id $(keystone service-list | awk '/ image / {print $2}') \
      --publicurl http://controller:9292 \
      --internalurl http://controller:9292 \
      --adminurl http://controller:9292 \
      --region regionOne

####Cài đặt và cấu hình các thành phần trong dịch vụ Image

######1. Cài đặt các gói:

# apt-get install glance python-glanceclient 

######2. Sửa file /etc/glance/glance-api.conf :

a. [database]:

[database]
...
connection = mysql://glance:GLANCE_DBPASS@controller/glance

Chú ý: GLANCE_DBPASS là pass của cơ sở dữ liệu của dịch vụ Image đã chọn trước đó.

b. [keystone_authtoken] và [paste_deploy]:

    [keystone_authtoken]
    ...
    auth_uri = http://controller:5000/v2.0
    identity_uri = http://controller:35357
    admin_tenant_name = service
    admin_user = glance
    admin_password = GLANCE_PASS
     
    [paste_deploy]
    ...
    flavor = keystone

Chú ý: GLANCE_PASS là pass của người dùng glance

c. [glance_store]:

    [glance_store]
    ...
    default_store = file
    filesystem_store_datadir = /var/lib/glance/images/

d. [DEFAULT]

    [DEFAULT]
    ...
    notification_driver = noop

e. (Optional)

    [DEFAULT]
    ...
    verbose = True

#####3. Gắn vào cơ sở dữ liệu dịch vụ Image:

# su -s /bin/sh -c "glance-manage db_sync" glance

####Hoàn thành cài đặt

#####1. Khởi động lại dịch vụ Image:

# service glance-registry restart
# service glance-api restart

#####2. Theo mặc định, các gói Ubuntu tạo ra SQLite cơ sở dữ liệu:

Vì theo chúng ta sử dụng SQL, nên bạn có thể di xóa SQLite :

# rm -f /var/lib/glance/glance.sqlite

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.