spark_server.sh 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #!/bin/bash
  2. # Licensed to Cloudera, Inc. under one
  3. # or more contributor license agreements. See the NOTICE file
  4. # distributed with this work for additional information
  5. # regarding copyright ownership. Cloudera, Inc. licenses this file
  6. # to you under the Apache License, Version 2.0 (the
  7. # "License"); you may not use this file except in compliance
  8. # with the License. You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. #
  18. # Runs Beeswax server.
  19. set -o errexit
  20. #if [ -z "$HADOOP_CONF_DIR" ]; then
  21. # echo "\$HADOOP_CONF_DIR must be specified" 1>&2
  22. # exit 1
  23. #fi
  24. #echo \$HADOOP_HOME=$HADOOP_HOME
  25. #
  26. #if [ -z "$HADOOP_BIN" ]; then
  27. # echo "\$HADOOP_BIN must be specified" 1>&2
  28. # exit 1
  29. #fi
  30. #echo \$HADOOP_BIN=$HADOOP_BIN
  31. #
  32. #if [ -z "$HIVE_CONF_DIR" ]; then
  33. # echo "\$HIVE_CONF_DIR must be specified" 1>&2
  34. # exit 1
  35. #fi
  36. #
  37. #echo \$HIVE_CONF_DIR=$HIVE_CONF_DIR
  38. #
  39. #if [ -z "$HIVE_HOME" ]; then
  40. # echo "\$HIVE_HOME not specified. Defaulting to $HIVE_CONF_DIR/.." 1>&2
  41. # export HIVE_HOME=$HIVE_CONF_DIR/..
  42. # exit 1
  43. #fi
  44. #
  45. #echo \$HIVE_HOME=$HIVE_HOME
  46. #
  47. SPARK_ROOT=$(dirname $0)
  48. SPARK_JAR=$SPARK_ROOT/java/sparker-server/target/sparker-server-3.7.0-SNAPSHOT.jar
  49. #HIVE_LIB=$HIVE_HOME/lib
  50. #
  51. #export HADOOP_CLASSPATH=$(find $HADOOP_HOME -name hue-plugins*.jar | tr "\n" :):$(find $HIVE_LIB -name "*.jar" | tr "\n" :)
  52. #
  53. #if [ -n "$HADOOP_EXTRA_CLASSPATH_STRING" ]; then
  54. # export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:$HADOOP_EXTRA_CLASSPATH_STRING
  55. #fi
  56. #
  57. #export HADOOP_OPTS="-Dlog4j.configuration=log4j.properties"
  58. #echo \$HADOOP_CLASSPATH=$HADOOP_CLASSPATH
  59. #echo \$HADOOP_OPTS=$HADOOP_OPTS
  60. #
  61. ## Use HADOOP_CONF_DIR to preprend to classpath, to avoid fb303 conflict,
  62. ## and to force hive-default to correspond to the Hive version we have.
  63. ## Because we are abusing HADOOP_CONF_DIR, we have to emulate its default
  64. ## behavior here as well.
  65. #if [ -f $HADOOP_CONF_DIR/hadoop-env.sh ]; then
  66. # . $HADOOP_CONF_DIR/hadoop-env.sh
  67. #fi
  68. #
  69. #export HADOOP_CONF_DIR=$HIVE_CONF_DIR:$HADOOP_CONF_DIR
  70. #echo \$HADOOP_CONF_DIR=$HADOOP_CONF_DIR
  71. #echo \$HADOOP_MAPRED_HOME=$HADOOP_MAPRED_HOME
  72. # Note: I've had trouble running this with just "java -jar" with the classpath
  73. # determined with a seemingly appropriate find command.
  74. echo CWD=$(pwd)
  75. echo Executing java jar $SPARK_JAR "$@"
  76. exec java -jar $SPARK_JAR "$@"