openstack-pike-HA环境部署-cinder+添加cinder几点

部署cinder
1、首先进入数据库,并且创建cinder数据库设置权限(任意节点)
mysql -u root -p
CREATE DATABASE cinder;
GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'×' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'%' IDENTIFIED BY '123456';
2、退出数据库并且source admin-openrc、创建cinder用户、赋予admin权限
openstack user create --domain default --password-prompt cinder
openstack role add --project service --user cinder admin
3、创建cinder2、cinder3服务
openstack service create --name cinderv2 --description "OpenStack Block Storage" volumev2
openstack service create --name cinderv3 --description "OpenStack Block Storage" volumev3
4、创建cinder endpoint
openstack endpoint create --region RegionOne volumev2 public http://192.168.148.200:8776/v2/%\(project_id\)s
openstack endpoint create --region RegionOne volumev2 internal http://192.168.148.200:8776/v2/%\(project_id\)s
openstack endpoint create --region RegionOne volumev2 admin http://192.168.148.200:8776/v2/%\(project_id\)s

openstack endpoint create --region RegionOne volumev3 public http://192.168.148.200:8776/v3/%\(project_id\)s
openstack endpoint create --region RegionOne volumev3 internal http://192.168.148.200:8776/v3/%\(project_id\)s
openstack endpoint create --region RegionOne volumev3 admin http://192.168.148.200:8776/v3/%\(project_id\)s
5、安装cinder软件包
yum install openstack-cinder -y
6、修改配置文件
vi /etc/cinder/cinder.conf
[DEFAULT]
my_ip = 192.168.148.47
osapi_volume_listen = 192.168.148.47
log_dir = /var/log/cinder
state_path = /var/lib/cinder
auth_strategy = keystone
transport_url = rabbit://openstack:[email protected]
[database]
connection = mysql+pymysql://cinder:[email protected]/cinder
[keystone_authtoken]
auth_uri = http://192.168.148.200:5000
auth_url = http://192.168.148.200:35357
memcached_servers = controller1:11211,controller2:11211,controller3:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = cinder
password = 123456
[oslo_concurrency]
lock_path = $state_path/tmp
7、将配置文件copy到其他并且注意更改本机IP地址
8、修改权限
chmod 640 /etc/cinder/cinder.conf 
chgrp cinder /etc/cinder/cinder.conf 
9、在任一控制节点同步数据库
su -s /bin/bash cinder -c "cinder-manage db sync" 
10、启动服务并设置开机启动
systemctl restart openstack-cinder-api openstack-cinder-scheduler 
systemctl enable openstack-cinder-api openstack-cinder-scheduler
11、查看状态
openstack volume service list
######################################################################################
添加存储节点
注意:配置时间服务器、配置ssh无密钥登录
1、安装软件包
yum  -y install openstack-cinder python2-crypto targetcli
2、修改配置文件
vi /etc/cinder/cinder.conf
[DEFAULT]
my_ip = 192.168.148.50
log_dir = /var/log/cinder
state_path = /var/lib/cinder
auth_strategy = keystone
transport_url = rabbit://openstack:[email protected]
glance_api_servers = http://192.168.148.200:9292
[database]
connection = mysql+pymysql://cinder:[email protected]/cinder
[keystone_authtoken]
auth_uri = http://192.168.148.200:5000
auth_url = http://192.168.148.200:35357
memcached_servers = controller1:11211,controller2:11211,controller3:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = cinder
password = 123456
[oslo_concurrency]
lock_path = /var/lib/cinder/tmp
3、修改权限
chmod 640 /etc/cinder/cinder.conf 
chgrp cinder /etc/cinder/cinder.conf 
4、启动服务
systemctl start openstack-cinder-volume
systemctl enable openstack-cinder-volume
5、配置lvm后端存储
创建逻辑卷
pvcreate /dev/sdb 
vgcreate  Cinder-LVM /dev/sdb 
6、修改配置文件/etc/cinder/cinder.conf
[DEFAULT]
enabled_backends = lvm
[lvm]
iscsi_helper = lioadm
volume_group = Cinder-LVM
iscsi_ip_address = 192.168.148.50
volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
volumes_dir = $state_path/volumes
iscsi_protocol = iscsi
volume_backend_name = lvm
7、重启服务
systemctl restart openstack-cinder-volume
8、在计算节点上修改配置文件/etc/nova/nova.conf
[cinder]
os_region_name = RegionOne
9、在计算节点上重启服务
systemctl restart openstack-nova-compute
10、创建存储类型(控制节点执行)
openstack volume type create lvm 
openstack volume type list
cinder --os-username admin --os-tenant-name admin type-key lvm set volume_backend_name=lvm

你可能感兴趣的:(openstack-pike-HA环境部署-cinder+添加cinder几点)