標籤(空格分隔): 大數據運維專欄html
- 一: 編譯環境包的準備
- 二: 編譯生成包配置
- 三: 使用編譯好的flink 作 CDH的parcels與csd 文件
- 四: CDH6.3.2 集成 flink 1.10.1
1、環境 CDH 6.3.2(Hadoop 3.0.0)、Flink 1.10.一、Centos7.七、Maven 3.6.三、Scala-2.12和JDK1.8 2、安裝包 一、flink1.10.1 tar包 https://mirrors.tuna.tsinghua.edu.cn/apache/flink/flink-1.10.1/flink-1.10.1-src.tgz flink-shaded https://mirrors.tuna.tsinghua.edu.cn/apache/flink/flink-shaded-10.0/flink-shaded-10.0-src.tgz 三、maven版本 https://mirror.bit.edu.cn/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
tar -zxvf jdk1.8.181.tar.gz mv jdk1.8.181 /usr/local/jdk tar -zxvf apache-maven-3.6.3-bin.tar.gz mv apache-maven-3.6.3 /usr/local/maven tar -zxvf scala-2.12.2.tgz mv scala-2.12.2 /usr/local/scala
vim /etc/proflie --- JAVA_HOME=/usr/local/java JRE_HOME=/usr/local/java/jre PATH=$PATH:/usr/local/java/bin CLASSPATH=.:/usr/local/java/jre/lib export PATH JAVA_HOME export MVN_HOME=/usr/local/maven export PATH=$MVN_HOME/bin:$PATH export SCALA_HOME=/usr/local/scala export PATH=$SCALA_HOME/bin:$PATH ---
在<mirrors>...... </mirrors> 之間加上: <mirror> <id>alimaven</id> <mirrorOf>central</mirrorOf> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/repositories/central/</url> </mirror> <mirror> <id>alimaven</id> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <mirrorOf>central</mirrorOf> </mirror> <mirror> <id>central</id> <name>Maven Repository Switchboard</name> <url>http://repo1.maven.org/maven2/</url> <mirrorOf>central</mirrorOf> </mirror> <mirror> <id>repo2</id> <mirrorOf>central</mirrorOf> <name>Human Readable Name for this Mirror.</name> <url>http://repo2.maven.org/maven2/</url> </mirror> <mirror> <id>ibiblio</id> <mirrorOf>central</mirrorOf> <name>Human Readable Name for this Mirror.</name> <url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url> </mirror> <mirror> <id>jboss-public-repository-group</id> <mirrorOf>central</mirrorOf> <name>JBoss Public Repository Group</name> <url>http://repository.jboss.org/nexus/content/groups/public</url> </mirror> <mirror> <id>google-maven-central</id> <name>Google Maven Central</name> <url>https://maven-central.storage.googleapis.com </url> <mirrorOf>central</mirrorOf> </mirror> <!-- 中央倉庫在中國的鏡像 --> <mirror> <id>maven.net.cn</id> <name>oneof the central mirrors in china</name> <url>http://maven.net.cn/content/groups/public/</url> <mirrorOf>central</mirrorOf> </mirror>
一、解壓tar包 wget https://mirrors.tuna.tsinghua.edu.cn/apache/flink/flink-shaded-10.0/flink-shaded-10.0-src.tgz tar -zxvf flink-shaded-10.0-src.tgz 二、修改pom.xml vim flink-shaded-10.0/pom.xml ---- <profile> <id>vendor-repos</id> <activation> <property> <name>vendor-repos</name> </property> </activation> <!-- Add vendor maven repositories --> <repositories> <!-- Cloudera --> <repository> <id>cloudera-releases</id> <url>https://repository.cloudera.com/artifactory/cloudera-repos</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> <!-- Hortonworks --> <repository> <id>HDPReleases</id> <name>HDP Releases</name> <url>https://repo.hortonworks.com/content/repositories/releases/</url> <snapshots><enabled>false</enabled></snapshots> <releases><enabled>true</enabled></releases> </repository> <repository> <id>HortonworksJettyHadoop</id> <name>HDP Jetty</name> <url>https://repo.hortonworks.com/content/repositories/jetty-hadoop</url> <snapshots><enabled>false</enabled></snapshots> <releases><enabled>true</enabled></releases> </repository> <!-- MapR --> <repository> <id>mapr-releases</id> <url>https://repository.mapr.com/maven/</url> <snapshots><enabled>false</enabled></snapshots> <releases><enabled>true</enabled></releases> </repository> </repositories> </profile> ----
三、編譯 先進入到 flink-shaded-10.0文件夾下 執行如下命令: mvn -T2C clean install -DskipTests -Pvendor-repos -Dhadoop.version=3.0.0-cdh6.3.2 -Dscala-2.12 -Drat.skip=true
生成:flink-shaded-hadoop-2-uber-3.0.0-cdh6.3.2-10.0.jar original-flink-shaded-hadoop-2-uber-3.0.0-cdh6.3.2-10.0.jar 取到這兩個jar 包 /root/flink-shaded-10.0/flink-shaded-hadoop-2-parent/flink-shaded-hadoop-2-uber/target 下面 mv flink-shaded-hadoop-2-uber-3.0.0-cdh6.3.2-10.0.jar /root mv original-flink-shaded-hadoop-2-uber-3.0.0-cdh6.3.2-10.0.jar /root
###2.三、編譯Flink1.10.1源碼java
一、解壓tar包 wget https://mirrors.tuna.tsinghua.edu.cn/apache/flink/flink-1.10.1/flink-1.10.1-src.tgz tar -zxvf flink-1.10.1-src.tgz 二、編譯 cd flink-1.10.1 mvn clean install -DskipTests -Dfast -Drat.skip=true -Dhaoop.version=3.0.0-cdh6.3.2 -Pvendor-repos -Dinclude-hadoop -Dscala-2.12 -T10C
三、打包編譯好的文件 路徑:flink-1.10.1/flink-dist/target/flink-1.10.1-bin 會生成一個 flink-1.10.1 的文件 編譯好的文件 cd flink-1.10.1/flink-dist/target/flink-1.10.1-bin mv original-flink-shaded-hadoop-2-uber-3.0.0-cdh6.3.2-10.0.jar flink-shaded-hadoop-2-uber-3.0.0-cdh6.3.2-10.0.jar flink-1.10.1-bin/lib tar -zcvf flink-1.10.1-scala2.12-cdh6.3.2.tar.gz flink-1.10.1/ mv flink-1.10.1-scala2.12-cdh6.3.2.tar.gz /root
下載製做 parcels的CSD文件腳本: git clone https://github.com/Git-Charles/flink-parcel.git
cd flink-parcels mv /root/flink-1.10.1-scala2.12-cdh6.3.2.tar.gz ./ mv flink-1.10.1-scala2.12-cdh6.3.2.tar.gz flink-1.10.1-bin-scala_2.12.tgz md5um flink-1.10.1-bin-scala_2.12.tgz
vim flink-parcel.properties ---- #FLINK 下載地址 FLINK_URL=http://10.60.1.110/flink-1.10.1-bin-scala_2.12.tgz FLINK_MD5=f12ae2d502f9822fd2eeb53ad9d30fbd #flink版本號 FLINK_VERSION=1.10.1 #擴展版本號 EXTENS_VERSION=BIN-SCALA_2.12 #操做系統版本,以centos爲例 OS_VERSION=7 #CDH 小版本 CDH_MIN_FULL=5.2.0 CDH_MAX_FULL=6.3.3 #CDH大版本 CDH_MIN=5 CDH_MAX=6 ---
cd flink-parcel chmod +x bulid.sh sh bulid.sh parcel
sh bulid.sh csd_on_yarn
bash bulid.sh csd_standalone
mkdir parcels-flink mv *.jar parcels-flink/ cd FLINK-1.10.1-BIN-SCALA_2.12_build/ mv * ../parcels-flink/ tar -zcvf parcels-flink.tar.gz parcels-flink 把這個包給下載 下來 去CDH6.3.2 下面去集成
五: CDH6.3.2 集成 flink 1.10.1git
cd /var/www/html/ 上傳 parcels-flink.tar.gz 到這個目錄下面 tar -zxvf parcels-flinks cp parcels-flinks cp -p *.jar /opt/cloudera/csd/ chown -R cloudera-scm:cloudera-scm /opt/cloudera/csd/ service cloudera-scm-server restart
下載分發/分配/激活 flink
關於taskmanager.cpu.cores 報錯問題 cd /opt/cloudera/parcels/FLINK/lib/flink/conf vim flink-site.xml ---- taskmanager.cpu.cores: 2 taskmanager.memory.task.heap.size: 512m taskmanager.memory.managed.size: 512m taskmanager.memory.network.min: 64m taskmanager.memory.network.max: 64m 到最後 加上 而後同步全部主機: --- 添加flink on yarn 的服務