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 &
相关推荐
汽车仪器仪表相关领域11 分钟前
ZDT-I 伺服电机测试系统
数据库·功能测试·安全·机器人·压力测试·可用性测试
天竺鼠不该去劝架13 分钟前
2026 金融智能体选型逻辑:懂金融、重合规、能落地
大数据·数据库·人工智能
TracyCoder12315 分钟前
在WSL中构建基本的大模型开发环境
linux·ubuntu·大模型·wsl·miniconda·jupiter
zly350016 分钟前
在 CentOS 系统中,重启某一个网卡
linux·运维·centos
煎蛋学姐16 分钟前
SSM校园二手物品交易网站n131p(程序+源码+数据库+调试部署+开发环境)带论文文档1万字以上,文末可获取,系统界面在最后面
数据库·计算机毕设·ssm 框架·商品类别管理
QT 小鲜肉22 分钟前
【Linux命令大全】001.文件管理之paste命令(实操篇)
linux·运维·服务器·笔记·microsoft
悟能不能悟25 分钟前
Oracle 如何查找function信息
数据库·oracle
用户479492835691527 分钟前
Superset 展示 JSONB 中文变天书?真相竟然是 Python 的“过度保护”
数据库·后端
a_eastern29 分钟前
linux electron-forge离线打包关键配置
android·linux·electron
CheungChunChiu31 分钟前
Linux 图形栈全景解析:从 OpenGL 到 DRM/KMS 的完整链路
linux·运维·服务器·opengl