Skip to content

Commit

Permalink
add article
Browse files Browse the repository at this point in the history
  • Loading branch information
bartdong committed Sep 25, 2023
1 parent 43a8c19 commit 3353e2c
Show file tree
Hide file tree
Showing 23 changed files with 2,659 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "快速入门"
date: 2023-07-20T08:00:36+08:00
author: Bart Dong
author: OpenTenBase
image_webp: images/blog/blog-post-1.webp
image: images/blog/blog-post-1.jpg
description : "The Quick Start of OpenTenBase"
Expand All @@ -18,6 +18,7 @@ OpenTenBase 采用分布式集群架构(如下图), 该架构分布式为

OpenTenBase架构图


下面简单解读一下OpenTenBase的三大模块

- **Coordinator:协调节点(简称CN)**
Expand All @@ -44,15 +45,15 @@ OS: TencentOS 2, TencentOS 3, OpenCloudOS, CentOS 7, CentOS 8, Ubuntu

### 安装依赖

` yum -y install gcc make readline-devel zlib-devel openssl-devel uuid-devel bison flex`
` yum -y install gcc make readline-devel zlib-devel openssl-devel uuid-devel bison flex git`


` apt install -y gcc make libreadline-dev zlib1g-dev libssl-dev libossp-uuid-dev bison flex`
` apt install -y gcc make libreadline-dev zlib1g-dev libssl-dev libossp-uuid-dev bison flex git`

- **创建opentenbase用户**

注意:所有需要安装OpenTenBase集群的机器上都需要创建
注意:所有需要安装OpenTenBase集群的机器上都需要创建

``` shell
mkdir /data
Expand Down Expand Up @@ -84,7 +85,7 @@ make install

本文的使用环境中,上述两个参数如下

```shell
```
${SOURCECODE_PATH}=/data/opentenbase/OpenTenBase
${INSTALL_PATH}=/data/opentenbase/install
```
Expand Down Expand Up @@ -159,10 +160,21 @@ export LC_ALL=C
[opentenbase@localhost ~/pgxc_ctl]$ vim pgxc_ctl.conf
```

如下,是结合上文描述的IP,端口,数据库目录,二进制目录等规划来写的pgxc_ctl.conf文件。具体实践中只需按照自己的实际情况配置好即可.
如下,是结合上文描述的IP,端口,数据库目录,二进制目录等规划来写的pgxc_ctl.conf文件。具体实践中只需按照自己的实际情况配置好即可。

亦可从此处下载,修改文件名为 ```pgxc_ctl.conf``` ,按照实际情况修改内容:

[点击此处下载双节点配置](https://docs.opentenbase.org/guide/pgxc_ctl_double.conf)

``` yaml
[点击此处下载单节点配置](https://docs.opentenbase.org/guide/pgxc_ctl_single.conf)


``` shell
#!/bin/bash
# Double Node Config

IP_1=10.215.147.158
IP_2=10.240.138.159

pgxcInstallDir=/data/opentenbase/install/opentenbase_bin_v2.0
pgxcOwner=opentenbase
Expand All @@ -178,13 +190,13 @@ configBackupFile=pgxc_ctl.bak

#---- GTM ----------
gtmName=gtm
gtmMasterServer=10.215.147.158
gtmMasterServer=$IP_1
gtmMasterPort=50001
gtmMasterDir=/data/opentenbase/data/gtm
gtmExtraConfig=none
gtmMasterSpecificExtraConfig=none
gtmSlave=y
gtmSlaveServer=10.240.138.159
gtmSlaveServer=$IP_2
gtmSlavePort=50001
gtmSlaveDir=/data/opentenbase/data/gtm
gtmSlaveSpecificExtraConfig=none
Expand All @@ -197,7 +209,7 @@ coordNames=(cn001 cn002 )
coordPorts=(30004 30004 )
poolerPorts=(31110 31110 )
coordPgHbaEntries=(0.0.0.0/0)
coordMasterServers=(10.215.147.158 10.240.138.159)
coordMasterServers=($IP_1 $IP_2)
coordMasterDirs=($coordMasterDir $coordMasterDir)
coordMaxWALsernder=2
coordMaxWALSenders=($coordMaxWALsernder $coordMaxWALsernder )
Expand Down Expand Up @@ -252,7 +264,7 @@ EOF


coordSpecificExtraPgHba=(none none)
coordAdditionalSlaves=n
coordAdditionalSlaves=n
cad1_Sync=n

#---- Datanodes ---------------------
Expand All @@ -268,13 +280,13 @@ datanodeNames=(dn001 dn002)
datanodePorts=(40004 40004)
datanodePoolerPorts=(41110 41110)
datanodePgHbaEntries=(0.0.0.0/0)
datanodeMasterServers=(10.215.147.158 10.240.138.159)
datanodeMasterServers=($IP_1 $IP_2)
datanodeMasterDirs=($dn1MstrDir $dn2MstrDir)
dnWALSndr=4
datanodeMaxWALSenders=($dnWALSndr $dnWALSndr)

datanodeSlave=y
datanodeSlaveServers=(10.240.138.159 10.215.147.158)
datanodeSlaveServers=($IP_2 $IP_1)
datanodeSlavePorts=(50004 54004)
datanodeSlavePoolerPorts=(51110 51110)
datanodeSlaveSync=n
Expand Down
Loading

0 comments on commit 3353e2c

Please sign in to comment.