基础组件安装
- 安装MariaDB(数据库)
- 安装RabbitMQ(消息队列)
- 安装Memcached(缓存)
安装MariaDB(数据库)
- 安装
# yum install mariadb mariadb-server python2-PyMySQL -y
- 数据库配置
# cat >> /etc/my.cnf.d/openstack.cnf << EOF
[mysqld]
bind-address = 192.168.0.11default-storage-engine = innodb
innodb_file_per_table = on
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8
EOF
- 设置开机启动并启动服务
# systemctl enable mariadb.service
# systemctl start mariadb.service
- 安全初始化
# mysql_secure_installation
- 验证
# systemctl status mariadb.service
- 编码查看(Mariadb默认的编码是latin1,openstack环境要求utf8)
通过show variables like 'character%'语句验证
安装RabbitMQ(消息队列)
- 安装
# yum install rabbitmq-server -y
- 设置开机启动并启动服务
# systemctl enable rabbitmq-server.service
# systemctl start rabbitmq-server.service
- 添加用户并授权
# rabbitmqctl add_user openstack RABBIT_PASS
# rabbitmqctl set_permissions openstack ".*" ".*" ".*"
- 验证
# systemctl status rabbitmq-server.service
- 修改RabbitMQ最大连接数
注: OpenStack部署完成后使用,经常出现mq连接超时,导致需要重启nova-api等服务。解决方法是将mq的连接数调大。
- 查看连接数数据:
# rabbitmqctl status | grep sockets
配置service中【打开文件最大数】,虽然调整的是打开文件最大数,但是sockets_limit也相应增大了,查询文档得知sockets_limit通常是total_limit的0.8到0.9。
- 添加LimitNOFILE=65535配置
- 重新加载service并重启
# systemctl daemon-reload
# systemctl restart rabbitmq-server.service
# vi /usr/lib/systemd/system/rabbitmq-server.service
- 验证:
# rabbitmqctl status | grep sockets
安装Memcached(缓存)
- 安装
# yum install memcached python-memcached -y
- 配置
# vi /etc/sysconfig/memcached
- 设置开机启动并启动服务
# systemctl enable memcached.service
# systemctl start memcached.service
- 验证
# systemctl status memcached.service