flink 1.2不能在ha群集模式下启动

hkmswyz6  于 2021-06-25  发布在  Flink
关注(0)|答案(1)|浏览(309)

我在本地安装了flink 1.2的ha集群模式2 jobmanagers 1 taskmanager,它一直拒绝在这种模式下启动,显示“starting cluster.”消息,而不是“starting ha cluster with 2 masters and 1 peers in zookeeper quorum”
很明显,在bin/config.sh中,它读取的配置如下:


# High availability

if [ -z "${HIGH_AVAILABILITY}" ]; then
     HIGH_AVAILABILITY=$(readFromConfig ${KEY_HIGH_AVAILABILITY} "" "${YAML_CONF}")
     if [ -z "${HIGH_AVAILABILITY}" ]; then
        # Try deprecated value
        DEPRECATED_HA=$(readFromConfig "recovery.mode" "" "${YAML_CONF}")
        if [ -z "${DEPRECATED_HA}" ]; then
            HIGH_AVAILABILITY="none"
        elif [ ${DEPRECATED_HA} == "standalone" ]; then
            # Standalone is now 'none'
            HIGH_AVAILABILITY="none"
        else
            HIGH_AVAILABILITY=${DEPRECATED_HA}
        fi
     else
         HIGH_AVAILABILITY="none"
     fi
fi

这意味着独立于配置文件中“高可用性”键的配置(在我的例子中,值是“zookeeper”),它将在bin/start-cluster.sh中将其设置为“无”

if [[ $HIGH_AVAILABILITY == "zookeeper" ]]; then
    # HA Mode
    readMasters

    echo "Starting HA cluster with ${#MASTERS[@]} masters."

    for ((i=0;i<${#MASTERS[@]};++i)); do
        master=${MASTERS[i]}
        webuiport=${WEBUIPORTS[i]}
        ssh -n $FLINK_SSH_OPTS $master -- "nohup /bin/bash -l \"${FLINK_BIN_DIR}/jobmanager.sh\" start cluster ${master} ${webuiport} &"
    done

else
    echo "Starting cluster."

    # Start single JobManager on this machine
    "$FLINK_BIN_DIR"/jobmanager.sh start cluster
fi

永远进不了第一个if分支。
还有人面对这个吗?

j8yoct9x

j8yoct9x1#

是的,我相信这是一个bug:issues.apache.org/jira/browse/flink-6000。
它已经有一个悬而未决的公关。

相关问题