简体   繁体   English

Swisscom云上的Maria DB配置

[英]Maria DB configuration on Swisscom cloud

We are going to use next stack: Tomcat 8/Java 8 buildpacked + ELK + S3 + Maria DB. 我们将使用下一个堆栈:Tomcat 8 / Java 8 buildpacked + ELK + S3 + Maria DB。

We prepared our package and deployments process is starting ok, but we are stuck on configuring Maria DB. 我们准备好了我们的包和部署过程,但我们仍然坚持配置Maria DB。 More specifically we need at least next parameters to be set in my.cnf file of the Maria (Mysql): 更具体地说,我们至少需要在Maria(Mysql)的my.cnf文件中设置下一个参数:

lower_case_table_names = 1 transaction-isolation = READ-COMMITTED collation-server = utf8_general_ci character-set-server = utf8

Does anyone know how to do this? 有谁知道如何做到这一点? Because only thing we found that could be used is next from Swisscom Manual -> https://docs.developer.swisscom.com/devguide/services/managing-services.html "Update a Service Instance" section, but there is no chance to find Maria DB service parameters that could be used. 因为我们发现只能使用的东西是瑞士通信手册 - > https://docs.developer.swisscom.com/devguide/services/managing-services.html “更新服务实例”部分,但是没有机会找到可以使用的Maria DB服务参数。

Swisscom's MariaDB offering is a Galera Cluster shared for all customers. Swisscom的MariaDB产品是为所有客户共享的Galera集群。 The customers have their own database. 客户拥有自己的数据库。

Customers can't modify global my.cnf parameters. 客户无法修改全局my.cnf参数。 The global config is the same for every customer. 每个客户的全局配置都是相同的。

The team is currently in progress optimise the Galera cluster, stay tuned, soon the default MariaDB parameter will be much better for DBaaS. 该团队目前正在优化Galera集群,敬请关注,很快,默认的MariaDB参数对DBaaS来说会好得多。 Still you can't modify global variables. 仍然无法修改全局变量。

Customer can modify session variables 客户可以修改会话变量

There are two scopes in which system variables exist. 存在两个系统变量的范围。 Global variables affect the overall operation of the server. 全局变量会影响服务器的整体操作。 Session variables affect its operation for individual client connections. 会话变量会影响其对各个客户端连接的操作。 A given system variable can have both a global and a session value. 给定的系统变量可以同时具有全局值和会话值。

Most (not all) variables can be also defined on a session level. 大多数(并非所有)变量也可以在会话级别定义。

To be more specific for your questions 更具体地针对您的问题

You can set in your code for each transaction the preferred level 您可以在代码中为每个事务设置首选级别

SET TRANSACTION ISOLATION LEVEL READ-COMMITTED;

The variable lower_case_table_names have only global scope and you can't set it per session. 变量lower_case_table_names只有全局范围,您不能为每个会话设置它。

Variable Scope Global 可变范围全局

> show global variables like 'lower_case_table_names';
+------------------------+-------+
| Variable_name          | Value |
+------------------------+-------+
| lower_case_table_names | 0     |
+------------------------+-------+
1 row in set (0.00 sec)

The character set and collation can be set for each table. 可以为每个表设置字符集和排序规则。 See Table Character Set and Collation 请参阅表格字符集和排序规则

Every table has a table character set and a table collation. 每个表都有一个表字符集和一个表格排序规则。 The CREATE TABLE and ALTER TABLE statements have optional clauses for specifying the table character set and collation. CREATE TABLEALTER TABLE语句具有用于指定表字符集和排序规则的可选子句。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM