## Oushu Database 6.2.1.0 新特性 (发布日期:2025年4月09日) -------------------------------------------------------------- 1. 新增开源兼容Hudi-orc内表格式 2. 打通spark对Hudi-orc格式内表的读取功能 3. 支持Hudi-orc格式内表的容灾备份功能 4. 新增对异步自动全量物化视图的支持 5. 新增支持内表使用JNI接口 6. 新增rcfile格式外表 7. 新增外表数据缓存功能 8. 补充copy定制需求,与5x版本拉齐 9. 修复数个hive对接兼容性问题 10. 修复行策略与脱敏一起使用时失效的问题 | 操作系统 | 版本 | |---------|-----| | Redhat/Centos | 7.0 | | Redhat/Centos | 7.1 | | Redhat/Centos | 7.2 | | Redhat/Centos | 7.3 | | Redhat/Centos | 7.4 | ### 从 6.1.0.0 升级到 6.2.1.0 ++++++++++++++++++++++++++ **该升级步骤仅支持 hdfs 存储, 不支持含有 magma 数据存储的集群.** 0. 修改 `pg_hba.conf` 停止所有负载 1. 停止 OushuDB 集群 (main 和 segment) ```shell # checkpoint多次 psql -d postgres -c "checkpoint; checkpoint;" oushudb stop cluster -a oushudb ssh -f ${all_host_file} -e "source /usr/local/oushu/oushudb/oushudb_path.sh; oushudb ps | grep postmaster" # 检查是否有残留进程 ``` 2. 导出元数据 ```shell catalog_upgrade --export=${export_path} ``` 没有 `catalog_upgrade` 的话可以手动绕过: ```shell catalog_ctl --export-magma=/tmp/upgrade_export cp /usr/local/oushu/oushudb/catalog-data/1/*.schema /tmp/upgrade_export/1/ echo -n "6.0.0.0" >/tmp/upgrade_export/version ``` 3. 迁移集群目录 masterdd 和 segmentdd 的路径可以通过查询 `oushudb-site.xml` 中 `oushudb_main_directory` 和 `oushudb_segment_directory` 获得. 接下来对 masterdd 和 segmentdd 目录进行备份. 请将 `${main_host_file}/${segment_hosts_file}` 替换为保存集群 main/segment 节点 hostname 的文件名称。 并将 `${masterdd}/${segmentdd}` 替换为上文中获取到的 masterdd/segmentdd 的目录位置. ```shell oushudb ssh -f ${main_hosts_file} -e "mv ${masterdd} ${masterdd}.bak" oushudb ssh -f ${segment_hosts_file} -e "mv ${segmentdd} ${segmentdd}.bak" ``` 接下来迁移 `vsc_catalog` 的 data目录. 目录的路径可以查询 `magma-topology.yaml` 中的 `data_dir` 获得. **可能会有多个目录**. 将各个目录都迁移到新的位置. ```shell # 对每一个路径都运行一遍 oushudb ssh -f ${catalog_hosts_file} -e "mv ${datadir} ${datadir}.bak" ``` 4. 升级 RPM ```shell oushudb ssh -f ${all_hosts_file} rpm -e oushudb rpm -ivh ${newest_oushudb_rpm} ``` **检查所有节点上的版本是否一致, 并确认为目标版本** ```shell oushudb ssh -f ${all_hosts_file} -e "magma --version" ``` 5. 初始化 `vsc_catalog` 集群 ```shell # 创建每一个 datadir 目录, ${datadir} 替换为相应的目录 oushudb ssh -f ${catalog_hosts_file} -e "mkdir -p ${datadir}" magma start cluster magma create vscluster --no-import-catalog ``` 6. 导入元数据 ```shell # ${export_path} 为第一步生成的路径 # ${csv_export_path} 为另一个新的路径, 存储导入时创建的文件 catalog_upgrade --import=${export_path} --csv-out=${csv_export_path} ``` 7. 元数据验证 ```shell catalog_upgrade --verify --verify-data=${csv_export_path} --verify-filter=.* ``` 该命令必须运行成功, 否则进行回退. 如果是从 6.0.0.0 升级还需要验证以下命令 ```shell catalog_upgrade --verify --verify-filter=checkview_for_pg_authid ``` **根据提示记录下所有需要重新创建的 view**. 8. 初始化集群 ```shell oushudb init cluster --no_post_init ``` 9. 检查集群可用性 10. **重新创建第7步记录下来的view** 11. 恢复 `pg_hba.conf` 配置 ### 升级失败回退步骤 ++++++++++++++++++++++++++ 如果 < 步骤 2, 不需要恢复, 旧集群仍然可用. 如果 < 步骤 3, 恢复旧集群即可. 如果步骤 3 已经执行结束或者执行到一半, 按照以下步骤恢复. 1. 停止所有可能启动的 oushudb 进程. ```shell oushudb stop cluster -a --with_magma oushudb ssh ${all_hosts_file} -e "oushudb ps" # 检查残留进程 ``` 2. 将步骤 3 备份的目录全部恢复至原位. (恢复前应删除新创建的目录) 3. 降级 RPM 至原先版本 4. 启动旧集群 ```shell oushudb start cluster -a --with_magma ``` 5. 恢复 `pg_hba.conf`