静态IP设置
vim /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE = Ethernet
PROXY_METHOD = none
BROWSER_ONLY = no
BOOTPROTO = static
IPADDR = 192.168 .18.128
NETMASK = 255.255 .255.0
GATEWAY = 192.168 .18.2
DEFROUTE = yes
IPV4_FAILURE_FATAL = no
IPV6INIT = yes
IPV6_AUTOCONF = yes
IPV6_DEFROUTE = yes
IPV6_FAILURE_FATAL = no
IPV6_ADDR_GEN_MODE = stable-privacy
NAME = ens33
UUID = 2c2371f1-ef29-4514-a568-c4904bd11130
DEVICE = ens33
ONBOOT = true
DNS1 = 114.114 .114.114
systemctl restart network
Java8环境配置[CentOS7]
cd /usr/local/src
wget https://repo.huaweicloud.com/java/jdk/8u201-b09/jdk-8u201-linux-x64.tar.gz
tar -xzvf jdk-8u201-linux-x64.tar.gz -C /usr/local
vim /etc/profile
export JAVA_HOME = /usr/local/jdk1.8.0_201
export JRE_HOME = ${JAVA_HOME} /jre
export CLASSPATH = .:${JAVA_HOME} /lib:${JRE_HOME} /lib
export PATH = ${JAVA_HOME} /bin:$PATH
source /etc/profile
java -version
java version "1.8.0_201"
Java( TM) SE Runtime Environment ( build 1.8 .0_201-b09)
Java HotSpot( TM) 64 -Bit Server VM ( build 25.201 -b09, mixed mode)
Zookeeper单节点部署与配置
cd /usr/local/src
wget --no-check-certificate https://dlcdn.apache.org/zookeeper/zookeeper-3.9.1/apache-zookeeper-3.9.1-bin.tar.gz
tar -xzvf apache-zookeeper-3.9.1-bin.tar.gz -C /usr/local
cd /usr/local/apache-zookeeper-3.9.1-bin/
cp -r /usr/local/apache-zookeeper-3.9.1-bin/conf/zoo_sample.cfg /usr/local/apache-zookeeper-3.9.1-bin/conf/zoo.cfg
/usr/local/apache-zookeeper-3.9.1-bin/bin/zkServer.sh start
/usr/local/apache-zookeeper-3.9.1-bin/bin/zkServer.sh status
/usr/local/apache-zookeeper-3.9.1-bin/bin/zkServer.sh stop
Flink部署与配置
下载
cd /usr/local/src
wget --no-check-certifica https://mirrors.tuna.tsinghua.edu.cn/apache/flink/flink-1.18.1/flink-1.18.1-bin-scala_2.12.tgz
tar -xzvf flink-1.18.1-bin-scala_2.12.tgz -C /usr/local
修改配置
cd /usr/local/flink-1.18.1
vim /usr/local/flink-1.18.1/conf/flink-conf.yaml
jobmanager.rpc.address: 192.168 .18.128
jobmanager.rpc.port: 6123
jobmanager.bind-host: 0.0 .0.0
jobmanager.memory.process.size: 1600m
taskmanager.bind-host: 0.0 .0.0
taskmanager.host: localhost
taskmanager.memory.process.size: 1728m
taskmanager.numberOfTaskSlots: 2
parallelism.default: 4
rest.port: 8081
rest.address: 0.0 .0.0
rest.bind-address: 0.0 .0.0
修改环境变量
vim /etc/profile
export FLINK_HOME = /usr/local/flink-1.18.1
export PATH = $FLINK_HOME /bin:$PATH
source /etc/profile
配置集群
vim /usr/local/flink-1.18.1/conf/masters
localhost:8081
vim /usr/local/flink-1.18.1/conf/workers
localhost
localhost
localhost
启停脚本
/usr/local/flink-1.18.1/bin/start-cluster.sh
/usr/local/flink-1.18.1/bin/stop-cluster.sh
可视化页面
http://192.168.18.128:8081/