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

来源:互联网 发布:校园网络需求报告 编辑:程序博客网 时间:2024/05/16 06:59
问题导读

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




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


[Bash shell] 纯文本查看 复制代码
?
1
2
echo"debhttp://ubuntu-cloud.archive.canonical.com/ubuntu" \
  "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-getinstallmariadb-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
passwordforthe root user.  If you've just installed MariaDB, and
you haven't setthe root password yet, the password will be blank,
so you should just press enter here.
 
Enter current password forroot (enter fornone):
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 fortesting, and to makethe installation
阅读全文
0 0
原创粉丝点击