flink1.12安装并配置ha

1.下载安装包,解压

# https://flink.apache.org/downloads.html
tar zxvf     *.tax.gz
# scala下载 解压 配置  vim  /etc/profile
https://www.scala-lang.org/download/
export SCALA_HOME=/usr/local/scala-2.12.13
PATH=$SCALA_HOME/bin:$JAVA_HOME/bin:$HADOOP_HOME/bin:$HIVE_HOME/bin:$HBASE_HOME/bin:$SPARK_HOME/bin:$STORM_HOME/bin:$SQOOP_HOME/bin:$KYLIN_HOME/bin:$ALLUXIO_HOME/bin:$FLINK_HOME/bin:$IMPALA_HOME/bin:$OOZIE_HOME/bin:$PRESTO_HOME/bin:$SLIDER_HOME/bin:$KUDU_HOME/bin:$PATH

2.配置ha
https://ci.apache.org/projects/flink/flink-docs-release-1.12/deployment/ha/zookeeper_ha.html
Example configuration
Configure high availability mode and ZooKeeper quorum in conf/flink-conf.yaml:

high-availability: zookeeper
high-availability.zookeeper.quorum: localhost:2181
high-availability.zookeeper.path.root: /flink
#high-availability.cluster-id: /cluster_one # important: customize per cluster ,on yarn不配置
high-availability.storageDir: hdfs:///flink/recovery

3.测试

./bin/flink run-application -t yarn-application ./examples/streaming/TopSpeedWindowing.jar
./bin/flink run-application -t yarn-application ./examples/batch/WordCount.jar

Application Mode
Application Mode will launch a Flink cluster on YARN, where the main() method of the application jar gets executed on the JobManager in YARN. The cluster will shut down as soon as the application has finished. You can manually stop the cluster using yarn application -kill or by cancelling the Flink job.

./bin/flink run-application -t yarn-application ./examples/streaming/TopSpeedWindowing.jar

Once an Application Mode cluster is deployed, you can interact with it for operations like cancelling or taking a savepoint.

List running job on the cluster

./bin/flink list -t yarn-application -Dyarn.application.id=application_XXXX_YY

Cancel running job

./bin/flink cancel -t yarn-application -Dyarn.application.id=application_XXXX_YY <jobId>

Note that cancelling your job on an Application Cluster will stop the cluster.
To unlock the full potential of the application mode, consider using it with the yarn.provided.lib.dirs configuration option and pre-upload your application jar to a location accessible by all nodes in your cluster. In this case, the command could look like:

./bin/flink run-application -t yarn-application \
	-Dyarn.provided.lib.dirs="hdfs://myhdfs/my-remote-flink-dist-dir" \
	hdfs://myhdfs/jars/my-application.jar

The above will allow the job submission to be extra lightweight as the needed Flink jars and the application jar are going to be picked up by the specified remote locations rather than be shipped to the cluster by the client.

在yarn ui 看任务运行状态

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值