11,存储节点安装cinder

文章目录

  • 11.1 cinder存储节点准备
  • 11.2 关闭防火墙和selinux
    • 11.2.1 关闭防火墙
    • 11.2.2 关闭selinux
  • 11.3 时间同步
    • 11.3.1 安装chrony
    • 11.3.2 编辑chrony配置文件
    • 11.3.3 设置时区
    • 11.3.4 启动并且配置自启动
  • 11.4 配置yum源
    • 11.4.1 安装epel与阿里yum源
    • 11.4.2 安装Rocky
  • 11.5 安装相关软件
  • 11.6 启动并且配置自启动
  • 11.7 创建LVM逻辑卷
    • 11.7.1 检查磁盘
    • 11.7.2 创建lvm卷
    • 11.7.3 创建LVM卷组
    • 11.7.4 配置LVM
  • 11.8 配置cinder
  • 11.9 启动并且配置自启动
  • 11.10 在控制节点验证cinder
  • 11.11 cinder建议

存储节点使用LVM提供服务

11.1 cinder存储节点准备

  1. 系统版本选择:CentOS Linux release 7.6.1810 (Core)
  2. 配置存储节点主机名
hostnamectl --static set-hostname cinder
  1. 配置域名解析
echo "192.168.204.10 controller" >>/etc/hosts
echo "192.168.204.11 nova" >>/etc/hosts
echo "192.168.204.12 cinder" >>/etc/hosts
echo "192.168.204.13 swift" >>/etc/hosts
cat /etc/hosts

11.2 关闭防火墙和selinux

11.2.1 关闭防火墙

systemctl stop firewalld.service
systemctl disable firewalld.service 

11.2.2 关闭selinux

setenforce 0
getenforce
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/sysconfig/selinux
grep SELINUX=disabled /etc/sysconfig/selinux

11.3 时间同步

11.3.1 安装chrony

yum install -y chrony

11.3.2 编辑chrony配置文件

vim /etc/chrony.conf

---
server 192.168.204.10 iburst

11.3.3 设置时区

timedatectl set-timezone Asia/Shanghai
chronyc sources
timedatectl status

11.3.4 启动并且配置自启动

systemctl restart chronyd.service
systemctl enable chronyd.service

11.4 配置yum源

使用互联网安装openstack需要配置epel与阿里源(如公司不允许服务器连接互联网可在内网自建yum源,把epel与阿里源同步到内网)

11.4.1 安装epel与阿里yum源

wget -O /etc/yum.repos.d/aliyun.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

11.4.2 安装Rocky

yum install centos-release-openstack-rocky -y
yum clean all
yum makecache
yum update -y

11.5 安装相关软件

yum install lvm2 device-mapper-persistent-data openstack-cinder targetcli python-keystone python-openstackclient openstack-utils openstack-selinux -y

11.6 启动并且配置自启动

systemctl start lvm2-lvmetad.service
systemctl status lvm2-lvmetad.service
systemctl enable lvm2-lvmetad.service

11.7 创建LVM逻辑卷

11.7.1 检查磁盘

fdisk -l

11.7.2 创建lvm卷

pvcreate /dev/sdb

11.7.3 创建LVM卷组

vgcreate cinder-volumes /dev/sdb

11.7.4 配置LVM

  • 如果存储节点操作系统盘使用LVM卷组,需要添加入过滤器
  • 如果计算节点操作系统盘使用LVM卷组,也需要加入过滤器
  • 默认情况下只有Openstack访问存储卷组,不过底层操作系统也会尝试管理存储卷组,或造成系统出粗
  • LVM扫描工具会扫描/dev目录,如果其他项目也使用LVM卷,那么扫描工具检测这些卷的时候会尝试缓存这些lvm卷,可能会导致操作系统或其他项目无法正常调用这些lvm卷组,所以我们需要开启过滤,只扫描包含cinder-volumes卷组的/dev/sdb
vim /etc/lvm/lvm.conf
---
devices {
filter = [ "a/sdb/", "r/.*/"]
}

11.8 配置cinder

openstack-config --set  /etc/cinder/cinder.conf database connection  mysql+pymysql://cinder:cinder@controller/cinder
openstack-config --set  /etc/cinder/cinder.conf DEFAULT transport_url  rabbit://openstack:openstack@controller
openstack-config --set  /etc/cinder/cinder.conf DEFAULT auth_strategy  keystone 
openstack-config --set  /etc/cinder/cinder.conf keystone_authtoken www_authenticate_uri  http://controller:5000
openstack-config --set  /etc/cinder/cinder.conf keystone_authtoken auth_url  http://controller:5000
openstack-config --set  /etc/cinder/cinder.conf keystone_authtoken memcached_servers  controller:11211
openstack-config --set  /etc/cinder/cinder.conf keystone_authtoken auth_type  password
openstack-config --set  /etc/cinder/cinder.conf keystone_authtoken project_domain_name  default 
openstack-config --set  /etc/cinder/cinder.conf keystone_authtoken user_domain_name  default
openstack-config --set  /etc/cinder/cinder.conf keystone_authtoken project_name  test
openstack-config --set  /etc/cinder/cinder.conf keystone_authtoken username  cinder
openstack-config --set  /etc/cinder/cinder.conf keystone_authtoken password  cinder
openstack-config --set  /etc/cinder/cinder.conf DEFAULT my_ip 192.168.202.12
openstack-config --set  /etc/cinder/cinder.conf lvm volume_driver cinder.volume.drivers.lvm.LVMVolumeDriver
openstack-config --set  /etc/cinder/cinder.conf lvm volume_group cinder-volumes
openstack-config --set  /etc/cinder/cinder.conf lvm iscsi_protocol  iscsi
openstack-config --set  /etc/cinder/cinder.conf lvm iscsi_helper  lioadm
openstack-config --set  /etc/cinder/cinder.conf DEFAULT enabled_backends  lvm
openstack-config --set  /etc/cinder/cinder.conf DEFAULT glance_api_servers  http://controller:9292
openstack-config --set  /etc/cinder/cinder.conf oslo_concurrency lock_path  /var/lib/cinder/tmp

11.9 启动并且配置自启动

systemctl start openstack-cinder-volume.service target.service
systemctl status openstack-cinder-volume.service target.service
systemctl enable openstack-cinder-volume.service target.service

11.10 在控制节点验证cinder

source /script/admin.sh
openstack volume service list

11.11 cinder建议

  1. 不建议使用磁盘迁移,扩容,缩容等
  2. 重要数据不用使用云硬盘,使用本地磁盘存储数据

你可能感兴趣的:(Openstack)