禁用DB2高可用性db2haicu -disable

本文介绍如何使用db2haicu工具进行DB2 High Availability (HA)集群的禁用与重新启用流程。操作包括切换到实例用户、执行db2haicu-disable命令禁用HA配置,以及通过db2haicu-enable重新激活HA功能。文章还展示了相关db2diag.log日志条目。

切换到实例用户
[root@linux2 ~]# su - db2inst1

执行命令db2haicu -disable禁用DB2 HA集群
[db2inst1@linux2 ~]$ db2haicu -disable
Welcome to the DB2 High Availability Instance Configuration Utility (db2haicu).

You can find detailed diagnostic information in the DB2 server diagnostic log file called db2diag.log. Also, you can use the utility called db2pd to query the status of the cluster domains you create.

For more information about configuring your clustered environment using db2haicu, see the topic called 'DB2 High Availability Instance Configuration Utility (db2haicu)' in the DB2 Information Center.

db2haicu determined the current DB2 database manager instance is db2inst1. The cluster configuration that follows will apply to this instance.

db2haicu is collecting information on your current setup. This step may take some time as db2haicu will need to activate all databases for the instance to discover all paths ...
Are you sure you want to disable high availability (HA) for the database instance db2inst1. This will lock all the resource groups for the instance and disable the HA configuration parameter. The instance will not failover if a system outage occurs while the instance is disabled. You will need to run db2haicu again to enable the instance for HA. Disable HA for the instance db2inst1? [1]
1. Yes
2. No

Disabling high availability for instance db2inst1 ...
Locking the resource group for DB2 database partition 0 ...
Locking the resource group for DB2 database partition 0 was successful.
Disabling high availability for instance db2inst1 was successful.
All cluster configurations have been completed successfully. db2haicu exiting ...

重新启用db2 ha集群
[db2inst1@linux2 ~]$ db2haicu
Welcome to the DB2 High Availability Instance Configuration Utility (db2haicu).

You can find detailed diagnostic information in the DB2 server diagnostic log file called db2diag.log. Also, you can use the utility called db2pd to query the status of the cluster domains you create.

For more information about configuring your clustered environment using db2haicu, see the topic called 'DB2 High Availability Instance Configuration Utility (db2haicu)' in the DB2 Information Center.

db2haicu determined the current DB2 database manager instance is db2inst1. The cluster configuration that follows will apply to this instance.

db2haicu is collecting information on your current setup. This step may take some time as db2haicu will need to activate all databases for the instance to discover all paths ...
When you use db2haicu to configure your clustered environment, you create cluster domains. For more information, see the topic 'Creating a cluster domain with db2haicu' in the DB2 Information Center. db2haicu is searching the current machine for an existing active cluster domain ...
db2haicu found a cluster domain called ha_domain on this machine. The cluster configuration that follows will apply to this domain.

db2haicu has detected that high availability has been disabled for the instance db2inst1. Do you want to enable high availability for the instance db2inst1? [1]
1. Yes
2. No

Retrieving high availability configuration parameter for instance db2inst1 ...
The cluster manager name configuration parameter (high availability configuration parameter) is not set. For more information, see the topic "cluster_mgr - Cluster manager name configuration parameter" in the DB2 Information Center. Do you want to set the high availability configuration parameter?
The following are valid settings for the high availability configuration parameter:
  1.TSA
  2.Vendor
Enter a value for the high availability configuration parameter: [1]

Setting a high availability configuration parameter for instance db2inst1 to TSA.
Enabling high availability for instance db2inst1 ...
Enabling high availability for instance db2inst1 was successful.
All cluster configurations have been completed successfully. db2haicu exiting ...

对应db2diag.log的日志
---禁用过程
2011-02-15-09.39.30.432573+480 I74818G292         LEVEL: Event
PID     : 7916                 TID  : 1251392     PROC : db2flacc
INSTANCE: db2inst1             NODE : 000
FUNCTION: DB2 UDB, config/install, sqlfLogUpdateCfgParam, probe:30
CHANGE  : CFG DBM: "Cluster_mgr" From: "TSA"  To: ""

---启用过程
2011-02-15-09.40.15.835396+480 I75111G292         LEVEL: Event
PID     : 8572                 TID  : 1232320     PROC : db2flacc
INSTANCE: db2inst1             NODE : 000
FUNCTION: DB2 UDB, config/install, sqlfLogUpdateCfgParam, probe:30
CHANGE  : CFG DBM: "Cluster_mgr" From: ""  To: "TSA"

看似db2haicu主要通过DBM CFG 的"Cluster_mgr" 参数实现控制

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/665930/viewspace-687223/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/665930/viewspace-687223/

.PHONY:curl curl: @echo "build curl" cd $(PUBLIC_APPS_PATH)/curl-7.66.0 && test -e Makefile && $(MAKE) clean && rm -rf ./install && rm Makefile || echo "no makefile" cd $(PUBLIC_APPS_PATH)/curl-7.66.0 && test -e configure || ./buildconf ifeq ($(INCLUDE_CLOUD_ACCOUNT), y) ifeq ($(INCLUDE_SSL_OPENSSL), y) cd $(PUBLIC_APPS_PATH)/curl-7.66.0 && test -e Makefile || (export LDFLAGS="-Wl,-rpath=$(PUBLIC_APPS_PATH)/openssl-1.0.2q/lib" &&\ ./configure shared --prefix=$(PUBLIC_APPS_PATH)/curl-7.66.0/install \ --build=i686-linux --host=$(HOST) \ --disable-ftp --disable-ldap --disable-ldaps --disable-rtsp --disable-proxy --disable-dict \ --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smtp --disable-gopher \ --disable-ipv6 --disable-sspi --disable-crypto-auth --disable-ntlm-wb --disable-tls-srp \ --disable-cookies --disable-soname-bump --disable-threaded-resolver --disable-pthreads \ --with-ssl=$(PUBLIC_APPS_PATH)/openssl-1.0.2q \ --without-zlib) endif ifeq ($(INCLUDE_SSL_MBEDTLS), y) cd $(PUBLIC_APPS_PATH)/curl-7.66.0 && test -e Makefile || (export LDFLAGS="-Wl,-rpath=$(PUBLIC_APPS_PATH)/mbedtls-2.17/install/lib" && export CPPFLAGS=" -I$(PUBLIC_APPS_PATH)/mbedtls-2.17/crypto/include" && \ ./configure shared --prefix=$(PUBLIC_APPS_PATH)/curl-7.66.0/install \ --build=i686-linux --host=$(HOST) \ --disable-ftp --disable-ldap --disable-ldaps --disable-rtsp --disable-proxy --disable-dict \ --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smtp --disable-gopher \ --disable-ipv6 --disable-sspi --disable-crypto-auth --disable-ntlm-wb --disable-tls-srp \ --disable-cookies --disable-soname-bump --disable-threaded-resolver --disable-pthreads \ --with-mbedtls=$(PUBLIC_APPS_PATH)/mbedtls-2.17/install \ --without-zlib) endif else cd $(PUBLIC_APPS_PATH)/curl-7.66.0 && test -e Makefile || \ ./configure --prefix=$(PUBLIC_APPS_PATH)/curl-7.66.0/install \ --build=i686-linux --host=$(HOST) \ --disable-ftp --disable-ldap --disable-ldaps --disable-rtsp --disable-proxy --disable-dict \ --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smtp --disable-gopher \ --disable-ipv6 --disable-sspi --disable-crypto-auth --disable-ntlm-wb --disable-tls-srp \ --disable-cookies --disable-soname-bump --disable-threaded-resolver --disable-pthreads \ --without-ssl --without-zlib endif cd $(PUBLIC_APPS_PATH)/curl-7.66.0 && $(MAKE) install .PHONY: curl_install curl_install: @echo "install curl" cp --no-dereference -p $(PUBLIC_APPS_PATH)/curl-7.66.0/install/lib/*.so* $(PUBLIC_APPS_PATH)/install/lib/ .PHONY: curl_clean curl_clean: @echo "clean curl" cd $(PUBLIC_APPS_PATH)/curl-7.66.0 && $(MAKE) clean && rm -rf ./install
09-20
你提供了一个完整的 `Makefile` 片段,用于交叉编译 **curl-7.66.0** 并集成 OpenSSL 或 mbedTLS。当前问题依然是: > ❌ `configure: error: OpenSSL could not be detected` > 原因是:`ld: cannot find -lcrypto` 我们已经确认: - `libcrypto.a` 存在 ✅ - `HMAC_Init_ex` 符号存在 ✅ - `.pc` 文件路径基本正确 ✅ - 但 `pkg-config` 可能自动添加了 `/sysroot` 导致路径错误 ❌ --- ## ✅ 当前 Makefile 的问题分析 ### 🔍 关键片段(启用 OpenSSL): ```makefile ifeq ($(INCLUDE_SSL_OPENSSL), y) cd $(PUBLIC_APPS_PATH)/curl-7.66.0 && test -e Makefile || \ (export LDFLAGS="-Wl,-rpath=$(PUBLIC_APPS_PATH)/openssl-1.0.2q/lib" && \ ./configure shared \ --prefix=$(PUBLIC_APPS_PATH)/curl-7.66.0/install \ --build=i686-linux --host=$(HOST) \ --with-ssl=$(PUBLIC_APPS_PATH)/openssl-1.0.2q \ --without-zlib) endif ``` ### ⚠️ 存在以下问题: | 问题 | 描述 | |------|------| | 1. 没设置 `PKG_CONFIG_PATH` | `configure` 依赖 `pkg-config --libs openssl` 查找库,但未指定路径 | | 2. 没设置 `PKG_CONFIG_SYSROOT_DIR=""` | 导致 `pkg-config` 自动加 `/sysroot`,拼出非法路径 | | 3. `LDFLAGS` 中的 `-rpath` 路径不对 | 应该指向 `install/lib`,不是源码下的 `lib` | | 4. 缺少 `LIBS="-lpthread -ldl -lrt"` | `libcrypto` 依赖这些库,否则链接失败 | --- ## ✅ 正确修复后的 Makefile(推荐版本) ```makefile .PHONY: curl curl: @echo "build curl" cd $(PUBLIC_APPS_PATH)/curl-7.66.0 && test -e Makefile && $(MAKE) clean && rm -rf ./install && rm Makefile || echo "no makefile" cd $(PUBLIC_APPS_PATH)/curl-7.66.0 && test -e configure || ./buildconf ifeq ($(INCLUDE_CLOUD_ACCOUNT), y) ifeq ($(INCLUDE_SSL_OPENSSL), y) # 设置环境变量防止 pkg-config 添加 /sysroot 前缀 cd $(PUBLIC_APPS_PATH)/curl-7.66.0 && test -e Makefile || \ (PKG_CONFIG_PATH="$(PUBLIC_APPS_PATH)/openssl-1.0.2q/install/lib/pkgconfig" \ PKG_CONFIG_SYSROOT_DIR="" \ LIBS="-lpthread -ldl -lrt" \ CFLAGS="-I$(PUBLIC_APPS_PATH)/openssl-1.0.2q/install/include" \ LDFLAGS="-L$(PUBLIC_APPS_PATH)/openssl-1.0.2q/install/lib -Wl,-rpath,\\\$$ORIGIN/../lib" \ ./configure shared \ --prefix="$(PUBLIC_APPS_PATH)/curl-7.66.0/install" \ --build=i686-linux \ --host=$(HOST) \ --disable-ftp --disable-ldap --disable-ldaps --disable-rtsp --disable-proxy --disable-dict \ --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smtp --disable-gopher \ --disable-ipv6 --disable-sspi --disable-crypto-auth --disable-ntlm-wb --disable-tls-srp \ --disable-cookies --disable-soname-bump --disable-threaded-resolver --disable-pthreads \ --with-ssl="$(PUBLIC_APPS_PATH)/openssl-1.0.2q/install" \ --without-zlib) endif ifeq ($(INCLUDE_SSL_MBEDTLS), y) cd $(PUBLIC_APPS_PATH)/curl-7.66.0 && test -e Makefile || \ (PKG_CONFIG_PATH="$(PUBLIC_APPS_PATH)/mbedtls-2.17/install/lib/pkgconfig" \ PKG_CONFIG_SYSROOT_DIR="" \ CPPFLAGS="-I$(PUBLIC_APPS_PATH)/mbedtls-2.17/crypto/include" \ LDFLAGS="-L$(PUBLIC_APPS_PATH)/mbedtls-2.17/install/lib -Wl,-rpath,\\\$$ORIGIN/../lib" \ ./configure shared \ --prefix="$(PUBLIC_APPS_PATH)/curl-7.66.0/install" \ --build=i686-linux \ --host=$(HOST) \ --disable-ftp --disable-ldap --disable-ldaps --disable-rtsp --disable-proxy --disable-dict \ --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smtp --disable-gopher \ --disable-ipv6 --disable-sspi --disable-crypto-auth --disable-ntlm-wb --disable-tls-srp \ --disable-cookies --disable-soname-bump --disable-threaded-resolver --disable-pthreads \ --with-mbedtls="$(PUBLIC_APPS_PATH)/mbedtls-2.17/install" \ --without-zlib) endif else # 不启用 SSL cd $(PUBLIC_APPS_PATH)/curl-7.66.0 && test -e Makefile || \ ./configure \ --prefix="$(PUBLIC_APPS_PATH)/curl-7.66.0/install" \ --build=i686-linux \ --host=$(HOST) \ --disable-ftp --disable-ldap --disable-ldaps --disable-rtsp --disable-proxy --disable-dict \ --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smtp --disable-gopher \ --disable-ipv6 --disable-sspi --disable-crypto-auth --disable-ntlm-wb --disable-tls-srp \ --disable-cookies --disable-soname-bump --disable-threaded-resolver --disable-pthreads \ --without-ssl --without-zlib endif # 编译并安装 cd $(PUBLIC_APPS_PATH)/curl-7.66.0 && $(MAKE) install ``` --- ## ✅ 关键修改说明 | 修改点 | 解释 | |--------|------| | `PKG_CONFIG_PATH=.../install/lib/pkgconfig` | 让 `pkg-config` 找到 `.pc` 文件 | | `PKG_CONFIG_SYSROOT_DIR=""` | 阻止自动添加 `/sysroot` 前缀(最重要!)✅ | | `LIBS="-lpthread -ldl -lrt"` | 补全 `libcrypto` 所需依赖库 | | `CFLAGS/LDFLAGS` 显式指定头文件和库路径 | 绕过 `pkg-config` 不可靠的问题 | | `--with-ssl=.../install` | 必须指向 `make install` 后的目录,不是源码目录 | | `\\\$$ORIGIN/../lib` | 转义 `$ORIGIN`,使 `.so` 运行时能加载同级 `lib` 下的依赖库 | --- ## ✅ 确保 OpenSSL 已正确安装到 `install` 目录 运行以下命令验证: ```bash ls -l $(PUBLIC_APPS_PATH)/openssl-1.0.2q/install/lib/libcrypto.a ls -l $(PUBLIC_APPS_PATH)/openssl-1.0.2q/install/lib/pkgconfig/libcrypto.pc ``` 如果没有,请先执行 OpenSSL 安装: ```bash cd $(PUBLIC_APPS_PATH)/openssl-1.0.2q make install INSTALL_PREFIX=$(PUBLIC_APPS_PATH)/openssl-1.0.2q/install ``` --- ## ✅ 最终验证方法 手动测试 `pkg-config` 是否返回正确路径: ```bash PKG_CONFIG_PATH=$(PUBLIC_APPS_PATH)/openssl-1.0.2q/install/lib/pkgconfig \ PKG_CONFIG_SYSROOT_DIR="" \ pkg-config --libs openssl ``` 输出应为: ``` -L/home/bba/work/BBA1_5/MBB_Platform/apps/public/openssl-1.0.2q/install/lib -lssl -lcrypto ``` 不能包含 `/sysroot`! --- ## ✅ 总结:Makefile 中必须设置的环境变量 | 环境变量 | 作用 | |---------|------| | `PKG_CONFIG_PATH` | 指定 `.pc` 文件位置 | | `PKG_CONFIG_SYSROOT_DIR=""` | 禁用自动 sysroot 拼接 ✅(关键) | | `LIBS` | 添加 `-lpthread -ldl -lrt` | | `CFLAGS/LDFLAGS` | 显式传入路径,提高可靠性 | ---
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值