This is an automated email from the ASF dual-hosted git repository.

xxyu pushed a commit to branch doc5.0
in repository https://gitbox.apache.org/repos/asf/kylin.git


The following commit(s) were added to refs/heads/doc5.0 by this push:
     new 765c73be12 KYLIN-5221, add rdbms metastore
765c73be12 is described below

commit 765c73be1205119c5923885ad95dd4d1e723248a
Author: Mukvin <boyboys...@163.com>
AuthorDate: Thu Aug 11 19:08:26 2022 +0800

    KYLIN-5221, add rdbms metastore
---
 .gitignore                                         |   1 +
 website/docs/deployment/images/jdk.en.png          | Bin 0 -> 18619 bytes
 .../docs/deployment/network_port_requirements.md   |  39 ++++
 website/docs/deployment/prerequisite.md            | 189 +++++++++++++++++
 .../rdbms_metastore/default_metastore.md           |  83 ++++++++
 .../images/install_initialize_postgresql.png       | Bin 0 -> 417739 bytes
 .../images/installation_create_postgresqldb.jpg    | Bin 0 -> 184743 bytes
 .../deployment/rdbms_metastore/install_mysql.md    | 120 +++++++++++
 .../rdbms_metastore/install_postgresql.md          | 230 +++++++++++++++++++++
 website/docs/deployment/rdbms_metastore/intro.md   |  18 ++
 website/sidebars.js                                |  40 ++++
 11 files changed, 720 insertions(+)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000..85e7c1dfcb
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/.idea/
diff --git a/website/docs/deployment/images/jdk.en.png 
b/website/docs/deployment/images/jdk.en.png
new file mode 100644
index 0000000000..4c41564e3f
Binary files /dev/null and b/website/docs/deployment/images/jdk.en.png differ
diff --git a/website/docs/deployment/network_port_requirements.md 
b/website/docs/deployment/network_port_requirements.md
new file mode 100644
index 0000000000..55e04ebf7c
--- /dev/null
+++ b/website/docs/deployment/network_port_requirements.md
@@ -0,0 +1,39 @@
+---
+title: Network Port Requirements
+language: en
+sidebar_label: Network Port Requirements
+pagination_label: Network Port Requirements
+toc_min_heading_level: 2
+toc_max_heading_level: 6
+pagination_prev: null
+pagination_next: null
+keywords:
+   - Network Port
+draft: false
+last_update:
+    date: 11/08/2022
+---
+
+Kylin needs to communicate with different components. The following are the 
ports that need to be opened to Kylin. This table only includes the default 
configuration of the Hadoop environment, and does not include the configuration 
differences between Hadoop platforms.
+
+| Component            | Port          | Function                              
                       | Required |
+| -------------------- | ------------- | 
------------------------------------------------------------ | -------- |
+| SSH                  | 22            | SSH to connect to the port of the 
virtual machine where KE is located | Y        |
+| Kylin                | 7070          | Kylin access port                     
                       | Y        |
+| Kylin                | 7443          | Kylin HTTPS access port               
                       | N        |
+| HDFS                 | 8020          | HDFS receives client connection RPC 
port                     | Y        |
+| HDFS                 | 50010         | Access HDFS DataNode, data 
transmission port                 | Y        |
+| Hive                 | 10000         | HiveServer2 access port               
                       | N        |
+| Hive                 | 9083          | Hive Metastore access port            
                       | Y        |
+| Zookeeper            | 2181          | Zookeeper access port                 
                       | Y        |
+| Yarn                 | 8088          | Yarn Web UI access port               
                       | Y        |
+| Yarn                 | 8090          | Yarn Web UI HTTPS access port         
                       | N        |
+| Yarn                 | 8050 / 8032   | Yarn ResourceManager communication 
port                      | Y        |
+| Spark                | 4041          | Kylin query engine Web UI default 
port        | Y        |
+| Spark                | 18080         | Spark History Server port             
                       | N        |
+| Spark                | (1024, 65535] | The ports occupied by Spark Driver 
and Executor are random   | Y        |
+| Influxdb             | 8086          | Influxdb HTTP port                    
                       | N        |
+| Influxdb             | 8088          | Influxdb RPC port                     
                       | N        |
+| PostgreSQL           | 5432          | PostgreSQL access port                
                       | Y        |
+| MySQL                | 3306          | MySQL access port                     
                       | Y        |
+
diff --git a/website/docs/deployment/prerequisite.md 
b/website/docs/deployment/prerequisite.md
new file mode 100644
index 0000000000..684188db59
--- /dev/null
+++ b/website/docs/deployment/prerequisite.md
@@ -0,0 +1,189 @@
+---
+title: Prerequisite
+language: en
+sidebar_label: Prerequisite
+pagination_label: Prerequisite
+toc_min_heading_level: 2
+toc_max_heading_level: 6
+pagination_prev: intro
+pagination_next: null
+keywords: 
+  - prerequisite
+draft: true
+last_update:
+    date: 11/08/2022
+---
+
+To ensure system performance and stability, we recommend you run Kylin on a 
dedicated Hadoop cluster.
+
+Prior to installing Kylin, please check the following prerequisites are met.
+
+- Environment
+    - [Supported Hadoop Distributions](#hadoop)
+    - [Java Environment](#java)
+    - [Account Authority](#account)
+    - [Metastore Configuration](#metadata)
+    - [Check Zookeeper](#zookeeper)
+- Recommended Resource and Configuration
+    - [Hadoop Cluster Resource Allocation](#resource)
+    - [Recommended Hardware Configuration](#hardware)
+    - [Recommended Linux Distribution](#linux)
+    - [Recommended Client Configuration](#client)
+- [License](#license)
+
+
+
+### <span id="hadoop">Supported Hadoop Distributions</span>
+
+The following Hadoop distributions are verified to run on Kylin.
+
+- Apache Hadoop 3.2.1 (#TODO)
+
+
+Kylin requires some components, please make sure each server has the following 
components.
+
+- Hive
+- HDFS
+- Yarn
+- ZooKeeper
+
+**Note:** Spark is shipped in the binary package, so you don't need to install 
it in advance. If for security and compliance reasons, you want to replace the 
shipped Spark and Hadoop dependency with existing ones in your environment, 
please contact Kylin Community. 
+
+### <span id="java">Java Environment</span>
+
+Kylin requires:
+
+- Requires your environment's default JDK version is 8 (JDK 1.8_162 or above 
small version)
+
+```shell
+java -version
+```
+
+You can use the following command to check the JDK version of your existing 
environment, for example, the following figure shows JDK 8
+
+![JDK version](images/jdk.en.png)
+
+### <span id="account">Account Authority</span>
+
+The Linux account running Kylin must have the required access permissions to 
the cluster. These permissions include:
+
+* Read/Write permission of HDFS
+* Create/Read/Write permission of Hive table
+
+Verify the user has access to the Hadoop cluster with account `KyAdmin`. Test 
using the steps below:
+
+1. Verify the user has HDFS read and write permissions
+
+   Assuming the HDFS storage path for model data is `/kylin`, set it in 
`conf/kylin.properties` as:
+
+   ```properties
+   kylin.env.hdfs-working-dir=/kylin
+   ```
+
+   The storage folder must be created and granted with permissions. You may 
have to switch to HDFS administrator (usually the `hdfs` user),  to do this:
+
+   ```shell
+   su hdfs
+   hdfs dfs -mkdir /kylin
+   hdfs dfs -chown KyAdmin /kylin
+   hdfs dfs -mkdir /user/KyAdmin 
+   hdfs dfs -chown KyAdmin /user/KyAdmin
+   ```
+   Verify the `KyAdmin` user has read and write permissions
+
+   ```shell
+   hdfs dfs -put <any_file> /kylin
+   hdfs dfs -put <any_file> /user/KyAdmin   
+   ```
+
+2. Verify the `KyAdmin` user has Hive read and write permissions
+
+   Let's say you want to store a Hive table `t1` in Hive database `kylinDB`, 
The `t1` table contains two fields `id, name`.
+
+   Then verify the Hive permissions:
+
+   ```shell
+   #hive
+   hive> show databases;
+   hive> use kylinDB;
+   hive> show tables;
+   hive> insert into t1 values(1, "kylin");
+   hive> select * from t1;
+   ```
+
+### <span id="metadata">Metastore Configuration</span>
+
+A configured metastore is required for this product.
+
+We recommend using PostgreSQL 10.7 as the metastore, which is provided in our 
package. Please refer to [Use PostgreSQL as Metastore 
(Default)](./rdbms_metastore/default_metastore.md) for installation steps and 
details.
+
+If you want to use your own PostgreSQL database, the supported versions are 
below:
+
+- PostgreSQL 9.1 or above
+
+You can also choose to use MySQL but we currently don't provide a MySQL 
installation package or JDBC driver. Therefore, you need to finish all the 
prerequisites before setting up. Please refer to [Use MySQL as 
Metastore](./rdbms_metastore/mysql_metastore.md) for installation steps and 
details. The supported MySQL database versions are below:
+
+- MySQL 5.1-5.7
+- MySQL 5.7 (recommended)
+
+### <span id="zookeeper">Check Zookeeper</span>
+
+The following steps can be used to quickly verify the connectivity between 
ZooKeeper and Kylin after Kerberos is enabled.
+1. Find the ZooKeeper working directory on the node where the ZooKeeper Client 
is deployed
+2. Add or modify the Client section to the `conf/jaas.conf` file:
+
+   ```shell
+   Client {
+     com.sun.security.auth.module.Krb5LoginModule required
+     useKeyTab=true
+     keyTab="/path/to/keytab_assigned_to_kylin"
+     storeKey=true
+     useTicketCache=false
+     principal="principal_assigned_to_kylin";
+   };
+   ```
+3. `export JVMFLAGS="-Djava.security.auth.login.config=/path/to/jaas.conf"`
+4. `bin/zkCli.sh -server ${kylin.env.zookeeper-connect-string}`
+5. Verify that the ZooKeeper node can be viewed normally, for example: `ls /`
+6. Clean up the new Client section in step 2 and the environment variables 
`unset JVMFLAGS` declared in step 3
+
+If you download ZooKeeper from the non-official website, you can consult the 
operation and maintenance personnel before performing the above operations.
+
+### <span id="resource">Hadoop Cluster Resource Allocation</span>
+
+To ensure Kylin works efficiently, please ensure the Hadoop cluster 
configurations satisfy the following conditions:
+
+* `yarn.nodemanager.resource.memory-mb` configuration item bigger than 8192 MB
+* `yarn.scheduler.maximum-allocation-mb` configuration item bigger than 4096 MB
+* `yarn.scheduler.maximum-allocation-vcores` configuration item bigger than 5
+
+If you need to run Kylin in a sandbox or other virtual machine environment, 
please make sure the virtual machine environment has the following resources:
+
+- No less than 4 processors
+
+- Memory is no less than 10 GB
+
+- The value of the configuration item `yarn.nodemanager.resource.cpu-vcores` 
is no less than 8
+
+### <span id="hardware">Recommended Hardware Configuration</span>
+
+We recommend the following hardware configuration to install Kylin:
+
+- 32 vCore, 128 GB memory
+- At least one 1TB SAS HDD (3.5 inches), 7200RPM, RAID1
+- At least two 1GbE Ethernet ports. For network port requirements, please 
refer to the [Network Port Requirements](./network_port_requirements.md) 
chapter.
+
+### <span id="linux">Recommended Linux Distribution</span>
+
+We recommend using the following version of the Linux operating system:
+
+- (#TODO)
+
+### <span id="client">Recommended Client Configuration</span>
+
+- CPU: 2.5 GHz Intel Core i7
+- Operating System: macOS / Windows 7 / Windows 10
+- RAM: 8G or above
+- Browser version:
+    + Chrome 45 or above
+    + Internet Explorer 11 or above
diff --git a/website/docs/deployment/rdbms_metastore/default_metastore.md 
b/website/docs/deployment/rdbms_metastore/default_metastore.md
new file mode 100644
index 0000000000..43e71ae44f
--- /dev/null
+++ b/website/docs/deployment/rdbms_metastore/default_metastore.md
@@ -0,0 +1,83 @@
+---
+title: Use PostgreSQL as Metastore
+language: en
+sidebar_label: Use PostgreSQL as Metastore
+pagination_label: Use PostgreSQL as Metastore
+toc_min_heading_level: 2
+toc_max_heading_level: 6
+pagination_prev: null
+pagination_next: null
+keywords:
+   - postgresql
+draft: false
+last_update:
+   date: 11/08/2022
+---
+
+### <span id="preparation">Prerequisite</span>
+
+1. For Kylin, we recommend using PostgreSQL as the default metastore database. 
The PostgreSQL 10.7 installation package is located in the  product package 
root directory `postgresql`.
+2. If using other versions of PostgreSQL, please choose a version above 
PostgreSQL 9.1.
+3. If you have not installed PostgreSQL, please check the [Install 
PostgreSQL](install_postgresql.md) chapter to complete the installation.
+
+
+
+### <span id ="setting">Use PostgreSQL as metastore</span>
+
+Next, we will introduce how to configure PostgreSQL as the metastore of Kylin.
+
+1. Later, you can set the metadata url in the configuration file 
`$KYLIN_HOME/conf/kylin.properties`. The property is `kylin.metadata.url = 
{metadata_name}@jdbc`, please replace `{metadata_name}` with the table name you 
would like, for instance, `kylin_metadata@jdbc`, the maximum length of 
`{metadata_name}` allowed is 28. See the example below:
+
+   ```properties
+   
kylin.metadata.url={metadata_name}@jdbc,driverClassName=org.postgresql.Driver,url=jdbc:postgresql://{host}:{port}/kylin,username={user},password={password}
+   ```
+
+   The meaning of each configuration item is as follows, `url`, `username` and 
`password` are required, other fields will use the default value if not set:
+
+   - **url**: JDBC url:
+     - **host**: The IP address of PostgreSQL server, the default value is 
`localhost`;
+     - **port**: The port of PostgreSQL server, the default value is `5432`, 
you can set it with available port number.
+     - **kylin**: Metabase name. Make sure this database `kylin` has been 
created in PostgreSQL;
+   - **username**: JDBC user name, the default value is `postgres`;
+   - **password**: JDBC password, the default value is void, please set it 
according to your actual password;
+   - **driverClassName**: JDBC driver name, the default value is 
`org.postgresql.Driver`;
+
+   **vi.** If you need to configure the cluster deployment, please use comma 
`,` to split among server addresses. Meanwhile, the url should use `"` to quote 
the url. For example:
+
+   ```properties           
+   
kylin.metadata.url=kylin_metadata@jdbc,driverClassName=org.postgresql.Driver,url="jdbc:postgresql://{ip}:{port},{ip}:{port}.../kylin",username=postgres,password=kylin
+   ```
+
+2. If you need to encrypt JDBC's password, please follow undermentioned 
instructions:
+
+   **i.** To obtain encrypted password, please run the command under the path 
of ${KYLIN_HOME}
+
+   ```shell
+   ./bin/kylin.sh org.apache.kylin.tool.general.CryptTool -e AES -s <password>
+   ```
+
+   **ii.** Configure the password in the `kylin.metadata.url` like this
+
+   ```properties
+   password=ENC('${encrypted_password}')
+   ```
+
+   For example, the following assumes that the JDBC password is kylin:
+
+   First, we need to encrypt kylin using the following command
+
+   ```shell
+   ${KYLIN_HOME}/bin/kylin.sh org.apache.kylin.tool.general.CryptTool -e AES 
-s kylin
+   AES encrypted password is: 
+   YeqVr9MakSFbgxEec9sBwg==
+   ```
+
+   Then, configure `kylin.metadata.url` like this:
+
+   ```properties
+   
kylin.metadata.url=kylin_metadata@jdbc,driverClassName=org.postgresql.Driver,url="jdbc:postgresql://{host}:{port},{ip}:{port}.../kylin",username=postgres,password=ENC('YeqVr9MakSFbgxEec9sBwg==')
+   ```
+
+
+
+
diff --git 
a/website/docs/deployment/rdbms_metastore/images/install_initialize_postgresql.png
 
b/website/docs/deployment/rdbms_metastore/images/install_initialize_postgresql.png
new file mode 100644
index 0000000000..bd373347c6
Binary files /dev/null and 
b/website/docs/deployment/rdbms_metastore/images/install_initialize_postgresql.png
 differ
diff --git 
a/website/docs/deployment/rdbms_metastore/images/installation_create_postgresqldb.jpg
 
b/website/docs/deployment/rdbms_metastore/images/installation_create_postgresqldb.jpg
new file mode 100644
index 0000000000..6423a5a822
Binary files /dev/null and 
b/website/docs/deployment/rdbms_metastore/images/installation_create_postgresqldb.jpg
 differ
diff --git a/website/docs/deployment/rdbms_metastore/install_mysql.md 
b/website/docs/deployment/rdbms_metastore/install_mysql.md
new file mode 100644
index 0000000000..b3bced9cd6
--- /dev/null
+++ b/website/docs/deployment/rdbms_metastore/install_mysql.md
@@ -0,0 +1,120 @@
+---
+title: Install MySQL
+language: en
+sidebar_label: Install MySQL
+pagination_label: Install MySQL
+toc_min_heading_level: 2
+toc_max_heading_level: 6
+pagination_prev: null
+pagination_next: null
+keywords:
+   - postgresql
+draft: true
+last_update:
+   date: 11/08/2022
+---
+
+### Prerequisite
+
+1. Supported MySQL versions are:
+
+   - MySQL 5.1 to 5.7, MySQL 5.7 is recommended
+   - MySQL 8
+
+2. JDBC driver of MySQL is needed in the Kyligence Enterprise running 
environment.
+
+3. You can download the JDBC driver jar package of MySQL 8 via the link below, 
that compatible with the version after 5.6:
+
+   
https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.28/mysql-connector-java-8.0.28.jar
+
+   For other versions, you will have to prepare independently.
+
+4. Please put the corresponding MySQL's JDBC driver to directory 
`$KYLIN_HOME/lib/ext`. 
+
+### <span id ="not_root">Non `root` User Installation and Configuration</span>
+
+The followings are the steps for a non `root` user `abc` installing MySQL 5.7 
on CentOS 7(#TODO)( apply to `root` users as well).
+
+1. Create a new directory `/home/abc/mysql`, and locate MySQL intallation 
package in the directory, excute the following command to unzip the package of 
`rpm`:
+
+   ```shell
+   cd /home/abc/mysql
+   tar -xvf mysql-5.7.37-1.el7.x86_64.rpm-bundle.tar
+   ```
+   Then you will have the RPM installment package:
+
+   `mysql-community-common-5.7.37-1.el7.x86_64.rpm`
+   `mysql-community-libs-5.7.37-1.el7.x86_64.rpm`
+   `mysql-community-client-5.7.37-1.el7.x86_64.rpm`
+   `mysql-community-server-5.7.37-1.el7.x86_64.rpm`
+   `mysql-community-devel-5.7.37-1.el7.x86_64.rpm`
+
+   > **Note:** please prepare MySQL installaion package by yourself 
+
+2. To check if the other version MySQL was already installed in your system 
environment
+   
+   ```shell
+   For example 1: 
+   rpm -qa | grep mysql
+   yum -y remove MySQL-server-5.5.61-1.el6.x86_64
+   
+   For example 2:
+   rpm -qa | grep mariadb
+   yum -y remove mariadb-libs-5.5.68-1.el7.x86_64
+   ```
+
+3. Excute the command as the following order to Unzip package of `rpm` 
following
+
+   ```shell
+   rpm2cpio mysql-community-common-5.7.37-1.el7.x86_64.rpm | cpio -idmv
+   rpm2cpio mysql-community-libs-5.7.37-1.el7.x86_64.rpm | cpio -idmv
+   rpm2cpio mysql-community-client-5.7.37-1.el7.x86_64.rpm | cpio -idmv
+   rpm2cpio mysql-community-server-5.7.37-1.el7.x86_64.rpm | cpio -idmv
+   ```
+
+4. Excute `vi ~/mysql/etc/my.cnf` to edit configuration file, and please add 
the configuration informationn as follows 
+
+   ```properties
+   [client]
+   port = 3306
+   socket=/home/abc/socket/mysql.sock
+   [mysql]
+   no-auto-rehash
+   socket=/home/abc/socket/mysql.sock
+   [mysqld]
+   user=abc
+   basedir=/home/abc/mysql/usr
+   datadir=/home/abc/sql_data
+   socket=/home/abc/socket/mysql.sock
+   secure-file-priv=/home/abc/mysql_files
+   port=3306
+   ```
+
+   Please create folders corresponding to the configuration informantion above 
:
+
+   - Create folder `usr` in the path of `/home/abc/mysql`
+   - Create folder `sql_data` in the path of `/home/abc` 
+   - Create folder `socket` in the path of `/home/abc`
+   - Create folder `mysql_files` in the path of `/home/abc` 
+
+   Then, excute the following command in the path of `/home/abc/mysql`
+
+   ```sh
+   ./usr/bin/mysql_install_db --defaults-file=etc/my.cnf --user=abc 
--basedir=/home/abc/mysql/usr --datadir=/home/abc/sql_data
+   ```
+
+5. Excute following command to start MySQL in the path of `/home/abc/mysql`:
+
+   ```sh
+   ./usr/sbin/mysqld --defaults-file=etc/my.cnf &
+   ```
+
+6. To check the default password of MySQL 5.7
+
+   ```sh
+   cat ./home/abc/.mysql_secret
+   ```
+   Login MySQL 5.7 by using default password
+   ```sh
+   usr/bin/mysql -u root -p
+   ```
diff --git a/website/docs/deployment/rdbms_metastore/install_postgresql.md 
b/website/docs/deployment/rdbms_metastore/install_postgresql.md
new file mode 100644
index 0000000000..392c4987d0
--- /dev/null
+++ b/website/docs/deployment/rdbms_metastore/install_postgresql.md
@@ -0,0 +1,230 @@
+---
+title: Install PostgreSQL
+language: en
+sidebar_label: Install PostgreSQL
+pagination_label: Install PostgreSQL
+toc_min_heading_level: 2
+toc_max_heading_level: 6
+pagination_prev: null
+pagination_next: null
+keywords:
+   - mysql 
+draft: true
+last_update:
+  date: 11/08/2022
+---
+
+### <span id="preparation">Prerequisite</span>
+
+1. For Kylin, we recommend using PostgreSQL as the default metastore database. 
The PostgreSQL 10.7 installation package is located in the  product package 
root directory `postgresql`.
+
+2. If using other versions of PostgreSQL, please choose a version above 
PostgreSQL 9.1.
+
+3. The PostgreSQL installation package currently supports installation in 
(#TODO) system, the correspondence is as follows:
+
+   - `rhel6.x86_64.rpm` -> CentOS 6
+   - `rhel7.x86_64.rpm` -> CentOS 7
+   - `rhel8.x86_64.rpm` -> CentOS 8
+
+   Please check out Linux version before choosing the installation package. 
You should be able to see your Linux core version by running `uname -a` or `cat 
/etc/issue`.
+
+4. In this section, we will go through a PostgreSQL installation and 
configuration on CentOS 6.
+
+
+
+### <span id="root">`root` User Installation and Configuration</span>
+
+1. After unzipping the Kylin package, enter the root directory `postgresql` 
and run following commands in order to install PostgreSQL.(#TODO)
+
+   ```shell
+   rpm -ivh postgresql10-libs-10.7-1PGDG.rhel6.x86_64.rpm
+   rpm -ivh postgresql10-10.7-1PGDG.rhel6.x86_64.rpm
+   rpm -ivh postgresql10-server-10.7-1PGDG.rhel6.x86_64.rpm
+   ```
+
+2. Initialize PostgreSQL
+
+   The OS has installed Initscripts services, Please run:
+   ```sh
+   service postgresql-10 initdb
+   ```
+
+   The OS not has installed Initscripts services, Please run in the PostgreSQL 
bin directory:
+   ```sh
+   $PGSQL_HOME/pgsql-10/bin/postgresql-10-setup initdb
+   for example: /user/pgsql-10/bin/postgresql-10-setup initdb
+   ```
+
+3. Modify two PostgreSQL configuration files, the files are in 
`/var/lib/pgsql/10/data/`:
+
+   - `pg_hba.conf`: mainly used to store the authentication information of the 
client.
+   - `postgresql.conf`
+
+   **i.** Run `vi pg_hba.conf` to open the file and you can see  the following 
initial setting:
+
+   ```properties
+   host    all             all             127.0.0.1/32            ident
+   ```
+
+   Please the change the above setting to the following:
+
+   ```properties
+   host    all             all             127.0.0.1/32            md5
+   ```
+
+   > **tips**: The above modification makes you match any users in localhost 
(IP address is `localhost` or `127.0.0.1`) to connect any databases and 
validate user password via `md5`.
+
+   At the same time, please append a new line at the end of this file:
+
+   ```properties
+   host    all             all             0.0.0.0/0               md5
+   ```
+
+   > **tips**: The above modification makes you match any user in any IPV4 
address to connect any databases, and validate user password via `md5`.
+
+   **Fields Explanation:**
+
+   - `host`: The connect way, `host` means connecting via TCP / IP;
+   - First `all`: Match all databases;
+   - Second `all`: Match all users;
+   - `0.0.0.0/0`: Match all IPV4 address;
+   - `md5`: Validate via `md5`.
+
+   > **tips**: You can set corresponding match rules according to your cases.
+
+   **ii.** Run `vi postgresql.conf` to open another configuration file and 
modify the following properties:
+
+   ```sh
+   listen_addresses = '*'
+   ```
+
+   **Field Explanation:**
+
+   - `listen_addresses`: Specify the TCP / IP address listened by server. It 
is represented by multiple hostnames seperated by comma, for intance, 
`listen_addresses = host1,host2,host3` or `listen_address = 
10.1.1.1,10.1.1.2,10.1.1.3`. The special symbol `*` matches all IP addresses. 
You can modify the property on demands.
+   - `port`: The default value is `5432`. If `5432` is taken, please replace 
it with an avaliable port.
+
+4. Run `service postgresql-10 start` to launch PostgreSQL
+
+5. Log in to PostgreSQL and create the database
+
+   **i.** Run `su - postgres` to switch to `postgres` user.
+
+   > **Tip:** `postgres` is automatically created by Linux user in the process 
of PostgreSQL installation.
+
+   **ii.** Run `/usr/pgsql-10/bin/psql` to connect PostgreSQL server.
+
+   The command above will connect to port `5432` by default. If you have 
changed port number in configuration file `postgresql.conf`, please use `-p` 
option indicating the port number you set before. For instance, say you set 
port number as `5433` in `postgresql.conf` file, please run as 
`/usr/pgsql-10/bin/psql -p 5433`.     
+
+   **iii.** Kylin uses `postgres` as user name to connect PostgreSQL by 
default, you are required to set password for user `postgres`. Run `ALTER USER 
postgres PASSWORD 'kylin';` to set user password to `kylin`.
+
+   > **Note:** Please do not forget `;` at the end of the command.
+
+   **iv.** Run `create database kylin;` to create the metadata database, named 
as `kylin` by default.
+
+   > **Note:** Please do not forget `;` at the end of the command.
+
+   **v.** <span id="metadata">Run `\l` to check if the database was created 
successfully. If you see picture as below, you have just created a database 
named `kylin`.</span>
+
+   ![check kylin database](./images/installation_create_postgresqldb.jpg)
+
+   
+
+### <span id="not_root">Non `root` User Installation and Configuration</span>
+
+The following example is that Linux user `abc` installs and configures 
PostgreSQL.
+
+1. Create a new directory `/home/abc/postgresql`, then unzip the PostgreSQL 
installation package.(#TODO)
+
+   ```sh
+   rpm2cpio postgresql10-libs-10.7-1PGDG.rhel6.x86_64.rpm | cpio -idmv
+   rpm2cpio postgresql10-10.7-1PGDG.rhel6.x86_64.rpm | cpio -idmv
+   rpm2cpio postgresql10-server-10.7-1PGDG.rhel6.x86_64.rpm | cpio -idmv
+   ```
+
+   > **Note**: please make sure user `abc` has **read** and **write** 
privileges.
+
+2. Edit `~/.bash_profile` file, append `export 
LD_LIBRARY_PATH=/home/abc/postgresql/usr/pgsql-10/lib` at the end of the file, 
then run `source ~/.bash_profile` to make it take effect.
+
+3. Configure database
+
+   **i.** Run the following command to initialize database:
+
+   ```sh
+   ~/postgresql/usr/pgsql-10/bin/initdb -A md5 -U postgres -W -D 
~/postgresql/var/lib/pgsql/10/data/
+   ```
+
+   **Fields explanation:**
+
+   - **-A md5**: validate user password via `md5`
+   - **-U postgres**: specify user `postgres`
+   - **-W**: set password for user `postgres`
+   - **-D ~/postgresql/var/lib/pgsql/10/data/**: specify the path where the 
configuration file is located
+
+   As the picture shows below, input password after run the command above, the 
password is the password for user `postgres`, say the password is `kylin`.
+
+   ![initialize postgresql](./images/install_initialize_postgresql.png)
+
+   **ii.** Edit configuration file
+
+   **Step 1:** Create the directory for Unix Socket communication via the 
command below:
+
+   ```sh
+   mkdir ~/postgresql/socket
+   ```
+
+   **Step 2:** Modify the configuration file 
`~/postgresql/var/lib/pgsql/10/data/postgresql.conf`:
+
+   ```properties
+   listen_addresses = '*'
+   unix_socket_directories = '/home/abc/postgresql'
+   #port = 5432
+   ```
+
+   > **Note**: please make sure current user has **read** and **write** 
privileges on Unit Socket communication directory `/home/abc/postgresql`.
+
+   **Step 3:** Please append the following line at the end of 
`~/postgresql/var/lib/pgsql/10/data/pg_hba.conf ` configuration file:
+
+   ```properties
+       host    all             all             0.0.0.0/0               md5
+   ```
+
+4. Run the following command to launch PostgreSQL:
+
+   ```sh
+   ~/postgresql/usr/pgsql-10/bin/pg_ctl -D ~/postgresql/var/lib/pgsql/10/data/ 
-l ~/postgresql/var/lib/pgsql/10/pgstartup.log start
+   ```
+
+5. Run the following command to connect PostgreSQL:
+
+   ```sh
+   ~/postgresql/usr/pgsql-10/bin/psql -U postgres -h localhost
+   ```
+
+   The above command will connects to `5432` port. If you modified the setting 
in configuration, please add `-p` option and set the port. Say you set the port 
number in `postgresql.conf` to `5436`, please run following command:
+
+   ```sh
+   ~/postgresql/usr/pgsql-10/bin/psql -U postgres -h localhost -p 5436
+   ```
+
+    After that, please input password as prompted.
+
+6. Run the following command to create a database named `kylin`:
+
+   ```sql
+   create database kylin;
+   ```
+
+   > **Note:** 
+   >
+   > - Please do not forget to append `;` at the end of the command.
+   > - You can check if `kylin` database was created successfully via `\l` 
command in PostgreSQL client.
+
+### <span id="faq">FAQ</span>
+
+**Q: How to solve the error `libicu18n.so.42: cannot open shared object file: 
no such file or directory`  when a non-root user initializes PostgreSQL?**
+
+There are two solutions:
+
+Solution 1: Make sure that the node installing PostgreSQL can access the 
external network, and then enter the command `yum install libicu-devel` in the 
terminal to download libicui18n.
+
+Solution 2: Visit the website https://pkgs.org/download/libicu and download 
the required packages. Please choose the appropriate version according to the 
system kernel, such as `libicu-4.2.1-1.el6.x86_64.rpm` for CentOS 6. Then use 
the command `rpm2cpio libicu-4.2.1-14.el6.x86_64.rpm | cpio -idmv` to 
decompress the binary package and place the decompressed content in ` 
$LD_LIBRARY_PATH`. If you don't know `$LD_LIBRARY_PATH`, please refer to the 
second step of [Non `root` User Installatio [...]
diff --git a/website/docs/deployment/rdbms_metastore/intro.md 
b/website/docs/deployment/rdbms_metastore/intro.md
new file mode 100644
index 0000000000..fd217647e3
--- /dev/null
+++ b/website/docs/deployment/rdbms_metastore/intro.md
@@ -0,0 +1,18 @@
+---
+title: Use RDBMS as Metastore
+language: en
+sidebar_label: Use RDBMS as Metastore
+pagination_label: Use RDBMS as Metastore
+toc_min_heading_level: 2
+toc_max_heading_level: 6
+pagination_prev: null
+pagination_next: null
+keywords:
+    - Use RDBMS as Metastore
+draft: false
+last_update:
+    date: 11/08/2022
+---
+
+Using RDBMS as Metastore is supported, which uses JDBC Driver to connect 
Metastore database.
+
diff --git a/website/sidebars.js b/website/sidebars.js
index 45cebb29dc..0fddf1a701 100644
--- a/website/sidebars.js
+++ b/website/sidebars.js
@@ -56,6 +56,46 @@ const sidebars = {
                   type: 'doc',
                   id: 'deployment/intro'
               },
+              {
+                  type: 'doc',
+                  id: 'deployment/prerequisite'
+              },
+              {
+                  type: 'doc',
+                  id: 'deployment/network_port_requirements'
+              },
+              // TODO: add Installation part
+              // {
+              //     type: 'category',
+              //     label: 'Installation',
+              //     items:[
+              //         {
+              //
+              //         },
+              //     ],
+              // },
+              {
+                  type: 'category',
+                  label: 'Use RDBMS as Metastore',
+                  link: {
+                      type: 'doc',
+                      id: 'deployment/rdbms_metastore/intro',
+                  },
+                  items: [
+                      {
+                          type: 'doc',
+                          id: 'deployment/rdbms_metastore/default_metastore'
+                      },
+                      {
+                          type: 'doc',
+                          id: 'deployment/rdbms_metastore/install_postgresql'
+                      },
+                      {
+                          type: 'doc',
+                          id: 'deployment/rdbms_metastore/install_mysql'
+                      },
+                  ]
+              }
           ],
       },
       {

Reply via email to