Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 6E690200AC8 for ; Tue, 24 May 2016 00:26:18 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 6CFAB160A24; Mon, 23 May 2016 22:26:18 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B54AF160A0E for ; Tue, 24 May 2016 00:26:17 +0200 (CEST) Received: (qmail 92664 invoked by uid 500); 23 May 2016 22:26:17 -0000 Mailing-List: contact dev-help@gearpump.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@gearpump.incubator.apache.org Delivered-To: mailing list dev@gearpump.incubator.apache.org Delivered-To: moderator for dev@gearpump.incubator.apache.org Received: (qmail 60741 invoked by uid 99); 23 May 2016 09:51:57 -0000 X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.021 X-Spam-Level: X-Spam-Status: No, score=-4.021 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001] autolearn=disabled From: whjiang To: dev@gearpump.incubator.apache.org Reply-To: dev@gearpump.incubator.apache.org References: In-Reply-To: Subject: [GitHub] incubator-gearpump pull request: fix GEARPUMP-117 add scripts to s... Content-Type: text/plain Message-Id: <20160523095153.5A6F6DFB04@git1-us-west.apache.org> Date: Mon, 23 May 2016 09:51:53 +0000 (UTC) archived-at: Mon, 23 May 2016 22:26:18 -0000 Github user whjiang commented on a diff in the pull request: https://github.com/apache/incubator-gearpump/pull/23#discussion_r64195757 --- Diff: bin/config.sh --- @@ -0,0 +1,84 @@ +#!/usr/bin/env bash + +GEARPUMP_PID_DIR="" # Directory to store *.pid files to +DEFAULT_ENV_PID_DIR="/tmp" # Default directory to store *.pid files to + +GEARPUMP_LOG_DIR="" +DEFAULT_ENV_LOG_DIR="/tmp/gear-logs" + +if [ "$GEARPUMP_PID_DIR" = "" ]; then + GEARPUMP_PID_DIR=${DEFAULT_ENV_PID_DIR} +fi + +if [ "$GEARPUMP_LOG_DIR" = "" ]; then + GEARPUMP_LOG_DIR=${DEFAULT_ENV_LOG_DIR} +fi + +bin=`dirname "$0"` +SYMLINK_RESOLVED=`cd "$bin"; pwd -P` + +# Define the main directory of the gearpump installation +export GEAR_ROOT_DIR=`dirname "$SYMLINK_RESOLVED"` +export GEAR_BIN_DIR="$GEAR_ROOT_DIR/bin" +export GEAR_CONF_DIR="$GEAR_ROOT_DIR/conf" + +readMasters() { + MASTERS_FILE="${GEAR_CONF_DIR}/masters" + + if [[ ! -f "${MASTERS_FILE}" ]]; then + echo "No masters file. Please specify masters in 'conf/masters'." + exit 1 + fi + + MASTERS=() + MASTERPORTS=() + + while IFS='' read -r line || [[ -n "$line" ]]; do + HOSTPORT=$( extractHostName $line) + + if [ -n "$HOSTPORT" ]; then + HOST=$(echo $HOSTPORT | cut -f1 -d:) + PORT=$(echo $HOSTPORT | cut -s -f2 -d:) + MASTERS+=(${HOST}) + + if [ -z "$PORT" ]; then + MASTERPORTS+=(3000) + else + MASTERPORTS+=(${PORT}) + fi + fi + done < "$MASTERS_FILE" +} + +readSlaves() { + SLAVES_FILE="${GEAR_CONF_DIR}/slaves" --- End diff -- better to make naming consistent. E.g. Gearpump has "worker", but not "slave". So, it is better to rename "slaves" to "workers". --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---