Thingworx高可用集群部署(八)-Ignite集群部署

主机:10.10.10.62、10.10.10.63、10.10.10.64、10.10.10.65

服务器配置

关闭防火墙

复制代码
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
systemctl stop firewalld
systemctl disable firewalld

配置内核参数

复制代码
cat >> /etc/sysctl.conf <<EOF

#define
net.ipv4.tcp_syncookies = 1
fs.file-max = 1000000
vm.swappiness=10
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_time = 120
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_timestamps = 1
#net.ipv4.tcp_tw_recycle = 0
net.ipv4.tcp_max_tw_buckets = 20000
net.ipv4.tcp_max_syn_backlog = 8096
net.ipv4.ip_local_port_range = 1024 65000    # not for k8s
EOF

/sbin/sysctl -p

Limit参数

复制代码
cat >>/etc/security/limits.conf<<EOF
root soft nproc 65535
root hard nproc 65535
root soft nofile 65535
root hard nofile 65535
* soft nproc 65535
* hard nproc 65535
* soft nofile 65535
* hard nofile 65535
EOF

配置YUM源

复制代码
vi /etc/yum.repos.d/epel.repo

[base]
name=CentOS-$releasever-Base-mirrors.trinasolar.com
failovermethod=priority
baseurl=http://mirrors.trinasolar.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.trinasolar.com/centos/RPM-GPG-KEY-CentOS-7

[updates]
name=CentOS-$releasever-Updates-mirrors.trinasolar.com
failovermethod=priority
baseurl=http://mirrors.trinasolar.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.trinasolar.com/centos/RPM-GPG-KEY-CentOS-7

安装Linux工具

复制代码
yum install -y sysstat-*x86_64 
yum install -y unzip
yum install -y gzip 
yum install -y zip 
yum install -y tar 
yum install -y wget
yum install -y lrzsz 
yum install -y twm 
yum install -y xterm 
yum install -y xhost 
yum install -y pixman 
yum install -y pixman-devel 
yum install -y libXfont 
yum install -y fio 
yum install -y ntp 
yum install -y telnet 
yum install -y bc 
yum install -y dos2unix 
yum install -y net-tools 
yum install -y iperf 
yum install -y iftop 
yum install -y iotop 
yum install -y psmisc 
yum install -y lsof 
yum install -y nethogs 
yum install -y htop
yum install -y wget

修改主机名

复制代码
hostnamectl --static set-hostname testpg01

cat >> /etc/hosts << EOF
10.10.10.62  testap01
10.10.10.63  testap02
10.10.10.64  testap03
10.10.10.65  testap04
EOF

Ignite安装

上传安装包

复制代码
mkdir /data/soft
mv /tmp/Install_package.zip /data/soft/
cd /data/soft
unzip Install_package.zip

JDK安装

复制代码
rpm -ivh /data/soft/jdk-11.0.11_linux-x64_bin.rpm
或者
yum localinstall /data/soft/pkgs/jdk-11.0.11_linux-x64_bin.rpm -y
配置环境变量
复制代码
cat > /etc/profile.d/jdk.sh <<EOF

export JAVA_HOME=/usr/java/jdk-11.0.11
export JRE_HOME=/usr/java/jdk-11.0.11/jre
export CLASSPATH=.:\$JAVA_HOME/lib/dt.jar:\$JAVA_HOME/lib/tools.jar:\$JRE_HOME/lib:\$CLASSPATH
export PATH=\$JAVA_HOME/bin:\$PATH
EOF

source  /etc/profile.d/jdk.sh
版本验证
复制代码
java -version

部署ignite

用户:root

新建文件夹
复制代码
mkdir /data/ignite
解压
复制代码
cd /data/soft/pkgs && unzip apache-ignite-2.9.0-bin.zip
mv apache-ignite-2.9.0-bin /data/ignite/
ll /data/ignite/
设置环境变量
复制代码
vim /etc/profile.d/ignite.sh

export HTTP_PROT=8888
export IGNITE_WORK_DIR=/data/ignite/work
export IGNITE_HOME=/data/ignite/apache-ignite-2.9.0-bin

source  /etc/profile.d/ignite.sh
echo $IGNITE_HOME
处理lib

将 ThingWorx 库 MED-61353-CD-092_F000_ThingWorx-Ignite-Cache-Provider-3-8-2-200.jar 和 MED-61353-CD-092_F000_ThingWorx-Ignite-Cache-Provider-API-3-8-2-200.jar 安装至 Ignite 文件夹 $IGNITE_HOME/libs。

复制代码
cp MED-61353-CD-092_F000_ThingWorx-Ignite-Cache-Provider-3-8-2-200.jar $IGNITE_HOME/libs
cp MED-61353-CD-092_F000_ThingWorx-Ignite-Cache-Provider-API-3-8-2-200.jar $IGNITE_HOME/libs

cp MED-61353-CD-093_SP5_ThingWorx-Ignite-Cache-Provider-3-10-4-6.zip $IGNITE_HOME/libs
cp MED-61353-CD-093_SP5_ThingWorx-Ignite-Cache-Provider-API-3-10-4-6.zip $IGNITE_HOME/libs

ll $IGNITE_HOME/libs

将 ignite-zookeeper、ignite-rest-http 和 ignite-slf4j 库从 IGNITE_HOME/libs/optional 文件夹移至 IGNITE_HOME/libs 文件夹

复制代码
mv $IGNITE_HOME/libs/optional/{ignite-zookeeper,ignite-rest-http,ignite-slf4j}  $IGNITE_HOME/libs

ll $IGNITE_HOME/libs
更新版本
复制代码
# remove the existing zookeeper jar file in the ignite-zookeeper folder

rm -rf ${IGNITE_HOME}/libs/ignite-zookeeper/zookeeper-*

# download the latest zookeeper plus other required libraries and place in ignite-zookeeper folder

wget -q --no-check-certificate https://repo1.maven.org/maven2/org/apache/zookeeper/zookeeper/3.6.2/zookeeper-3.6.2.jar -P ${IGNITE_HOME}/libs/ignite-zookeeper/
wget -q --no-check-certificate https://repo1.maven.org/maven2/org/apache/zookeeper/zookeeper-jute/3.6.2/zookeeper-jute-3.6.2.jar -P ${IGNITE_HOME}/libs/ignite-zookeeper/
wget -q --no-check-certificate https://repo1.maven.org/maven2/io/netty/netty-all/4.1.59.Final/netty-all-4.1.59.Final.jar -P ${IGNITE_HOME}/libs/ignite-zookeeper/


ll ${IGNITE_HOME}/libs/ignite-zookeeper/{zookeeper-3.6.2.jar,zookeeper-jute-3.6.2.jar,netty-all-4.1.59.Final.jar}
ZooKeeper链接处理

更新 default-config.xml 文件以启用 ZooKeeper 服务发现。必须将 ZooKeeper 服务器地址放置在 zkConnectionString 连接属性中。

复制代码
vi ${IGNITE_HOME}/config/default-config.xml

<?xml version="1.0" encoding="UTF-8"?>

<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans.xsd">
    <bean id="ignite1.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
        <property name="workDirectory" value="/ignite/work"/>
        <property name="failureDetectionTimeout" value="#{60 * 60 * 1000}"/>
        <property name="systemWorkerBlockedTimeout" value="#{60 * 60 * 1000}"/>
        <property name="discoverySpi">
         <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
            <property name="ipFinder">
               <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.zk.TcpDiscoveryZookeeperIpFinder">
                  <property name="zkConnectionString" value="10.13.3.66:2181,10.13.3.67:2181,10.13.3.68:2181"/>
               </bean>
            </property>
          </bean>
         </property>
         <property name="peerClassLoadingEnabled" value="true"/>
    </bean>

</beans>
修改ignite启动文件
复制代码
vi /data/ignite/apache-ignite-2.9.0-bin/bin/ignite.sh

JVM_OPTS="$JVM_OPTS -Xms1g -Xmx1g"
JVM_OPTS="$JVM_OPTS -Djava.net.preferIPv4Stack=true"
创建/ignite/work文件夹
复制代码
mkdir /data/ignite/work
chmod -R 777 /data/ignite
启动测试

启动ignite<正式环境不使用此方法启动,直接启动tomcat即可启动ignite>

复制代码
cd /data/ignite/apache-ignite-2.9.0-bin/bin
./ignite.sh /data/ignite/apache-ignite-2.9.0-bin/config/default-config.xml &
相关推荐
Johny_Zhao9 小时前
OpenClaw安装部署教程
linux·人工智能·ai·云计算·系统运维·openclaw
NineData10 小时前
NineData 迁移评估功能正式上线
数据库·dba
NineData15 小时前
数据库迁移总踩坑?用 NineData 迁移评估,提前识别所有兼容性风险
数据库·程序员·云计算
赵渝强老师17 小时前
【赵渝强老师】PostgreSQL中表的碎片
数据库·postgresql
全栈老石21 小时前
拆解低代码引擎核心:元数据驱动的"万能表"架构
数据库·低代码
YuMiao1 天前
gstatic连接问题导致Google Gemini / Studio页面乱码或图标缺失问题
服务器·网络协议
倔强的石头_2 天前
kingbase备份与恢复实战(二)—— sys_dump库级逻辑备份与恢复(Windows详细步骤)
数据库
chlk1232 天前
Linux文件权限完全图解:读懂 ls -l 和 chmod 755 背后的秘密
linux·操作系统
舒一笑2 天前
Ubuntu系统安装CodeX出现问题
linux·后端
改一下配置文件2 天前
Ubuntu24.04安装NVIDIA驱动完整指南(含Secure Boot解决方案)
linux