Review Board 1.7.22


SQOOP-990: Sqoop2: Allow users to override Sqoop2's default http port and admin port

Review Request #10662 - Created April 19, 2013 and submitted

Mark Grover
sqoop2
SQOOP-990
Reviewers
Sqoop
jarcec
sqoop-sqoop2
Allowing users to override Sqoop2's default http port and admin port.

 

Diff revision 2 (Latest)

1 2
1 2

  1. dist/src/main/bin/sqoop.sh: Loading...
  2. dist/src/main/bin/sqoop-sys.sh: Loading...
  3. dist/src/main/server/bin/setenv.sh: Loading...
  4. dist/src/main/server/conf/server.xml: Loading...
dist/src/main/bin/sqoop.sh
Revision f1711ee New Change
[20] 34 lines
[+20]
35
echo "Sqoop home directory: ${CUR_DIR}..."
35
echo "Sqoop home directory: ${CUR_DIR}..."
36

    
   
36

   
37
CATALINA_BIN=${CATALINA_BIN:-server/bin}
37
CATALINA_BIN=${CATALINA_BIN:-server/bin}
38
CLIENT_LIB=${CLIENT_LIB:-client/lib}
38
CLIENT_LIB=${CLIENT_LIB:-client/lib}
39

    
   
39

   

    
   
40
setup_catalina_opts() {

    
   
41
  # The Java System properties 'sqoop.http.port' and 'sqoop.admin.port' are

    
   
42
  # not used by Sqoop. They are used in Tomcat's server.xml configuration file

    
   
43
  echo "Using   CATALINA_OPTS:       ${CATALINA_OPTS}"

    
   
44

   

    
   
45
  catalina_opts="-Dsqoop.http.port=${SQOOP_HTTP_PORT}";

    
   
46
  catalina_opts="${catalina_opts} -Dsqoop.admin.port=${SQOOP_ADMIN_PORT}";

    
   
47

   

    
   
48
  echo "Adding to CATALINA_OPTS:    ${catalina_opts}"

    
   
49

   

    
   
50
  export CATALINA_OPTS="${CATALINA_OPTS} ${catalina_opts}"

    
   
51
}

    
   
52

   
40
COMMAND=$1
53
COMMAND=$1
41
case $COMMAND in
54
case $COMMAND in
42
  server)
55
  server)
43
    if [ $# = 1 ]; then
56
    if [ $# = 1 ]; then
44
      echo "Usage: sqoop.sh server <start/stop>"
57
      echo "Usage: sqoop.sh server <start/stop>"
45
      exit
58
      exit
46
    fi
59
    fi
47
    actionCmd=$2
60
    actionCmd=$2
48
    # Remove the first 2 command line arguments so we can pass
61

   

    
   
62
    # resolve links - $0 may be a softlink

    
   
63
    PRG="${0}"

    
   
64

   

    
   
65
    while [ -h "${PRG}" ]; do

    
   
66
      ls=`ls -ld "${PRG}"`

    
   
67
      link=`expr "$ls" : '.*-> \(.*\)$'`

    
   
68
      if expr "$link" : '/.*' > /dev/null; then

    
   
69
        PRG="$link"

    
   
70
      else

    
   
71
        PRG=`dirname "${PRG}"`/"$link"

    
   
72
      fi

    
   
73
    done

    
   
74

   

    
   
75
    BASEDIR=`dirname ${PRG}`

    
   
76
    BASEDIR=`cd ${BASEDIR}/..;pwd`

    
   
77

   

    
   
78
    source ${BASEDIR}/bin/sqoop-sys.sh

    
   
79
    setup_catalina_opts

    
   
80

   

    
   
81
    # There seems to be a bug in catalina.sh whereby catalina.sh doesn't respect

    
   
82
    # CATALINA_OPTS when stopping the tomcat server. Consequently, we have to hack around

    
   
83
    # by specifying the CATALINA_OPTS properties in JAVA_OPTS variable

    
   
84
    if [ "$actionCmd" == "stop" ]; then

    
   
85
      export JAVA_OPTS="$JAVA_OPTS $CATALINA_OPTS"

    
   
86
    fi

    
   
87

   

    
   
88
    # Remove the first 2 command line arguments (server and action command (start/stop)) so we can pass
49
    # the rest to catalina.sh script
89
    # the rest to catalina.sh script
50
    shift
90
    shift
51
    shift
91
    shift
52

    
   
92

   
53
    $CATALINA_BIN/catalina.sh $actionCmd "$@"
93
    $CATALINA_BIN/catalina.sh $actionCmd "$@"
[+20] [20] 20 lines
dist/src/main/bin/sqoop-sys.sh
New File
 
dist/src/main/server/bin/setenv.sh
Revision 607427e New Change
 
dist/src/main/server/conf/server.xml
Revision 3206cce New Change
 
  1. dist/src/main/bin/sqoop.sh: Loading...
  2. dist/src/main/bin/sqoop-sys.sh: Loading...
  3. dist/src/main/server/bin/setenv.sh: Loading...
  4. dist/src/main/server/conf/server.xml: Loading...