You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by GitBox <gi...@apache.org> on 2018/11/08 09:00:02 UTC

[GitHub] shaofengshi closed pull request #340: add "use mysql as metastore" in cn&en

shaofengshi closed pull request #340:  add "use mysql as metastore" in cn&en
URL: https://github.com/apache/kylin/pull/340
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/website/_data/docs.yml b/website/_data/docs.yml
index bd33d5f48a..c17d4b582e 100644
--- a/website/_data/docs.yml
+++ b/website/_data/docs.yml
@@ -49,6 +49,7 @@
   - tutorial/use_dashboard
   - tutorial/setup_jdbc_datasource
   - tutorial/hybrid
+  - tutorial/mysql_metastore
 
 - title: Integration
   docs:
diff --git a/website/_docs/tutorial/mysql_metastore.cn.md b/website/_docs/tutorial/mysql_metastore.cn.md
new file mode 100644
index 0000000000..499909064d
--- /dev/null
+++ b/website/_docs/tutorial/mysql_metastore.cn.md
@@ -0,0 +1,76 @@
+---
+layout: docs-cn
+title:  基于 MySQL 的 Metastore 配置
+categories: 教程
+permalink: /cn/docs/tutorial/mysql_metastore.html
+since: v2.5.0
+---
+
+Kylin 支持 MySQL 作为 Metastore 存储。
+
+> **注意**:该功能还在测试中,建议您谨慎使用。
+
+
+
+### 准备工作
+
+1.安装 MySQL 服务,例如 v5.1.17
+2.下载 MySQL 的  JDBC 驱动 ( `mysql-connector-java-<version>.jar`) 并放置到 `$KYLIN_HOME/ext/` 目录下
+
+> 提示:如果没有该目录,请自行创建。
+
+
+
+### 配置方法
+
+1.在 MySQL 中新建一个专为存储 Kylin 元数据的数据库,例如 `kylin`;
+
+2.在配置文件 `kylin.properties` 中配置 `kylin.metadata.url={metadata_name}@jdbc`,该参数中各配置项的含义如下,其中 `url`、`username` 和 `password` 为必须配置项,其他项如果不配置将使用默认值。
+
+> 提示:`{metadata_name}` 需要替换成用户需要的元数据表名,如果这张表已存在,会使用现有的表;如果不存在,则会自动创建该表。
+
+- `url`:JDBC 连接的 URL
+- `username`:JDBC 的用户名
+- `password`:JDBC 的密码,如果对密码进行了加密,填写加密后的密码
+- `driverClassName`: JDBC 的 driver 类名,默认值为 com.mysql.jdbc.Driver
+- `maxActive`:最大数据库连接数,默认值为 5
+- `maxIdle`:最大等待中的连接数量,默认值为 5
+- `maxWait`:最大等待连接毫秒数,默认值为 1000
+- `removeAbandoned`:是否自动回收超时连接,默认值为 true
+- `removeAbandonedTimeout`:超时时间秒数,默认为 300
+- `passwordEncrypted`:是否对 JDBC 密码进行加密,默认为 false
+
+> 提示:如果需要对 JDBC 密码进行加密,请在 `$KYLIN_HOME/tomcat/webapps/kylin/WEB-INF/lib/`下运行如下命令:
+
+```sh
+java -classpath kylin-server-base-<version>.jar\
+:kylin-core-common-<version>.jar\
+:spring-beans-4.3.10.RELEASE.jar:spring-core-4.3.10.RELEASE.jar\
+:commons-codec-1.7.jar \
+org.apache.kylin.rest.security.PasswordPlaceholderConfigurer \
+AES <your_password>
+```
+
+如在 Kylin v2.5 中,执行如下命令:
+
+```sh
+java -classpath kylin-server-base-2.5.0.jar\
+:kylin-core-common-2.5.0.jar\
+:spring-beans-4.3.10.RELEASE.jar\
+:spring-core-4.3.10.RELEASE.jar\
+:commons-codec-1.7.jar \
+org.apache.kylin.rest.security.PasswordPlaceholderConfigurer \
+AES test123
+```
+
+3.由于元数据不依赖于 HBase,所以需要在配置文件 `$KYLIN_HOME/conf/kylin.properties` 中添加 ZooKeeper 的连接项 `kylin.env.zookeeper-connect-string = host:port`。
+
+4.`kylin.properties` 的样例配置如下:
+
+```properties
+kylin.metadata.url=mysql_test@jdbc,url=jdbc:mysql://localhost:3306/kylin,username=kylin_test,password=bUmSqT/opyqz89Geu0yQ3g==,maxActive=10,maxIdle=10,passwordEncrypted=true
+kylin.env.zookeeper-connect-string=localhost:2181
+```
+
+5.启动 Kylin
+
diff --git a/website/_docs/tutorial/mysql_metastore.md b/website/_docs/tutorial/mysql_metastore.md
index 1674268c74..d4096258af 100644
--- a/website/_docs/tutorial/mysql_metastore.md
+++ b/website/_docs/tutorial/mysql_metastore.md
@@ -1,52 +1,76 @@
 ---
-layout: docs-cn
-title:  基于 MySQL 的 Metastore 配置
-categories: 教程
-permalink: /cn/docs/tutorial/mysql_metastore.html
+layout: docs
+title:  Use MySQL as Metastore
+categories: tutorial
+permalink: /docs/tutorial/mysql_metastore.html
 since: v2.5.0
 ---
 
-Kylin 支持 MySQL 作为 Metastore 存储。
-> **注意**:该功能还在测试中,建议您谨慎使用*
+Kylin supports MySQL as Metastore.
 
-### 准备工作
+> *Note*: This feature is still under test and please use it with caution.
 
-1.安装 MySQL 服务,例如 v5.1.17
-2.下载 MySQL 的  JDBC 驱动 ( `mysql-connector-java-<version>.jar`) 并放置到 `$KYLIN_HOME/ext/` 目录下
-> 提示:如果没有该目录,请自行创建。
 
 
+### Prerequisites
 
-### 配置方法
-1.在 MySQL 中新建一个专为存储 Kylin 元数据的数据库,例如 `kylin_metadata`;
-2.在配置文件 `kylin.properties` 中配置如下参数:
+1. Install MySQL, such as v5.1.17
+2. Download the MySQL JDBC driver ( `mysql-connector-java-<version>.jar`) and place it in the `$KYLIN_HOME/ext/` directory.
 
-```properties
-kylin.metadata.url={your_metadata_tablename}@jdbc,url=jdbc:mysql://localhost:3306/kylin,username={your_username},password={your_password}
-kylin.metadata.jdbc.dialect=mysql
-kylin.metadata.jdbc.json-always-small-cell=true
-kylin.metadata.jdbc.small-cell-meta-size-warning-threshold=100mb
-kylin.metadata.jdbc.small-cell-meta-size-error-threshold=1gb
-kylin.metadata.jdbc.max-cell-size=1mb
+> Tip: Please create it yourself, if you do not have this directory.
+
+
+
+### Configuration Steps
+
+1. Create a new database in MySQL for storing Kylin metadata, such as `kylin`
+
+2. Configure `kylin.metadata.url={metadata_name}@jdbc` in the configuration file `kylin.properties`. 
+The description of each configuration item in this parameter is as follows, where `url`, `username` and `password` are required.
+
+> Tip: `{metadata_name}` needs to be replaced with the metadata table name, if the table already exists, the existing table will be used; if it does not exist, the table will be created automatically.
+
+- `url`: URL of the JDBC connection
+- `username`: JDBC username
+- `password`: JDBC password, if the password is encrypted, fill in the encrypted password
+- `driverClassName`: JDBC driver class name. The default value is *com.mysql.jdbc.Driver*
+- `maxActive`: Maximum number of database connections. The default value is 5
+- `maxIdle`: Maximum number of connections waiting. The default value is 5
+- `maxWait`: Maximum number of milliseconds to wait for connection. The default value is 1000.
+- `removeAbandoned`: Whether to automatically reclaim timeout connections. The default value is *TRUE*
+- `removeAbandonedTimeout`: timeout seconds. The default value is 300
+- `passwordEncrypted`: Whether to encrypt the JDBC password. The default value is *FALSE*
+
+> Note: To encrypt the JDBC password, run the following command under `$KYLIN_HOME/tomcat/webapps/kylin/WEB-INF/lib/`:
+
+```sh
+Java -classpath kylin-server-base-<version>.jar\
+:kylin-core-common-<version>.jar\
+:spring-beans-4.3.10.RELEASE.jar:spring-core-4.3.10.RELEASE.jar\
+:commons-codec-1.7.jar \
+org.apache.kylin.rest.security.PasswordPlaceholderConfigurer \
+AES <your_password>
 ```
 
-`kylin.metadata.url` 中各配置项的含义如下,其中 `url`、`username` 和 `password` 为必须配置项,其他项如果不配置将使用默认值。
+As in Kylin v2.5, execute the following command:
 
-- `url`:JDBC 连接的 URL
-- `username`:JDBC 的用户名
-- `password`:JDBC 的密码,如果对密码进行了加密,填写加密后的密码
-- `driverClassName`: JDBC 的 driver 类名,默认值为 com.mysql.jdbc.Driver
-- `maxActive`:最大数据库连接数,默认值为 5
-- `maxIdle`:最大等待中的连接数量,默认值为 5
-- `maxWait`:最大等待连接毫秒数,默认值为 1000
-- `removeAbandoned`:是否自动回收超时连接,默认值为 true
-- `removeAbandonedTimeout`:超时时间秒数,默认为 300
-- `passwordEncrypted`:是否对 JDBC 密码进行加密,默认为 false
+```sh
+Java -classpath kylin-server-base-2.5.0.jar\
+:kylin-core-common-2.5.0.jar\
+:spring-beans-4.3.10.RELEASE.jar\
+:spring-core-4.3.10.RELEASE.jar\
+:commons-codec-1.7.jar \
+org.apache.kylin.rest.security.PasswordPlaceholderConfigurer \
+AES test123
+```
+
+3. Since the metadata does not depend on HBase, you need to add the ZooKeeper connection configuration `kylin.env.zookeeper-connect-string = host:port` in the configuration file `kylin.properties`.
 
-3.如果需要对 JDBC 密码进行加密,请在 `$KYLIN_HOME/tomcat/webapps/kylin/WEB-INF/lib/`下运行如下命令:
+4. The sample configuration of `kylin.properties` is as follows:
 
-```shell
-java -classpath kylin-server-base-\<version\>.jar`kylin-core-common-\<version\>.jar`spring-beans-4.3.10.RELEASE.jar`spring-core-4.3.10.RELEASE.jar`commons-codec-1.7.jar org.apache.kylin.rest.security.PasswordPlaceholderConfigurer AES <your_password>
+```properties
+Kylin.metadata.url=mysql_test@jdbc,url=jdbc:mysql://localhost:3306/kylin,username=kylin_test,password=bUmSqT/opyqz89Geu0yQ3g==,maxActive=10,maxIdle=10,passwordEncrypted=true
+Kylin.env.zookeeper-connect-string=localhost:2181
 ```
 
-4.启动 Kylin
\ No newline at end of file
+5. Start Kylin
\ No newline at end of file


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services