1, mounted on the storage node assembly cinder
-y APT install Cinder-Volume python3-MySQLdb python3-rtslib- fb
# configuration file
mv /etc/cinder/cinder.conf / etc / Cinder / cinder.conf.org # backup official
vi / etc / Cinder / cinder.conf
# modified as follows
# Create new new
[the DEFAULT]
debug = True # enable debugging
# admin project_id and user_id, modified according to their own situation, acting as a mirrored cache function, improve performance
# OpenStack Project List
cinder_internal_tenant_project_id = 9dd9ec3cf67b4e749fef7ad50ac8de39
# OpenStack User List
cinder_internal_tenant_user_id = 9dd9ec3cf67b4e749fef7ad50ac8de39
# own IP address the DEFINE
my_ip= 192.168 . 222.25 # the API the IP
rootwrap_config = / etc / Cinder / rootwrap.conf
api_paste_confg = / etc / Cinder / the API- paste.ini
state_path = / var / lib / Cinder
auth_strategy = Keystone
# RabbitMQ Connection info
transport_url = Rabbit: // OpenStack: [email protected]
enable_v3_api = True
# the Glance Connection info
glance_api_servers = HTTP: // IP 192.168.220.29:9292 # here to configure the storage network, download the image to a local
enabled_backends = LVM
# Wipe Data Better Method
volume_clear = ZERO
volume_clear_size = 100
#volume_clear_ionice = - C3
# MariaDB Connection info
[Database]
Connection = MySQL + pymysql: // Cinder : [email protected]/cinder
# Keystone auth info
[keystone_authtoken]
www_authenticate_uri = HTTP: // 192.168.222.29:5000
auth_url = HTTP: // 192.168.222.29:5000
memcached_servers = 192.168 . 222.29:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = cinder
password = servicepassword
[oslo_concurrency]
lock_path = $state_path/tmp
[lvm]
target_helper = tgtadm
target_protocol = iscsi
# IP address of Storage Node,include storage network
target_ip_address = 192.168.220.25 # 这里修改为存储网IP
# volume group name just created
volume_group = cinder-Volumes
volume_backend_name = raid_sata
volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
volumes_dir = $ state_path / Volumes
# the Add Image - Volume Cache
image_volume_cache_enabled = True
image_volume_cache_max_size_gb = 100
image_volume_cache_max_count = 50
# modify file permissions
chmod 644 / etc / Cinder / cinder.conf
chown root: Cinder / etc / Cinder / cinder.conf
# 重启服务
Cinder restart systemctl -volume # service boot machine from the start
2, the volume on the storage node configuration
# 编辑配置文件
/etc/lvm/lvm.conf
# 修改如下
filter = [ "a/sdc/", "a/sde/", "r/.*/"] # 过滤,,只用sdc磁盘
# 这里的sdc是用raid卡做的一块7TB的磁盘
pvcreate /dev/sdc /dev/sde # 加入物理磁盘
vgcreate cinder-volumes /dev/sdc /dev/sde # 创建cinder-volumes卷
apt -y install tgt thin-provisioning-tools # 带存储卷的精简功能
# 绑定target在storage network,(以下步骤可选,默认绑定在所有接口)
# 以下的配置不用执行,只是作为参考用,以下配置本人做了设置,但是还是没有在特定的IP 192.168.220.25上侦听3260端口,还望高手指点;(tgt服务默认在本机上侦听了所有接口。)
# vi /etc/init.d/tgt
# 修改如下
# --make-pidfile --background --exec --iscsi portal=192.168.220.25:3260 $DAEMON # 在start中,添加--iscsi portal=192.168.220.25:3260
# systemctl restart cinder-volume tgt # 服务开机自启动
3、在控制节点上验证
openstack volume service list