| #!/bin/bash |
| |
| # Licensed to the Apache Software Foundation (ASF) under one or more |
| # contributor license agreements. See the NOTICE file distributed with |
| # this work for additional information regarding copyright ownership. |
| # The ASF licenses this file to You under the Apache License, Version 2.0 |
| # (the "License"); you may not use this file except in compliance with |
| # the License. You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| set -e |
| |
| for i in "$@";do |
| case "$i" in |
| -d|--detached) |
| SCREEN_OPTS+=" -dm " |
| ;; |
| -I|--init-default-metastore) |
| D=/data/hive/metastore_db |
| if [ ! -d "$D" ]; then |
| echo "@@@ init metastore" |
| reinit_metastore |
| else |
| echo "@@@ metastore already inited at $D" |
| fi |
| ;; |
| *) |
| echo "!!! unknown option $i" >&2 && exit 1 |
| ;; |
| esac |
| done |
| |
| |
| wait_port close 8040 |
| wait_port close 8042 |
| wait_port close 8030 |
| wait_port close 8032 |
| wait_port close 10000 |
| |
| cat > /tmp/screenrc1 << EOF |
| screen -t term |
| screen -t RM 1 spawn_shell_after yarn resourcemanager |
| screen -t NM 2 spawn_shell_after yarn nodemanager |
| screen -t HS2 3 spawn_shell_after hs2_debug |
| screen -t BL 4 spawn_shell_after safe_bl |
| EOF |
| |
| screen $SCREEN_OPTS -c /tmp/screenrc1 |