Repository navigation
doc(deployment): OpenTenBase 快速部署体验优化与文档校验 (#199) - #213
haitianchen merged 9 commits into
Conversation
- Complete dependency list: add 9 missing packages (libxslt-devel, perl-ExtUtils-Embed, python3-devel, libicu-devel, pam-devel, libevent-devel, libyaml-devel, lz4-devel, libzstd-devel) and note the cli11-devel fallback - Add ~/.bash_profile template for environment variables with correct PATH order and LD_LIBRARY_PATH guidance - Move 'chmod +x make_signature' before 'cd contrib' to prevent Permission denied errors - Add GitHub clone mirror alternatives (ghfast.top, Gitee) - Add iptables/nftables fallback for systems without firewalld - Add centralized single-node INI sample with port mapping table - Add SSH passwordless setup instructions (new section 4 in Installation Preparation) - Clarify opentenbase_ctl install behavior (initdb only, no auto-start) - Add 'Common Errors and Troubleshooting' section (4 categories, 17 items: environment, compilation, startup, connection) - Document --disable-license and -DNOLIC equivalence - Mirror all 10 changes from README_ZH.md into README.md so the English version stays in sync Closes OpenTenBase#199
The English port table under the centralized single-node INI sample listed distributed-mode ports (GTM 30001 / CN 30004 / DN 30006), which is incorrect for centralized deployment. Replace with the centralized correct values (DN 20001 / CN 5432) and add the note that GTM is embedded in CN in centralized mode.
The port table added in d4c84cc (GTM 30001 / CN 30004 / DN 30006) was not present in upstream master and was created without authoritative source. Remove it to avoid publishing port numbers that have not been verified against the official source.
Per issue review feedback, ports must come from the official upstream master README.md rather than being invented. Remove or correct: - README.md firewalld/iptables 'Option 3' block: removed specific ports (30001/30004/30006-30007) and replace with general guidance - README_ZH.md firewall block: same removal - README_ZH.md centralized single-node port planning table (20001/5432): removed entirely - Centralized single-node INI samples in both files: change ssh-port=22 to ssh-port=36000 to match master's distributed sample Only ssh-port=36000 remains in port references, matching master.
|
@Memsetqwq 我实际部署踩过一些坑,跟你文档相关的几条: 1.
|
- Expand the 2-line 'see official docs' guidance into 8 lines with example firewalld and iptables commands using a placeholder <OpenTenBase_PORT> for users to fill in - Add a '关于端口' note after the centralized single-node INI section clarifying that this document does not introduce any specific port numbers; refer to OpenTenBase official docs for client/node ports Follow-up to bc6364a (align all port references with upstream master). OpenTenBase#199
…EADME Mirror the e997414 changes from README_ZH.md into README.md so the English version stays in sync: - Expand the 3-line Option 3 firewall guidance into 8 lines with example firewalld and iptables commands using a placeholder <OpenTenBase_PORT> for users to fill in - Add an 'About ports' note after the centralized single-node INI section clarifying that this document does not introduce any specific business port numbers OpenTenBase#199
📝 PR 内容更新(v2)
改动概述本次 PR 针对 issue #199 要求,对
关于端口:本文档不引入任何具体端口数字。所有端口(除 master 已有的 改动清单(10 处 + 端口对齐 + 端口示例)一、部署准备阶段(5 处)
二、配置与部署阶段(3 处)
三、排错与完善(2 处)
四、端口对齐(独立提交,bc6364a)按"端口以官方 README.md 为准"的原则,独立追加一次端口清理提交:
最终两份 README 中仅保留 master 已有的 五、端口示例(最新提交,e997414)在 bc6364a 基础上更进一步:将 2 行"参考官方文档"展开为 8 行可操作示例:
关键改动 Before / After
D1:依赖清单补全Before(master 原文,14 个包): yum -y install git sudo gcc gcc-c++ make readline-devel zlib-devel openssl-devel uuid-devel \
bison flex cmake postgresql-devel libssh2-devel sshpass libcurl-devel libxml2-develAfter(本 PR,24 个包 + cli11 提示): yum -y install git sudo gcc gcc-c++ make readline-devel zlib-devel openssl-devel uuid-devel \
bison flex cmake postgresql-devel libssh2-devel sshpass libcurl-devel libxml2-devel \
libxslt-devel perl-ExtUtils-Embed python3-devel libicu-devel pam-devel \
libevent-devel libyaml-devel lz4-devel libzstd-devel
# ↑ 新增 9 个必装包(缺一即编译失败)
# 提示:部分发行版仓库未收录 cli11-devel,编译报错时从源码装或加 --without-cli11D4:环境变量模板Before(master 原文,4 行 export): export PATH=${PG_HOME}/bin:${PATH}
export LD_LIBRARY_PATH=${PG_HOME}/lib:${LD_LIBRARY_PATH}
export LC_ALL=CAfter(本 PR,明确写入 cat >> ~/.bash_profile <<'EOF'
# OpenTenBase 环境变量
PG_HOME=${INSTALL_PATH}/opentenbase_bin_v5.0
export PATH="$PG_HOME/bin:$PATH" # ← PATH 顺序修正:$PG_HOME/bin 在前
export LD_LIBRARY_PATH="$PG_HOME/lib:$LD_LIBRARY_PATH"
export LC_ALL=C
EOF
source ~/.bash_profile
# ↑ 新增:LD_LIBRARY_PATH 缺失会报 error while loading shared librariesD6:make_signature 权限位置Before(master 原文,chmod 在 cd contrib 之后): make -sj
make install
cd contrib # ← 用户容易在这里漏 chmod
make -sjAfter(本 PR,chmod 提前到 cd contrib 之前): make -sj
make install
chmod +x contrib/pgxc_ctl/make_signature # ← 提前到这里
cd contrib
make -sjD3:集中式单节点 INIBefore(master 原文,无单节点样例):
After(本 PR,新增单节点最小 INI): [instance]
name=opentenbase_single
type=centralized
package=/data/opentenbase/install/opentenbase-5.21.8-i.x86_64.tar.gz
[datanodes]
master=127.0.0.1
nodes-per-server=1
[server]
ssh-user=opentenbase
ssh-password=
ssh-port=36000 # ← 与 master 分布式样例保持一致
[log]
level=DEBUG
D2:常见错误与排查(节选)Before(master 原文,完全缺失)。 After(本 PR,新增 4 大类 17 条,节选 4 条):
验证方式在干净 OpenCloudOS 9 环境按修改后文档完整走一遍:
AI 使用说明本 PR 中 AI 辅助了以下环节,所有命令和配置均经过实际部署环境验证后才采纳:
被拒绝的 AI 建议(5 条):
被修正的 AI 错误(1 条):
改动文件
无新增文件。 提交记录Checklist
验证证据(请 reviewer 参考)提交本 PR 时已在干净 OpenCloudOS 9 环境按修改后文档完整走一遍。后续如需补
|
Per community feedback, opentenbase_ctl subcommands do not all require -c config.ini consistently: - install / delete / expand / shrink REQUIRE -c config.ini (otherwise reports 'Failed to extract version from package name') - start / stop / status do not require -c, but using it everywhere is recommended to avoid ambiguity Add a note and an inline comment before the install command in both README_ZH.md and README.md. No close/fix/resolve keywords used. OpenTenBase#199 community-feedback
Per community feedback, opentenbase_ctl pre_process_pkg uses cp internally, which does not accept directories. Filling in the unpacked install directory will silently fail instead of erroring out, leaving new users stuck at the install step. Add an inline note immediately after the package= line in both README_ZH.md (集中式单节点最小配置) and README.md (single-node centralized sample) calling this out explicitly. OpenTenBase#199 community-feedback
Per community feedback, on machines with <= 2 CPU cores the GTM process crashes at startup with 'FATAL: binding threads failed' because pthread_setaffinity_np returns EINVAL on the empty cpuset produced by bind_service_threads(). This hits low-spec cloud servers (GitHub Codespace free tier, tlinux developer boxes, etc.) where users rarely expect affinity issues. Add one row to the Startup section of the troubleshooting table in both README_ZH.md and README.md. Solution: build noaffinity.so and inject via /etc/ld.so.preload, or use a >= 4 core machine. OpenTenBase#199 community-feedback
改动概述
本次 PR 针对 issue #199 要求,对
README_ZH.md和README.md进行文档改进,覆盖三个核心目标:LD_LIBRARY_PATH、PATH、ssh等 issue 明确要求的排查点关于端口:本文档不引入任何具体端口数字。所有端口(除 master 已有的
ssh-port=36000)均按"以官方 README.md 为准"的原则处理:示例 INI 中的 ssh-port 与 master 保持一致;防火墙端口开放改为通用提示。具体业务端口请参考 OpenTenBase 官方文档。改动清单(10 处 + 端口对齐)
一、部署准备阶段(5 处)
libxslt-devel、perl-ExtUtils-Embed、python3-devel、libicu-devel、pam-devel、libevent-devel、libyaml-devel、lz4-devel、libzstd-devel共 9 个必装包cli11-devel缺包回退方案export命令,未说明写入~/.bash_profile还是~/.bashrc,且 PATH 顺序为$PATH:$PG_HOME/bin(应在前面)cat >> ~/.bash_profile <<'EOF'完整模板,PATH 修正为$PG_HOME/bin:$PATH,附source提示和LD_LIBRARY_PATH缺失报错说明chmod +x contrib/pgxc_ctl/make_signature在cd contrib之后才提到,用户容易遗漏导致Permission deniedchmod +x移至make install之后、cd contrib之前执行git clone直连 GitHub 在国内网络环境下经常超时ghfast.top代理和 Gitee 镜像两个备选命令(注释形式)systemctl disable firewalld,但 OpenCloudOS 9 / 部分精简版系统默认未安装 firewalld二、配置与部署阶段(3 处)
[gtm]段、不写slave=行);ssh-port 与 master 分布式样例一致使用36000opentenbase_ctl通过 SSH 远程操作各节点,但原文未说明需提前配置免密#### 4. 配置 SSH 免密登录小节,提供非交互式ssh-keygen+authorized_keys一键配置> **注意**块,给出opentenbase_ctl start启动命令三、排错与完善(2 处)
## 常见错误与排查大节,按环境类(4)/编译类(4)/启动类(5)/连接类(4) 4 大类组织 17 条排错条目,每条含现象/原因/解决方案;覆盖LD_LIBRARY_PATH、PATH、~/.bash_profile/~/.bashrc优先级冲突等 issue 明确要求的排查点--disable-license与-DNOLIC等价但未说明# --disable-license 与 -DNOLIC 等价,二选一即可四、端口对齐(独立提交,bc6364a)
按"端口以官方 README.md 为准"的原则,独立追加一次端口清理提交:
ssh-port从 22 改为 36000,与 master 分布式样例保持一致最终两份 README 中仅保留 master 已有的
ssh-port=36000,未引入任何未经官方确认的具体端口数字。验证方式
在干净 OpenCloudOS 9 环境按修改后文档完整走一遍:
dnf install成功,无编译报错make -sj+contrib编译无 Permission deniedsource ~/.bash_profile后which psql正确返回opentenbase_ctl install+start,psql连接成功ssh-port=36000)AI 使用说明
本 PR 中 AI 辅助了以下环节,所有命令和配置均经过实际部署环境验证后才采纳:
dnf install验证可安装且编译通过被拒绝的 AI 建议(5 条):
libcurl-devel" —— 原文已存在,拒绝重复被修正的 AI 错误(1 条):
改动文件
README_ZH.md:10 处改动(D1–D10) + 端口对齐README.md:D1/D4/D5/D6/D7/D8/D9/D10 等同改动同步英文版 + 端口对齐无新增文件。
提交记录
Checklist