主库节点部署
主库节点部署(node1)
在主库节点 192.168.221.136 上,安装类型选择 m(master)。脚本自动执行以下 11 个步骤完成主库安装与配置。
主库安装自动步骤
Installing HaloDB Database Master
1、Start installing database dependencies # 安装数据库依赖(自动)
2、Creating halo user # 创建 halo 用户(交互)
3、Creating database directory # 创建数据目录(交互,默认 /data/halo)
4、Checking halo installation version # 检查安装版本(自动)
5、Initializing database # 初始化数据库 initdb(自动)
6、Configuring halo database # 配置 pg_hba.conf、postgresql.conf(自动)
7、Configuring archive log # 配置归档日志(交互)
8、Copying license.lic # 拷贝授权文件(自动)
9、Starting halo database # 启动数据库(自动)
10、Create compatible mode database # 创建兼容模式数据库(交互)
11、Configuring huge pages # 配置大页(自动)
其中需要人工交互的关键步骤如下。
归档日志配置(步骤 7)
集群部署要求各节点归档路径一致,脚本会询问是否配置归档。步骤 6 配置数据库 → 步骤 7 归档 → 步骤 8 拷贝授权 → 步骤 9 启动 的实际连续输出如下:
6. Configuring halo database
Configuring pg_hba.conf
Configuring postgresql.conf
Using default memory parameters
7. Configuring archive log
Warning: For cluster database, database directory and archive directory paths must be consistent across all nodes!
Configure archive log? Enter yes/no
yes
Enter database archive directory, press Enter to create in database directory, e.g.:/data/halo
Input is empty, using default value: /data/halo/archivedir
Creating archive log path
8. Copying license.lic to /u01/app/halo/product/dbms/16
9. Starting halo database
waiting for server to start....2026-06-30 11:11:25.322 CST [15723] LOG: redirecting log output to logging collector process
2026-06-30 11:11:25.322 CST [15723] HINT: Future log output will appear in directory "diag".
done
server started
注意: 集群数据库要求所有节点的数据目录与归档目录路径必须一致,否则流复制与故障切换将异常。演示中归档询问输入
yes,归档目录直接回车使用默认值/data/halo/archivedir。
兼容模式数据库(步骤 10)
数据库启动后,脚本询问需要创建的兼容模式数据库。步骤 10 兼容模式 → 步骤 11 配置大页 的实际输出如下:
10. Create compatible mode database? Enter all/oracle/mysql/postgresql, press Enter to skip
all
Completed creating all compatible mode databases
11. Configuring huge pages
| 输入值 | 含义 |
|---|---|
all | 创建全部兼容模式(Oracle + MySQL + PostgreSQL) |
oracle | 仅创建 Oracle 兼容模式 |
mysql | 仅创建 MySQL 兼容模式 |
postgresql | 仅创建 PostgreSQL 兼容模式 |
| (回车) | 跳过,不创建兼容模式数据库 |
主库 initdb 初始化阶段还会输出 initdb: warning: enabling "trust" authentication for local connections 警告(本地连接默认 trust 认证),属正常现象,完整输出持续滚动,此处仅保留关键行。
至此主库数据库安装完成,脚本随即自动进入 etcd 配置环节(见etcd 配置)。