静态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)
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: 192.168 .18.128
jobmanager.memory.process.size: 1600m
taskmanager.bind-host: 192.168 .18.128
taskmanager.host: 192.168 .18.128
taskmanager.memory.process.size: 1728m
taskmanager.numberOfTaskSlots: 2
parallelism.default: 4
rest.bind-address: 192.168 .18.128
rest.port: 8081
rest.address: 0.0 .0.0
修改环境变量
vim /etc/profile
export FLINK_HOME = /usr/local/flink-1.18.1
export FLINK_CLASSPATH = /usr/local/flink-1.18.1/lib
export PATH = $FLINK_HOME /bin:$PATH
source /etc/profile
配置集群
vim /usr/local/flink-1.18.1/conf/masters
192.168 .18.128:8081
vim /usr/local/flink-1.18.1/conf/workers
192.168 .18.128
192.168 .18.128
192.168 .18.128
启停脚本
/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/