ESB(Ensemble 2018.1.7)三节点镜像集群部署

记录在全新 CentOS/RHEL 7 x64 主机上部署三节点镜像集群(主/备/仲裁 + VIP),并配置 Apache 2.4.69 + CSP Gateway 的完整过程。文中 IP、主机名、密码均为示例,实际按现场填写。

一、规划

项 值
主机 esb1 / esb2 / esb3
角色 esb1=主(Primary),esb2=备(Backup),esb3=仲裁(Arbiter)
内网 IP 192.168.1.11 / 192.168.1.12 / 192.168.1.13
VIP 192.168.1.100(掩码、网卡跟随主备机)
端口 SuperServer 1972,WebServer 57772,JDBC 62972,仲裁 2188,Apache 8080

二、系统基线(三台)

hostnamectl set-hostname esb1
cat >> /etc/hosts <<EOF
192.168.1.11 esb1
192.168.1.12 esb2
192.168.1.13 esb3
EOF
systemctl stop firewalld; systemctl disable firewalld
setenforce 0; sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config

三、目录准备(三台)

mkdir -p /home/dev/Ensemble/{esb,ensembledata,BadMessageHandler}
chmod -R 777 /home/dev/Ensemble
mkdir -p /home/dev/Ensemble/ensembledata/{CENBOOMHGLOBAL,CENBOOMHGLOBALENSTEMP,CENBOOMHGLOBALSECONDARY,CENBOOMHROUTINE}
chmod -R 777 /home/dev/Ensemble/ensembledata

四、安装 ESB 实例(三台,暂不配 CSP)

cd /home/dev/Ensemble && tar xzf /root/ensemble-2018.1.7.721.0-lnxrhx64.tar.gz
cd ensemble-2018.1.7.721.0-lnxrhx64
export ISC_PACKAGE_INSTANCENAME=ENSEMBLE
export ISC_PACKAGE_INSTALLDIR=/home/dev/Ensemble/esb
export ISC_PACKAGE_INITIAL_SECURITY=Normal
export ISC_PACKAGE_MGRUSER=root ISC_PACKAGE_MGRGROUP=root
export ISC_PACKAGE_USER_PASSWORD=公共密码 ISC_PACKAGE_CSPSYSTEM_PASSWORD=CSP密码
export ISC_PACKAGE_UNICODE=Y
export ISC_PACKAGE_CSP_CONFIGURE=N
./cinstall_silent

注意:交互式 ./cinstall 在非终端下会死循环,务必用 cinstall_silent + 环境变量。

五、激活授权(三台)

cp /root/cache.key /home/dev/Ensemble/esb/mgr/cache.key
chown cacheusr:cacheusr /home/dev/Ensemble/esb/mgr/cache.key; chmod 644 /home/dev/Ensemble/esb/mgr/cache.key
yes '' | /home/dev/Ensemble/esb/bin/ccontrol stop ENSEMBLE
/home/dev/Ensemble/esb/bin/ccontrol start ENSEMBLE

六、开机自启(三台)

cat > /etc/systemd/system/ensemble.service <<EOF
[Unit]
Description=ensemble - high performance web server
After=nginx.service

[Service]
Type=forking
ExecStart=/home/dev/Ensemble/esb/bin/ccontrol start ENSEMBLE

[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable ensemble
systemctl enable ISCAgent && systemctl start ISCAgent

七、配置镜像

主 esb1:门户 http://192.168.1.11:57772/csp/sys/UtilHome.csp → 系统管理 → 配置 → 镜像设置 → 创建镜像

  • 镜像名称:MIRROR
  • 使用仲裁程序:192.168.1.13,端口 2188
  • 使用虚拟 IP:192.168.1.100(掩码、网卡保持默认)
  • 成员名称:192.168.1.11/ENSEMBLE,超级服务器地址 192.168.1.11,代理端口 2188

备 esb2:系统管理 → 配置 → 镜像设置 → 加入为故障转移

  • 镜像名称 MIRROR,代理地址 192.168.1.11,端口 2188,实例名 ENSEMBLE
  • 下一步检索到主机数据后,接口保持默认 → 保存

仲裁 esb3:确保 ISCAgent 运行。

八、编译安装 Apache 2.4.69(仅主备)

yum -y install gcc make perl zlib-devel pcre-devel openssl-devel expat-devel
cd /root/soft
tar xzf apr-1.7.4.tar.gz && (cd apr-1.7.4 && ./configure --prefix=/usr/local/apr && make -j4 && make install)
tar xzf apr-util-1.6.3.tar.gz && (cd apr-util-1.6.3 && ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr && make -j4 && make install)
tar xzf httpd-2.4.69.tar.gz && cd httpd-2.4.69
./configure --prefix=/etc/httpd --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --enable-modules=most --enable-mpms-shared=all --with-mpm=worker --disable-ssl
make -j4 && make install

httpd.conf 与 MPM:

sed -i 's/^Listen 80$/Listen 8080/' /etc/httpd/conf/httpd.conf
{ echo 'IncludeOptional conf.d/*.conf'; echo 'ServerName 192.168.1.11:8080'; } >> /etc/httpd/conf/httpd.conf
sed -i 's/^User daemon/User apache/; s/^Group daemon/Group apache/' /etc/httpd/conf/httpd.conf
cat >> /etc/httpd/conf/httpd.conf <<EOF

# Worker MPM parameters
ServerLimit 40
StartServers 10
MaxRequestWorkers 1000
MinSpareThreads 75
MaxSpareThreads 250
ThreadsPerChild 25
EOF

systemd 服务:

cat > /etc/systemd/system/httpd.service <<EOF
[Unit]
Description=The Apache HTTP Server
After=network.target remote-fs.target nss-lookup.target

[Service]
Type=simple
ExecStart=/etc/httpd/bin/httpd -DFOREGROUND
ExecReload=/etc/httpd/bin/httpd -k graceful
KillSignal=SIGWINCH
PrivateTmp=true

[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload && systemctl enable --now httpd
ln -sf /etc/httpd/bin/httpd /usr/sbin/httpd
id apache || useradd -r apache

九、生成 CSP Gateway(仅主备)

: > /etc/httpd/conf.d/isc.conf
cd /home/dev/Ensemble/ensemble-2018.1.7.721.0-lnxrhx64
export ISC_PACKAGE_INSTANCENAME=ENSEMBLE
export ISC_PACKAGE_INITIAL_SECURITY=Normal
export ISC_PACKAGE_MGRUSER=root ISC_PACKAGE_MGRGROUP=root
export ISC_PACKAGE_USER_PASSWORD=公共密码 ISC_PACKAGE_CSPSYSTEM_PASSWORD=CSP密码
export ISC_PACKAGE_UNICODE=Y
export ISC_PACKAGE_CSP_CONFIGURE=Y
export ISC_PACKAGE_CSP_SERVERTYPE=Apache
export ISC_PACKAGE_CSP_APACHE_CONF=/etc/httpd/conf.d/isc.conf
export ISC_PACKAGE_CSP_APACHE_USER=apache
export ISC_PACKAGE_CSP_APACHE_VERSION=2.4
export ISC_PACKAGE_CSP_GATEWAY_DIR=/opt/cspgateway
./cinstall_silent
systemctl restart httpd

十、CSP 附加配置(主备)

grep -q '^System_Manager=' /opt/cspgateway/bin/CSP.ini || sed -i '/^\[SYSTEM\]/a System_Manager=*.*.*.*' /opt/cspgateway/bin/CSP.ini
grep -q '/soap/cenboomh/' /etc/httpd/conf.d/isc.conf || echo 'Alias /soap/cenboomh/ "/home/dev/Ensemble/esb/csp/"' >> /etc/httpd/conf.d/isc.conf
systemctl restart httpd

十一、验证

十二、避坑要点

  1. 非终端下不要用交互式 cinstall(会死循环),用 cinstall_silent。
  2. CSP 生成依赖 /usr/sbin/httpd 探测版本,需软链到实际 httpd。
  3. Apache 必须用 User/Group apache,否则读不到 CSP.ini,/csp/ 报 500。
  4. httpd.conf 需 Listen 8080 + IncludeOptional conf.d/*.conf。
  5. 先装 Apache 再生成 CSP。
  6. 授权文件固定在 实例目录/mgr/cache.key。
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容