配置glance使用NFS後端

2022-07-26 09:27:14 字數 3515 閱讀 8017

首先先使用「glance image-delete」命令刪除所有映象,釋放磁碟空間。

停止glance服務:

service openstack-glance-api stop

service openstack-glance-registry stop

停止swift服務:

service openstack-swift-proxy stop

service openstack-swift-account stop

service openstack-swift-account-auditor stop

service openstack-swift-account-reaper stop

service openstack-swift-account-replicator stop

service openstack-swift-container stop

service openstack-swift-container-auditor stop

service openstack-swift-container-replicator stop

service openstack-swift-container-updater stop

service openstack-swift-object stop

service openstack-swift-object-auditor stop

service openstack-swift-object-replicator stop

service openstack-swift-object-updater stop

禁用swift服務:

chkconfig openstack-swift-proxy off

chkconfig openstack-swift-account off

chkconfig openstack-swift-account-auditor off

chkconfig openstack-swift-account-reaper off

chkconfig openstack-swift-account-replicator off

chkconfig openstack-swift-container off

chkconfig openstack-swift-container-auditor off

chkconfig openstack-swift-container-replicator off

chkconfig openstack-swift-container-updater off

chkconfig openstack-swift-object off

chkconfig openstack-swift-object-auditor off

chkconfig openstack-swift-object-replicator off

chkconfig openstack-swift-object-updater off

備份glance配置檔案:

改為:[glance_store]

default_store=file

filesystem_store_datadir=/var/lib/glance/images

解除安裝掛載點並授權:

umount /var/lib/glance

rm -rf /var/lib/glance/*

mkdir -p /var/lib/glance/images

chown -r glance:glance /var/lib/glance

掛載nfs:

mount 168.5.22.100:/images /var/lib/glance/images

chown -r glance:glance /var/lib/glance/images

chmod 755 /var/lib/glance/images

修改fstab檔案:

vi /etc/fstab

uuid=bb4264a8-3eb0-4ac1-93a2-0ef17821c40a /var/lib/glance xfs defaults 0 0

改為:168.5.22.100:/images /var/lib/glance/images nfs defaults 0 0

檢視glance使用者密碼:

cat /etc/glance/glance-api.conf|grep sql_connection

sql_connection=mysql:

密碼是:6cayczh8

在任一節點重建資料庫:

mysql -h 168.5.23.2 -u glance -p -e 'drop database glance;'

mysql -h 168.5.23.2 -u glance -p -e 'create database glance;'

su -s /bin/sh -c "glance-manage db sync" glance

在任一節點:

source openrc

keystone endpoint-delete 41dca7df60244d7a8b509e019560c1d9

keystone service-delete b7409203b63348d9acefe5463e3880e3

啟動glance服務:

service openstack-glance-api start

service openstack-glance-registry start

測試上傳映象:

glance image-create --name "testvm" --file /root/testvm.img --disk-format qcow2 --container-format bare --is-public true --progress

nfs 配置及其使用

next previous contents mkdir home share chown nobody.nogroup home share 這個檔案的內容非常簡單,每一行由丟擲路徑,客戶名列表以及每個客戶名後緊跟的訪問選項構成 共享的目錄 主機名或ip 引數,引數 其中引數是可選的,當不指定引數...

nfs配置和使用

nfs伺服器在嵌入式開發中非常常用,可以實現主機和開發板共享檔案。1 安裝軟體包 apt getinstall nfs common nfs kernel server portmap 2 配置 mkdir nfs vim etc exports 增加下面一行的內容 nfs rw,sync,no r...

配置nova instances使用NFS後端

首先先使用 nova delete 命令刪除所有例項,釋放磁碟空間。停止nova服務 service libvirtd stop service openstack nova compute stop 清空目錄 rm rf var lib nova instances 掛載nfs mount 168...