先电openstack的搭建之基础服务

openstack基础服务的搭建

在上一篇文章中我们已经将我们的基本环境搭建成功了(详见主页),这次我们将对openstack中基础的服务进行搭建(全部在controller中做)。
1.数据库(可以使用mysql,我这里使用mariadb)
数据库在OpenStack中是非常常用的软件,用户数据、以及各个组件里面的数据都存储在数据库中

yum install -y  mariadb mariadb-server python2-PyMySQL 安装数据库
(python2-PyMySQL是用于openstack各个组件连接数据库使用)

在这里插入图片描述
然后对mariadb的配置文件进行编辑
vim /etc/my.conf

在[mysqld]下面添加
default-storage-engine=innodb 定义使用的引擎
innodb_file_per_table 一个表为一个文件
collation-server=utf8_general_ci 定义字符集
init-connect='SET NAMES utf8'
character-set-server=utf8
max_connections=10000 定义最大连接数

cd /usr/lib/systemd/system

对mariadb的启动文件进行优化
vim mariadb.service 
LimitNPROC=10000 最大多少文件
LimitNOFILE=10000 最大启动多少资源

随后启动mariadb
systemctl start mariadb
systemctl enable mariadb
对mariadb进行安全设置
mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] n
 ... skipping.

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB

安全设置时不要禁止root用户远程登录。并为root设置密码

在compute上安装

yum install -y python2-PyMySQL

2.mongodb的安装与配置(controller节点)

yum install -y mongodb-server mongodb
vi   /etc/mongod.conf
注释bind_ip  (表示监听所有主机)

在这里插入图片描述
systemctl start mongod
systemctl enable mongod

3.rabbitmq的安装与配置(controller节点)
rabbitmq为消息队列,是各个组件内部同行的工具。
流程:一个组件中的应用程序讲一个任务发布到mq中,mq接受到任务后将任务转发给指定执行的主机,任务完成后,将结果返回给发布任务的主机。mq具有原子性,即不可分割性。任务只能有两种情况,一种完成,一种没有完成。只有任务完成了,并且返回了结果后。mq才会将这个任务在消息队列中删除。否则会循环发送。上一任务结束了才能进行下一任务。

安装

yum install -y rabbitmq-server 
安装完成后,要先开启,再做后面的操作
systemctl start rabbitmq-server
systemctl enable rabbitmq-server

因为在整个的云平台中,我们要实现的是远程的连接和登录,而我们的rabbitmq默认的用户guest是不支持远程登录的。所以我们要新创建一个用户,用于远程登录,从而使用rabbitmq

rabbitmqctl add_user  openstack  123456  指定创建的用户名为openstack  密码为123456
rabbitmqctl  set_permissions openstack  ".*" ".*"  ".*"    给予openstack用户所有权限

在这里插入图片描述

我们的rabbitmq还提供了一个web的管理界面

开启web管理界面
rabbitmq-plugins  list
rabbitmq-plugins  enable rabbitmq_management
rabbitmq-plugins  enable rabbitmq_management_agent

在这里插入图片描述
做完上面的这些以后就可以通过web界面访问到rabbitmq了

你的ip地址加上15672的端口号,默认的用户名guest 密码与账户名一样

登录后将openstack用户设为管理员,让openstack可以登录
在这里插入图片描述
4.memcached安装与配置
memcached相当于一个数据库,用户放置用户的认证令牌,一般的数据库是运行在硬盘上,而memcached运行在内存中,运行的速度快。

yum install -y memcached  python-memcached
systemctl start   memcached
systemctl enable memcached

python-memcached是各个组件调用memcached使用的,因为memcached中缓存了很多用户的认证信息,用户去访问和调用各个组件的使用,各个组件要到memcached中查看用户的令牌,用于keystone的对比,从而得知用户有那些权限

以上就是openstack中的基础服务的配置了

作者:int32bit 链接:https://www.zhihu.com/question/54549481/answer/141308600 来源:知乎 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。 基于OpenStack的论文国内外还是不少的,参考IEEE Xplore Search Results,毕竟火了那么多年,而且无论你偏系统还是偏研究都能写,但是纯粹写OpenStack部署的论文估计不多,除非你自己开发了一套自动化部署工具,比现有的Puppet、Ansible、Tripleo、Fuel、Kolla都要好,大多论文都需要与其它技术或者应用场景相结合,否则你的研究背景和意义都不知道怎么入手。偏系统的论文诸如基于OpenStack的xx系统(或者平台)设计与实现,xx可以是各种场景化的云系统,比如xx替换为视频监控云,则标题变为基于OpenStack的视频监控云平台设计与实现,你可以谈传统视频监控系统的各种问题,然后突出你设计的基于OpenStack的视频监控云平台的优势。为了演示,做个漂亮高大上的Web界面,直接拿Horizon去展示,怕要被导师拍死。偏研究的话,你可以针对某一个点展开,通常就是优化了,比较多的研究点包括调度算法优化、在线迁移优化、负载均衡优化、计算性能优化、虚拟化性能优化、能源损耗优化等,尤其是调度算法,你可以联想抽象出各种问题,比如装箱问题、启发算法、遗传算法都能套,优点也好写,要么提高了资源利用率,要么节约了能源(还可以结合绿色计算写)。当然,你也可以针对OpenStack开发一套自己的系统,比如集成测试系统、故障检测、bug发现等,之前看过一篇不错的论文,等找到了再补充。
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值