From issues-return-160030-archive-asf-public=cust-asf.ponee.io@flink.apache.org Fri Mar 23 14:35:24 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 40861180789 for ; Fri, 23 Mar 2018 14:35:24 +0100 (CET) Received: (qmail 55284 invoked by uid 500); 23 Mar 2018 13:35:23 -0000 Mailing-List: contact issues-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list issues@flink.apache.org Received: (qmail 55073 invoked by uid 99); 23 Mar 2018 13:35:22 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Mar 2018 13:35:22 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7F07AF67A3; Fri, 23 Mar 2018 13:35:22 +0000 (UTC) From: fhueske To: issues@flink.apache.org Reply-To: issues@flink.apache.org References: In-Reply-To: Subject: [GitHub] flink pull request #5750: [FLINK-8973] [E2E] HA end-to-end test with StateMa... Content-Type: text/plain Message-Id: <20180323133522.7F07AF67A3@git1-us-west.apache.org> Date: Fri, 23 Mar 2018 13:35:22 +0000 (UTC) Github user fhueske commented on a diff in the pull request: https://github.com/apache/flink/pull/5750#discussion_r176726476 --- Diff: flink-end-to-end-tests/test-scripts/common.sh --- @@ -39,6 +39,93 @@ cd $TEST_ROOT export TEST_DATA_DIR=$TEST_INFRA_DIR/temp-test-directory-$(date +%S%N) echo "TEST_DATA_DIR: $TEST_DATA_DIR" +function revert_default_config() { + sed 's/^ //g' > ${FLINK_DIR}/conf/flink-conf.yaml << EOL + #============================================================================== + # Common + #============================================================================== + + jobmanager.rpc.address: localhost + jobmanager.rpc.port: 6123 + jobmanager.heap.mb: 1024 + taskmanager.heap.mb: 1024 + taskmanager.numberOfTaskSlots: 1 + parallelism.default: 1 + + #============================================================================== + # Web Frontend + #============================================================================== + + web.port: 8081 +EOL +} + +function create_ha_conf() { + + # create the masters file (only one currently). + # This must have all the masters to be used in HA. + echo "localhost:8081" > ${FLINK_DIR}/conf/masters + + # then move on to create the flink-conf.yaml + + if [ -e $TEST_DATA_DIR/recovery ]; then + echo "File ${TEST_DATA_DIR}/recovery exists. Deleting it..." + rm -rf $TEST_DATA_DIR/recovery + fi + + sed 's/^ //g' > ${FLINK_DIR}/conf/flink-conf.yaml << EOL + #============================================================================== + # Common + #============================================================================== + + jobmanager.rpc.address: localhost + jobmanager.rpc.port: 6123 + jobmanager.heap.mb: 1024 + taskmanager.heap.mb: 1024 + taskmanager.numberOfTaskSlots: 4 + parallelism.default: 1 + + #============================================================================== + # High Availability + #============================================================================== + + high-availability: zookeeper + high-availability.zookeeper.storageDir: file://${TEST_DATA_DIR}/recovery/ + high-availability.zookeeper.quorum: localhost:2181 + high-availability.zookeeper.path.root: /flink + high-availability.cluster-id: /test_cluster_one + + #============================================================================== + # Web Frontend + #============================================================================== + + web.port: 8081 +EOL +} + +function start_ha_cluster { + echo "Setting up HA Cluster..." + create_ha_conf + start_local_zk + start_cluster +} + +function start_local_zk { + while read server ; do + server=$(echo -e "${server}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') # trim + + # match server.id=address[:port[:port]] + if [[ $server =~ ^server\.([0-9]+)[[:space:]]*\=[[:space:]]*([^: \#]+) ]]; then + id=${BASH_REMATCH[1]} + address=${BASH_REMATCH[2]} --- End diff -- `address` seems to be unused ---