Centos8はOpenstack(Uバージョン)を展開します

前書き

OpenStackは、オープンソースのクラウドコンピューティング管理プラットフォームプロジェクトです。これは、NASA(National Aeronautics and Space Administration)とRackspaceによって開発および開始された一連のソフトウェアオープンソースプロジェクトの組み合わせです。Apacheライセンスによって承認されたオープンソースコードプロジェクト
OpenStackは、プライベートクラウドであり、パブリッククラウドは、スケーラブルで柔軟なクラウドコンピューティングサービスを提供します。プロジェクトの目標は、実装が簡単で、スケーラブルで、リッチで、標準化されたクラウドコンピューティング管理プラットフォームを提供することです
。OpenStackは、ネットワーキング、仮想化、オペレーティングシステム、サーバーなどのすべての側面をカバーします。開発中のクラウドコンピューティングプラットフォームプロジェクトであり、コアプロジェクト、インキュベーションプロジェクト、サポートプロジェクト、およびさまざまな成熟度と重要性に応じた関連プロジェクトに分類されます。各プロジェクトには、独自の委員会とプロジェクトテクニカルディレクターがいます。各プロジェクトは静的ではありません。インキュベーションプロジェクトは、開発の成熟度と重要性に応じて、コアプロジェクトの
コアコンポーネントに変換でき
ます。1。ComputeNova:単一ユーザーの仮想マシンの管理またはグループの使用に使用されるコントローラーのセットインスタンスのライフサイクル全体を通じて、ユーザーのニーズに応じて仮想サービスが提供されます。仮想マシンの作成、起動、シャットダウン、一時停止、一時停止、調整、移行、再起動、破棄などを担当し、CPU、メモリ、その他の情報仕様を構成します
。2。オブジェクトストレージ(オブジェクトストレージ)Swift:大規模でスケーラブルなシステム用のセット組み込みの冗長性と高い障害耐性メカニズムを通じてオブジェクトストレージを実装し、ファイルの保存または取得を可能にし、Glanceにミラーストレージを提供し、Cinderにボリュームバックアップサービスを提供するシステム。3。ImageService
(Image Service)Glance:仮想マシンイメージのセット検索および取得システムは、複数の仮想マシン画像フォーマット(AKI、AMI、ARI、ISO、QCOW2、Raw、VDI、VHD、VMDK)をサポートし、画像の基本情報を作成、アップロード、削除、および編集する機能を備えています。4.ID
サービス(IDサービス)キーストーン:他のOpenStackサービスに認証、サービスルール、およびサービストークン機能を提供し、ドメイン、プロジェクト、ユーザー、グループ、およびロールを管理します
5.ネットワークおよびアドレス管理(ネットワーク)Neutron:クラウドコンピューティングにネットワーク仮想化テクノロジーを提供し、他のOpenStackサービスにネットワーク接続サービスを提供します。ユーザーがネットワーク、サブネット、ルーターを定義し、DHCP、DNS、負荷分散、L3サービス、ネットワークサポートGRE、VLANを構成するためのインターフェイスを提供し、プラグインアーキテクチャは、OpenvSwitch
6、ブロックストレージ(ブロックストレージ)など、多くの主流のネットワークメーカーとテクノロジーをサポートします。)Cinder:実行中のインスタンスに安定したデータブロックストレージサービスを提供します。そのプラグインドライブアーキテクチャは、ボリュームの作成、ボリュームの削除、インスタンスでのボリュームのマウントとアンマウントなど、ブロックデバイスの作成と管理に役立ちます。7。UI
インターフェイス(ダッシュボード) Horizo​​n:OpenStackのさまざまなサービスのWeb管理ポータル。インスタンスの開始、IPアドレスの割り当て、アクセス制御の構成など、サービスのユーザー操作を簡素化するために使用されます
。8。Ceilometerの測定(計測):OpenStack内で発生するほとんどすべての処理が可能です。すべてのイベントが収集され、請求、監視、およびその他のサービスのデータサポートが提供されます
。9。展開オーケストレーション(オーケストレーション)ヒート:クラウドインフラストラクチャソフトウェアの動作環境(コンピューティング、ストレージ)を実現するために、テンプレートによって定義された共同展開方法を提供します。 (およびネットワークリソース)自動展開
10.データベースサービス(データベースサービス)Trove:OpenStack環境のユーザーにスケーラブルで信頼性の高いリレーショナルおよび非リレーショナルデータベースエンジンサービスを提供します

準備

2台のCentos8仮想マシンを準備し、仮想マシンに2台のハードディスクを構成し、IPアドレスとホスト名を構成し、システム時間を同期し、ファイアウォールとselinuxをオフにし、IPアドレスとホスト名のマッピングを変更します

ip ホスト名
192.168.29.148 コントローラ
192.168.29.149 コンピューター

展開サービス

epelソースをインストールする

[root@controller ~]# yum install epel-release -y
[root@computer ~]# yum install epel-release -y

オープンスタックソースをインストールする

[root@controller ~]# yum install centos-release-openstack-ussuri -y

[root@computer ~]# yum install centos-release-openstack-ussuri -y

openstackクライアントとselinuxサービスをインストールします

[root@controller ~]# yum install python3-openstackclient openstack-selinux -y

[root@computer ~]# yum install python3-openstackclient openstack-selinux -y

Mariadbデータベースとmemcachedをデプロイします

[root@controller ~]# yum install mariadb mariadb-server python3-PyMySQL memcached python3-memcached -y

メッセージキューサービスをインストールする

[root@controller ~]# yum install rabbitmq-server -y

キーストーンサービスをインストールする

[root@controller ~]# yum install openstack-keystone httpd  python3-mod_wsgi -y

glanceサービスをインストールする

[root@controller ~]# yum install openstack-glance -y

placememtサービスをインストールします

[root@controller ~]# yum install openstack-placement-api -y

コントローラはnovaサービスをインストールします

[root@controller ~]# yyum install openstack-nova-api openstack-nova-conductor openstack-nova-novncproxy openstack-nova-scheduler -y

コンピューターインストールnovaサービス

[root@computer ~]# yum install openstack-nova-compute -y

コントローラは中性子サービスをインストールします

[root@controller ~]# yum install openstack-neutron openstack-neutron-ml2 openstack-neutron-linuxbridge ebtables ipset iproute -y

コンピューターインストール中性子サービス

[root@computer ~]# yum install openstack-neutron-linuxbridge ebtables ipset iproute -y

ダッシュボードコンポーネントをインストールする

[root@controller ~]# yum install openstack-dashboard -y

コントローラは燃えがらサービスをインストールします

[root@controller ~]# yum install openstack-cinder -y

コンピューターインストールcinderおよびlvmサービス

[root@storager ~]# yum install lvm2 device-mapper-persistent-data openstack-cinder targetcli python3-keystone -y

ハードウェアアクセラレーションをオンにする

[root@controller ~]# modprobe kvm-intel
[root@computer ~]# modprobe kvm-intel

インストールの依存関係

[root@controller ~]# yum -y install libibverbs
[root@computer ~]# yum -y install libibverbs
[root@storager ~]# yum -y install libibverbs

メッセージキューサービスを構成する

オープンサービス

[root@controller ~]# systemctl start rabbitmq-server.service
[root@controller ~]# systemctl enable rabbitmq-server.service 

ユーザーを追加する

[root@controller ~]# rabbitmqctl add_user openstack openstack

承認制限

[root@controller ~]# rabbitmqctl set_permissions openstack ".*" ".*" ".*"

memcachedサービスを構成する

構成ファイルを変更する

[root@controller ~]# vi /etc/sysconfig/memcached 
PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="64"
OPTIONS="-l 127.0.0.1,::1,controller"

サービス開始

[root@controller ~]# systemctl start memcached.service
[root@controller ~]# systemctl enable memcached.service

データベースサービスを構成する

構成ファイルを変更する

[root@controller ~]# vi /etc/my.cnf.d/mariadb-server.cnf
bind-address = 192.168.29.148
default-storage-engine = innodb
innodb_file_per_table = on
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8

サービス開始

[root@controller ~]# systemctl start mariadb.service
[root@controller ~]# systemctl enable mariadb.service

データベースを作成する

MariaDB [(none)]> create database keystone;
MariaDB [(none)]> create database glance;
MariaDB [(none)]> create database nova;
MariaDB [(none)]> create database nova_api;
MariaDB [(none)]> create database nova_cell0;
MariaDB [(none)]> create database neutron;
MariaDB [(none)]> create database cinder;
MariaDB [(none)]> create database placement;

許可ユーザー

MariaDB [(none)]> grant all privileges on keystone.* to 'keystone'@'localhost' identified by 'your_password';
MariaDB [(none)]> grant all privileges on keystone.* to 'keystone'@'%' identified by 'your_password';

MariaDB [(none)]> grant all privileges on glance.* to 'glance'@'localhost' identified by 'your_password';
MariaDB [(none)]> grant all privileges on glance.* to 'glance'@'%' identified by 'your_password';

MariaDB [(none)]> grant all privileges on nova.* to 'nova'@'localhost' identified by 'your_password';
MariaDB [(none)]> grant all privileges on nova.* to 'nova'@'%' identified by 'your_password';

MariaDB [(none)]> grant all privileges on nova_api.* to 'nova'@'localhost' identified by 'your_password';
MariaDB [(none)]> grant all privileges on nova_api.* to 'nova'@'%' identified by 'your_password';

MariaDB [(none)]> grant all privileges on nova_cell0.* to 'nova'@'localhost' identified by 'your_password';
MariaDB [(none)]> grant all privileges on nova_cell0.* to 'nova'@'%' identified by 'your_password';

MariaDB [(none)]> grant all privileges on neutron.* to 'neutron'@'localhost' identified by 'your_password';
MariaDB [(none)]> grant all privileges on neutron.* to 'neutron'@'%' identified by 'your_password';

MariaDB [(none)]> grant all privileges on cinder.* to 'cinder'@'localhost' identified by 'your_password';
MariaDB [(none)]> grant all privileges on cinder.* to 'cinder'@'%' identified by 'your_password';

MariaDB [(none)]> grant all privileges on placement.* to 'placement'@'localhost' identified by 'your_password';
MariaDB [(none)]> grant all privileges on placement.* to 'placement'@'%' identified by 'your_password';

MariaDB [(none)]> flush privileges;

キーストーンサービスを構成する

構成ファイルを変更する

[root@controller ~]# vi /etc/keystone/keystone.conf
[database]
connection = mysql+pymysql://keystone:your_password@controller/keystone
[token]
provider = fernet

データベースの同期

[root@controller ~]# su -s /bin/sh -c "keystone-manage db_sync" keystone

キーストアの初期化

[root@controller ~]# keystone-manage fernet_setup --keystone-user keystone --keystone-group keystone

[root@controller ~]# keystone-manage credential_setup --keystone-user keystone --keystone-group keystone

[root@controller ~]# keystone-manage bootstrap --bootstrap-password openstack --bootstrap-admin-url http://controller:5000/v3/ --bootstrap-internal-url http://controller:5000/v3/ --bootstrap-public-url http://controller:5000/v3/ --bootstrap-region-id RegionOne

httpdサービスを構成する

#修改配置文件
[root@controller ~]# vi /etc/httpd/conf/httpd.conf
ServerName controller

#创建软连接
[root@controller ~]# ln -s /usr/share/keystone/wsgi-keystone.conf /etc/httpd/conf.d/

#启动服务
[root@controller ~]# systemctl start httpd
[root@controller ~]# systemctl enable httpd

管理環境変数スクリプトを構成する

[root@controller ~]# vi admin-openrc 
export OS_PROJECT_DOMAIN_NAME=Default
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=openstack
export OS_AUTH_URL=http://controller:5000/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2
export OS_VOLUME_API_VERSION=2

環境変数を確認する

[root@controller ~]# source admin-openrc
[root@controller ~]# openstack token issue

サービスプロジェクトを作成する

[root@controller ~]# openstack project create --domain default --description "Service Project" service

デモプロジェクトを作成する

[root@controller ~]# openstack project create --domain default --description "Demo Project" demo

デモユーザーを作成する

[root@controller ~]# openstack user create --domain default --password-prompt demo

ユーザーロールを作成する

[root@controller ~]# openstack role create user

デモプロジェクトとユーザーにユーザーロールを追加する

[root@controller ~]# openstack role add --project demo --user demo user

デモ環境変数スクリプトを構成します

[root@controller ~]# vi demo-openrc 
export OS_PROJECT_DOMAIN_NAME=Default
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_NAME=demo
export OS_USERNAME=demo
export OS_PASSWORD=demo
export OS_AUTH_URL=http://controller:5000/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2

glanceサービスを構成する

glanceユーザーを作成および構成する

[root@controller ~]# openstack user create --domain default --password-prompt glance
[root@controller ~]# openstack role add --project service --user glance admin

Glanceサービスエンティティを作成する

[root@controller ~]# openstack service create --name glance  --description "OpenStack Image" image

Glanceサービスエンドポイントを作成する

[root@controller ~]# openstack endpoint create --region RegionOne image public http://controller:9292
[root@controller ~]# openstack endpoint create --region RegionOne image internal http://controller:9292
[root@controller ~]# openstack endpoint create --region RegionOne  image admin http://controller:9292

構成ファイルを変更する

[root@controller ~]# vi /etc/glance/glance-api.conf
[database]
connection = mysql+pymysql://glance:your_password@controller/glance
[keystone_authtoken]
www_authenticate_uri = http://controller:5000
auth_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = glance
password = glance

[paste_deploy]
flavor = keystone

[glance_store]
stores = file,http
default_store = file
filesystem_store_datadir = /var/lib/glance/images/

データベースを同期する

[root@controller ~]# su -s /bin/sh -c "glance-manage db_sync" glance

サービス開始

[root@controller ~]# systemctl enable openstack-glance-api.service
[root@controller ~]# systemctl start openstack-glance-api.service

画像をアップロード

[root@controller ~]# glance image-create --name Centos7 --disk-format qcow2 --container-format bare --progress < CentOS-7-x86_64-GenericCloud-1907.qcow2

#查看镜像
[root@controller ~]# openstack image list

コントローラ構成配置サービス

プレースメントユーザーを作成および構成する

[root@controller ~]# openstack user create --domain default --password-prompt placement
[root@controller ~]# openstack role add --project service --user placement admin

配置サービスエンティティを作成する

[root@controller ~]# openstack service create --name placement   --description "Placement API" placement

配置サービスエンドポイントを作成する

[root@controller ~]# openstack endpoint create --region RegionOne   placement public http://controller:8778
[root@controller ~]# openstack endpoint create --region RegionOne   placement internal http://controller:8778
[root@controller ~]# openstack endpoint create --region RegionOne   placement admin http://controller:8778

構成ファイルを変更する

[root@controller ~]# vi /etc/placement/placement.conf
[placement_database]
connection = mysql+pymysql://placement:'your_password'@controller/placement

[api]
auth_strategy = keystone

[keystone_authtoken]
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000/v3
memcached_servers = controller:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = placement
password = placement

データベースを同期する

[root@controller ~]# su -s /bin/sh -c "placement-manage db sync" placement

サービスを再開します

[root@controller ~]# systemctl restart httpd

コントローラ構成novaサービス

novaユーザーを作成して構成します

[root@controller ~]# openstack user create --domain default --password-prompt nova
[root@controller ~]# openstack role add --project service --user nova admin

novaサービスエンティティを作成する

[root@controller ~]# openstack service create --name nova --description "OpenStack Compute" compute

novaサービスエンドポイントを作成する

[root@controller ~]# openstack endpoint create --region RegionOne compute public http://controller:8774/v2.1
[root@controller ~]# openstack endpoint create --region RegionOne compute internal http://controller:8774/v2.1
[root@controller ~]# openstack endpoint create --region RegionOne compute admin http://controller:8774/v2.1

構成ファイルを変更する

[root@controller ~]# vi /etc/nova/nova.conf
[DEFAULT]
enabled_apis = osapi_compute,metadata
my_ip = 192.168.29.148
transport_url = rabbit://openstack:openstack@controller:5672/

[api_database]
connection = mysql+pymysql://nova:your_password@controller/nova_api

[database]
connection = mysql+pymysql://nova:your_password@controller/nova

[api]
auth_strategy = keystone 

[keystone_authtoken]
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000/v3
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = nova

[vnc]
enabled = true
server_listen = $my_ip
server_proxyclient_address = $my_ip

[glance]
api_servers = http://controller:9292

[oslo_concurrency]
lock_path = /var/lib/nova/tmp

[placement]
os_region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://controller:5000/v3
username = placement
password = placement
[root@controller ~]# vi /etc/httpd/conf.d/00-placement-api.conf
Listen 8778

<VirtualHost *:8778>
  WSGIProcessGroup nova-placement-api
  WSGIApplicationGroup %{GLOBAL}
  WSGIPassAuthorization On
  WSGIDaemonProcess nova-placement-api processes=3 threads=1 user=nova group=nova
  WSGIScriptAlias / /usr/bin/nova-placement-api
  <IfVersion >= 2.4>
    ErrorLogFormat "%M"
  </IfVersion>
  ErrorLog /var/log/nova/nova-placement-api.log
  #SSLEngine On
  #SSLCertificateFile ...
  #SSLCertificateKeyFile ...
<Directory /usr/bin>
  <IfVersion >= 2.4>
    Require all granted
  </IfVersion>
  <IfVersion >= 2.4>
    Order allow,deny
    Allow from all
  </IfVersion>
</Directory>
</VirtualHost>

Alias /nova-placement-api /usr/bin/nova-placement-api
<Location /nova-placement-api>
  SetHandler wsgi-script
  Options +ExecCGI
  WSGIProcessGroup nova-placement-api
  WSGIApplicationGroup %{GLOBAL}
  WSGIPassAuthorization On
</Location>

httpdサービスを再起動します

[root@controller ~]# systemctl restart httpd

データベースを同期する

[root@controller ~]# su -s /bin/sh -c "nova-manage api_db sync" nova
[root@controller ~]# su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova
[root@controller ~]# su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova
[root@controller ~]# su -s /bin/sh -c "nova-manage db sync" nova

検証

[root@controller ~]# su -s /bin/sh -c "nova-manage cell_v2 list_cells" nova

サービス開始

[root@controller ~]# systemctl start openstack-nova-api.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
[root@controller ~]# systemctl enable openstack-nova-api.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service

コンピューティングconfigurenovaサービス

構成ファイルを変更する

[root@compute ~]# vi /etc/nova/nova.conf
[DEFAULT]
enabled_apis = osapi_compute,metadata
transport_url = rabbit://openstack:openstack@controller
my_ip = 192.168.29.146

[api]
auth_strategy = keystone

[keystone_authtoken]
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000/v3
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = nova

[vnc]
enabled = True
server_listen = 0.0.0.0
server_proxyclient_address = $my_ip
novncproxy_base_url = http://controller:6080/vnc_auto.html

[glance]
api_servers = http://controller:9292

[oslo_concurrency]
lock_path = /var/lib/nova/tmp

[placement]
os_region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://controller:5000/v3
username = placement
password = placement

[libvirt]
virt_type = kvm
#虚拟机部署集群需要用qemu
#virt_type = qemu

サービス開始

[root@compute ~]# systemctl start libvirtd.service openstack-nova-compute.service
[root@compute ~]# systemctl enable libvirtd.service openstack-nova-compute.service

コントローラはコンピュータをデータベースに追加します

#查看nova-compute结点
[root@controller ~]# openstack compute service list --service nova-compute

#添加数据库
[root@controller ~]# su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova

コントローラは中性子サービスを構成します

中性子ユーザーを作成して構成する

[root@controller ~]# openstack user create --domain default --password-prompt neutron
[root@controller ~]# openstack role add --project service --user neutron admin

中性子サービスエンティティを作成する

[root@controller ~]# openstack service create --name neutron --description "OpenStack Networking" network

中性子サービスエンドポイントを作成する

[root@controller ~]# openstack endpoint create --region RegionOne network public http://controller:9696
[root@controller ~]# openstack endpoint create --region RegionOne  network internal http://controller:9696
[root@controller ~]# openstack endpoint create --region RegionOne  network admin http://controller:9696

構成ファイルを変更します(linuxbridgeネットワークアーキテクチャ)

[root@controller ~]# vi /etc/neutron/neutron.conf
[DEFAULT]
core_plugin = ml2
service_plugins = router
allow_overlapping_ips = true
transport_url = rabbit://openstack:openstack@controller
auth_strategy = keystone
notify_nova_on_port_status_changes = true
notify_nova_on_port_data_changes = true

[database]
connection = mysql+pymysql://neutron:your_password@controller/neutron

[keystone_authtoken]
www_authenticate_uri = http://controller:5000
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = neutron

[nova]
auth_url = http://controller:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = nova
password = nova

[oslo_concurrency]
lock_path = /var/lib/neutron/tmp
[root@controller ~]# vi /etc/neutron/plugins/ml2/ml2_conf.ini
[ml2]
type_drivers = flat,vlan,vxlan
tenant_network_types = vxlan
mechanism_drivers = linuxbridge,l2population
extension_drivers = port_security

[ml2_type_flat]
flat_networks = provider

[ml2_type_vxlan]
vni_ranges = 1:1000

[securitygroup]
enable_ipset = true
[root@controller ~]# vi /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge]
physical_interface_mappings = provider:ens160

[vxlan]
enable_vxlan = true
local_ip = 192.168.29.148
l2_population = true

[securitygroup]
enable_security_group = true
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
[root@controller ~]# vi /etc/neutron/l3_agent.ini
[DEFAULT]
interface_driver = linuxbridge
[root@controller ~]# vi /etc/neutron/dhcp_agent.ini
[DEFAULT]
interface_driver = linuxbridge
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = true
[root@controller ~]# vi /etc/neutron/metadata_agent.ini
[DEFAULT]
nova_metadata_host = controller
metadata_proxy_shared_secret = 000000
[root@controller ~]# vi /etc/nova/nova.conf
[neutron]
url = http://controller:9696
auth_url = http://controller:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = neutron
service_metadata_proxy = true
metadata_proxy_shared_secret = 000000

ソフトリンクを作成する

[root@controller ~]# ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini

データベースを同期する

[root@controller ~]# su -s /bin/sh -c "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head" neutron

サービス開始

#重启nova-api服务
[root@controller ~]# systemctl restart openstack-nova-api.service

#linuxbridge架构
[root@controller ~]# systemctl start neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service neutron-l3-agent.service
[root@controller ~]# systemctl enable neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service neutron-l3-agent.service

コンピューター構成中性子サービス

構成ファイルの変更(linuxbridgeアーキテクチャ)

[root@computer ~]# vi /etc/neutron/neutron.conf
[DEFAULT]
transport_url = rabbit://openstack:openstack@controller
auth_strategy = keystone

[keystone_authtoken]
www_authenticate_uri = http://controller:5000
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = neutron

[oslo_concurrency]
lock_path = /var/lib/neutron/tmp
[root@computer ~]# vi /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge]
physical_interface_mappings = provider:ens160

[vxlan]
enable_vxlan = true
local_ip = 192.168.29.149
l2_population = true

[securitygroup]
enable_security_group = true
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
[root@computer ~]# vi /etc/nova/nova.conf
[neutron]
url = http://controller:9696
auth_url = http://controller:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = neutron

サービス開始

#重启nova-compute服务
[root@compute ~]# systemctl stop openstack-nova-compute.service
[root@compute ~]# systemctl start openstack-nova-compute.service
#注:直接restart重启可能会导致报错

#linuxbridge架构
[root@compute ~]# systemctl start neutron-linuxbridge-agent.service
[root@compute ~]# systemctl enable neutron-linuxbridge-agent.service

検証

[root@controller ~]# openstack network agent list

#查看日志
[root@computer ~]# tail /var/log/nova/nova-compute.log

ダッシュボードコンポーネントを構成する

構成ファイルを変更する

[root@controller ~]# vi /etc/openstack-dashboard/local_settings
OPENSTACK_HOST = "controller"
ALLOWED_HOSTS = ['*', 'two.example.com']
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
CACHES = {
    'default': {
         'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
         'LOCATION': 'controller:11211',
    }
}
OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3" % OPENSTACK_HOST
OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True
OPENSTACK_API_VERSIONS = {
    "identity": 3,
    "image": 2,
    "volume": 2,
}
OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = "Default"
OPENSTACK_KEYSTONE_DEFAULT_ROLE = "user"
[root@controller ~]# vi /etc/httpd/conf.d/openstack-dashboard.conf
WSGIApplicationGroup %{GLOBAL}

サービスを再開します

[root@controller ~]# systemctl restart httpd.service memcached.service


http:// ip / dashboardにアクセスするにはWebインターフェイスブラウザにアクセスしてください

コンピューター構成シンダーサービス

燃えがらハードディスクを構成する

[root@computer~]# mkfs.xfs -f /dev/nvme0n2p1

論理ボリュームを構成する

[root@computer~]# pvcreate /dev/nvme0n2p1
[root@computer~]# vgcreate cinder-volumes /dev/nvme0n2p1

構成ファイルを変更する

[root@computer~]# vi /etc/cinder/cinder.conf
[default]
transport_url = rabbit://openstack:openstack@controller
auth_strategy = keystone
my_ip = 192.168.29.149
enabled_backends = lvm
glance_api_servers = http://controller:9292

[database]
connection = mysql+pymysql://cinder:your_password@controller/cinder

[keystone_authtoken]
www_authenticate_uri = http://controller:5000
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_id = default
user_domain_id = default
project_name = service
username = cinder
password = cinder

[oslo_concurrency]
lock_path = /var/lib/cinder/tmp

#没有lvm标签自行添加
[lvm]
volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
volume_group = cinder-volumes
iscsi_protocol = iscsi
iscsi_helper = lioadm                       

サービス開始

[root@computer~]# systemctl start openstack-cinder-volume.service  target.service 
[root@computer~]# systemctl enable openstack-cinder-volume.service  target.service 

コントローラー構成シンダーサービス

cinderユーザーを作成および構成する

[root@controller ~]# openstack user create --domain default --password-prompt cinder
[root@controller ~]# openstack role add --project service --user cinder admin

燃えがらサービスエンティティを作成する

[root@controller ~]# openstack service create --name cinderv2 --description "OpenStack Block Storage" volumev2
[root@controller ~]# openstack service create --name cinderv3 --description "OpenStack Block Storage" volumev3

燃えがらサービスエンドポイントを作成する

[root@controller ~]# openstack endpoint create --region RegionOne  volumev2 public http://controller:8776/v2/%\(project_id\)s
[root@controller ~]# openstack endpoint create --region RegionOne  volumev2 internal  http://controller:8776/v2/%\(project_id\)s
[root@controller ~]# openstack endpoint create --region RegionOne  volumev2 admin  http://controller:8776/v2/%\(project_id\)s

[root@controller ~]# openstack endpoint create --region RegionOne  volumev3 public http://controller:8776/v3/%\(project_id\)s
[root@controller ~]# openstack endpoint create --region RegionOne  volumev3 internal  http://controller:8776/v3/%\(project_id\)s
[root@controller ~]# openstack endpoint create --region RegionOne  volumev3 admin http://controller:8776/v3/%\(project_id\)s

構成ファイルの編集

[root@controller ~]# vi /etc/cinder/cinder.conf
[default]
transport_url = rabbit://openstack:openstack@controller
auth_strategy = keystone
my_ip = 192.168.29.148

[database]
connection = mysql+pymysql://cinder:your_password@controller/cinder
[keystone_authtoken]
www_authenticate_uri = http://controller:5000
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = cinder
password = cinder

[oslo_concurrency]
lock_path = /var/lib/cinder/tmp
[root@controller ~]# vi /etc/nova/nova.conf
[cinder]
os_region_name = RegionOne

データベースを同期する

[root@controller ~]# su -s /bin/sh -c "cinder-manage db sync" cinder

サービス開始

[root@controller ~]# systemctl start openstack-cinder-api.service openstack-cinder-scheduler.service 
[root@controller ~]# systemctl enable openstack-cinder-api.service openstack-cinder-scheduler.service 

ステータスを確認する

[root@controller ~]# openstack volume service list

ボリュームを作成する

#容量为1G
[root@controller ~]# cinder create --name demo_volume 1

マウントボリューム

#查看卷id
[root@controller ~]# cinder list
#挂载卷到云主机
[root@controller ~]# nova volume-attach mycentos e9804810-9dce-47f6-84f7-25a8da672800

おすすめ

転載: blog.51cto.com/14832653/2542863