openstack【Kilo】入门 【准备篇】三:mysql(MariaDB)安装【控制节点】

问题导读

1.MariaDB与mysql的关系是什么?
2.遇到Checking for corrupt, not cleanly closed and upgrade needing tables.该如何解决?




安装mysql之前首先安装OpenStack 库
[Bash shell]  纯文本查看  复制代码
?
1
apt-get install ubuntu-cloud-keyring


[Bash shell]  纯文本查看  复制代码
?
1
2
   "trusty-updates/kilo main" > /etc/apt/sources .list.d /cloudarchive-kilo .list


[Bash shell]  纯文本查看  复制代码
?
1
apt-get update && apt-get dist-upgrade


如果不安装openstack库,直接安装keystone,会keystone能够安装成功,但是keystone启动后,接着就会失败。造成keystone为unknown instance


为什么产生MariaDB
首先这里介绍一下,大家对MariaDB可能不太熟悉,MariaDB数据库管理系统是MySQL的一个分支,主要由开源社区在维护,采用GPL授权许可。开发这个分支的原因之一是:甲骨文公司收购了MySQL后,有将MySQL闭源的潜在风险,因此社区采用分支的方式来避开这个风险。

根据官网文档:
安装
[Bash shell]  纯文本查看  复制代码
?
1
apt-get install mariadb-server python-mysqldb


修改配置文件


创建文件/etc/mysql/conf.d/mysqld_openstack.cnf完成下面内容:

a.在 [mysqld]部分,设置 bind-address 为控制节点管理网络ip地址,使能通过管理网络访问其它节点
[Bash shell]  纯文本查看  复制代码
?
1
2
3
[mysqld]
...
bind-address = 10.0.0.11



b.在 [mysqld] 部分,完成下面内容
[Bash shell]  纯文本查看  复制代码
?
1
2
3
4
5
6
7
[mysqld]
...
default-storage-engine = innodb
innodb_file_per_table
collation-server = utf8_general_ci
init-connect = 'SET NAMES utf8'
character- set -server = utf8



#######################################

下面是官网修改前内容,为废弃内容
/etc/mysql/my.cnf

找到bind-address           = 127.0.0.1
修改为下面:
[Bash shell]  纯文本查看  复制代码
?
1
2
3
[mysqld]
...
bind-address = 10.0.0.11



然后在新增如下内容:
[Bash shell]  纯文本查看  复制代码
?
1
2
3
4
5
6
7
[mysqld]
...
default-storage-engine = innodb
innodb_file_per_table
collation-server = utf8_general_ci
init-connect = 'SET NAMES utf8'
character- set -server = utf8


注意:不要带上[mysqld]

####################################################

重启mysql

[Bash shell]  纯文本查看  复制代码
?
1
service mysql restart


输出如下信息
* Stopping MariaDB database server mysqld                                                                                                    [ OK ] 
* Starting MariaDB database server mysqld                                                                                                    [ OK ] 
* Checking for corrupt, not cleanly closed and upgrade needing tables.




这个只是个提示,告诉你在做什么。不管它


新补充内容:
执行下面命令:
[Bash shell]  纯文本查看  复制代码
?
1
mysql_secure_installation


按照提示,设定即可



[Bash shell]  纯文本查看  复制代码
?
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28


# 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 isintended only for testing, and to make the installation
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值