Skip to content
Yuan Yifan edited this page Dec 7, 2018 · 2 revisions

守夜人部署

Mini Cluster

使用如下指令编译:mvn clean package -pl lofka-night-watcher -am

编译完成后将lofka-night-watcher/target下的JAR包和lib文件夹拷出来,同时确保conf文件夹下有lofka-kafka-client.propertieslofka-statistics-mongo.properties文件。

最后在文件夹下执行java -jar lofka-night-watcher-版本号.jar即可启动流计算。

此时启动的流计算中不包含动态计算内容,如果需要使用动态计算请在执行的时候加上参数:

--dynamics 动态配置地址

标准模式(Standalone Cluster 或者 YARN)

程序不需要修改即可在Flink 1.6.2 的集群上提交,但是需要注意的是,如果你想要使得你的JAR包更小,那么请修改一下POM文件,取消如下部分的注释:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-shade-plugin</artifactId>
    <version>3.0.0</version>
    <executions>
        <execution>
            <phase>package</phase>
            <goals>
                <goal>shade</goal>
            </goals>
            <configuration>
                <artifactSet>
                    <excludes>
                        <exclude>org.apache.flink:force-shading</exclude>
                        <exclude>com.google.code.findbugs:jsr305</exclude>
                        <exclude>org.slf4j:*</exclude>
                        <exclude>log4j:*</exclude>
                    </excludes>
                </artifactSet>
                <filters>
                    <filter>
                        <!-- Do not copy the signatures in the META-INF folder.
                        Otherwise, this might cause SecurityExceptions when using the JAR. -->
                        <artifact>*:*</artifact>
                        <excludes>
                            <exclude>META-INF/*.SF</exclude>
                            <exclude>META-INF/*.DSA</exclude>
                            <exclude>META-INF/*.RSA</exclude>
                        </excludes>
                    </filter>
                </filters>
                <transformers>
                    <transformer
                            implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                        <mainClass>com.github.tsingjyujing.lofka.nightwatcher.StreamingEntry</mainClass>
                    </transformer>
                </transformers>
            </configuration>
        </execution>
    </executions>
</plugin>

同时取消<scope>runtime</scope><scope>provided</scope>的注释。

Clone this wiki locally