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 &
相关推荐
FIN技术铺2 小时前
Redis集群模式之Redis Sentinel vs. Redis Cluster
数据库·redis·sentinel
矛取矛求2 小时前
Linux如何更优质调节系统性能
linux
内核程序员kevin3 小时前
在Linux环境下使用Docker打包和发布.NET程序并配合MySQL部署
linux·mysql·docker·.net
CodingBrother4 小时前
MySQL 中的 `IN`、`EXISTS` 区别与性能分析
数据库·mysql
kayotin4 小时前
Wordpress博客配置2024
linux·mysql·docker
代码小鑫4 小时前
A027-基于Spring Boot的农事管理系统
java·开发语言·数据库·spring boot·后端·毕业设计
Ztiddler5 小时前
【Linux Shell命令-不定期更新】
linux·运维·服务器·ssh
小小不董5 小时前
Oracle OCP认证考试考点详解082系列16
linux·运维·服务器·数据库·oracle·dba
甄臻9245 小时前
Windows下mysql数据库备份策略
数据库·mysql
内蒙深海大鲨鱼5 小时前
qt之ui开发
数据库·qt·ui