ambari HDP2.6.5 安装FLINK1.9
VERSION=`hdp-select status hadoop-client | sed 's/hadoop-client - \([0-9]\.[0-9]\).*/\1/'`
sudo git clone https://github.com/jzyhappy/ambari-flink-service.git /var/lib/ambari-server/resources/stacks/HDP/$VERSION/services/FLINK
这里替换成我的github了,是Flink1.9.1版本,如果版本合适就不用修改了。原来的是https://github.com/abajwa-hw/ambari-flink-service.git
ambari-server restart
flink_download_url
http://X.X.151.15/Package/flink-1.9.0-bin-scala_2.11.tgz
Snapshot download location. Downloaded when setup_prebuilt is true
http://X.X.151.15/Package/flink-1.9.0-bin-scala_2.11.tgz 这里我使用的是本地路径 推荐使用https://archive.apache.org/dist/ 可以上去看一下自己要选择的版本将连接填充完整 其他两个国内可以访问的有http://www.us.apache.org/dist/flink/ or https://archive.apache.org/dist/
FLINK
Flink
Apache Flink is a streaming dataflow engine that provides data distribution, communication, and fault tolerance for distributed computations over data streams.
1.9.0
yarn.client.failover-proxy-provider</name>
org.apache.hadoop.yarn.client.ConfiguredRMFailoverProxyProvider</value>
</property>
yarn.client.failover-proxy-provider</name>
org.apache.hadoop.yarn.client.RequestHedgingRMFailoverProxyProvider</value>
</property>
并重启yarn集群
javahome 与/etc/prfile一致即可,hadodp_conf_dir使用hdp的生成dir即可
1.hdfs权限没有读写权限
Caused by: org.apache.hadoop.security.AccessControlException: Permission denied: user=flink, access=EXECUTE, inode="/user/flink/.flink/application_1579166472849_0003":root:hdfs:drwxrwx---
Execution of 'yarn application -list 2>/dev/null | awk '/flinkapp-from-ambari/ {print $1}' | head -n1 > /var/run/flink/flink.pid' returned 1. -bash: /var/run/flink/flink.pid: Permission denied
awk: (FILENAME=- FNR=4) warning: error writing standard output (Broken pipe)
1.使用hdfs用户
/etc/profile添加:export HADOOP_USER_NAME=hdfs(hdfs为最高权限)
source /etc/profile(记得执行,以保证立即生效)
也可以执行 sed -i ‘$a export HADOOP_USER_NAME=hdfs’ ,记得也要source一下
sed -i '$a export HADOOP_USER_NAME=hdfs'
2.修改 flink.py
user = ‘root’
pwd
/var/lib/ambari-server/resources/stacks/HDP/2.6/services/FLINK/package/scripts
Execute("yarn application -list 2>/dev/null | awk '/" + params.flink_appname + "/ {print $1}' | head -n1 > " + status_params.flink_pid_file, user='root')
./flink run --jobmanager yarn-cluster -yn 1 -ytm 768 -yjm 768 /opt/flink/examples/batch/WordCount.jar --input hdfs://test01:8020/jzytest/1.csv --output hdfs://test01:8020/jzytest/test.txt
Caused by: java.lang.ClassNotFoundException: com.sun.jersey.core.util.FeaturesAndProperties
修改yarn-site.xml中的yarn.timeline-service.enabled设置为false
def:
1 https://blog.csdn.net/high2011/article/details/90272331
2 https://www.jianshu.com/p/09c08b156885
3 https://blog.csdn.net/jzy3711/article/details/85003606
4 https://github.com/abajwa-hw/ambari-flink-service