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 &
相关推荐
生信大表哥19 小时前
单细胞测序分析(五)降维聚类&数据整合
linux·python·聚类·数信院生信服务器
“αβ”19 小时前
MySQL表的操作
linux·网络·数据库·c++·网络协议·mysql·https
p***s9119 小时前
Spring数据库原理 之 DataSource
java·数据库·spring
虹科网络安全19 小时前
艾体宝干货 | Redis Java 开发系列#1 从零开始的环境搭建与实践指南
java·数据库·redis
火山引擎开发者社区19 小时前
火山引擎向量数据库 Milvus 版正式商业化:AI 时代的向量检索新标杆
数据库·milvus·火山引擎
神秘的土鸡19 小时前
openEuler 25.09 企业级 MySQL主从复制部署与性能优化实战提升50%
linux·数据库·mysql·性能优化·openeuler
韩立学长19 小时前
基于Springboot课堂教学辅助系统08922bq1(程序、源码、数据库、调试部署方案及开发环境)系统界面展示及获取方式置于文档末尾,可供参考。
数据库·spring boot·后端
知识分享小能手19 小时前
CentOS Stream 9入门学习教程,从入门到精通, CentOS Stream 9 命令行基础 —语法知识点与实战详解(4)
linux·学习·centos
烤鱼骑不快20 小时前
linux 软Raid
linux