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 &
相关推荐
薛定谔的算法4 小时前
phoneGPT:构建专业领域的检索增强型智能问答系统
前端·数据库·后端
Databend5 小时前
Databend 亮相 RustChinaConf 2025,分享基于 Rust 构建商业化数仓平台的探索
数据库
得物技术6 小时前
破解gh-ost变更导致MySQL表膨胀之谜|得物技术
数据库·后端·mysql
用户311879455921811 小时前
Kylin Linux 10 安装 glib2-devel-2.62.5-7.ky10.x86_64.rpm 方法(附安装包)
linux
Raymond运维11 小时前
MariaDB源码编译安装(二)
运维·数据库·mariadb
沢田纲吉11 小时前
🗄️ MySQL 表操作全面指南
数据库·后端·mysql
涛啊涛12 小时前
Centos7非LVM根分区容量不足后扩容,对调硬盘挂载/
linux·磁盘管理
RestCloud1 天前
SQL Server到Hive:批处理ETL性能提升30%的实战经验
数据库·api
RestCloud1 天前
为什么说零代码 ETL 是未来趋势?
数据库·api
ClouGence1 天前
CloudCanal + Paimon + SelectDB 从 0 到 1 构建实时湖仓
数据库