This repository has been archived by the owner on Jan 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 67
install #1874
Merged
Merged
install #1874
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
#!/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. | ||
# | ||
|
||
BIN_HOME=$(cd `dirname $0`;pwd) | ||
SSM_HOME=${BIN_HOME%/*} | ||
SSM_NAME=${SSM_HOME##*/} | ||
CONF_DIR=$SSM_HOME/conf | ||
INSTALL_PATH='' | ||
|
||
cd $SSM_HOME/../; | ||
|
||
#config option is used to specify SSM's conf directory, e.g. "./install.sh --config ". If not given, the default conf is $SSM_HOME/config. | ||
while [ $# != 0 ]; do | ||
case "$1" in | ||
"--config") | ||
shift | ||
CONF_DIR="$1" | ||
if [[ ! -d "${CONF_DIR}" ]]; then | ||
echo "ERROR : ${CONF_DIR} is not a directory" | ||
exit 1 | ||
else | ||
if [[ $CONF_DIR != */ ]];then | ||
CONF_DIR=${CONF_DIR}/ | ||
fi | ||
break | ||
fi | ||
;; | ||
*) | ||
echo no command \"./install.sh $1\" | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
|
||
cat $CONF_DIR/servers $CONF_DIR/agents >>/dev/null 2>/dev/null | ||
if [ $? = 1 ];then | ||
echo -e "there is no file named 'agents' or 'servers' under $CONF_DIR" | ||
exit 1 | ||
fi | ||
|
||
echo -e "SSM will be installed on the below hosts (\033[33mempty means there is no host configured\033[0m):" | ||
|
||
IFS=$'\n' | ||
for host in `cat $CONF_DIR/servers;echo '';cat $CONF_DIR/agents` | ||
do | ||
host=$(echo $host | tr -d " ") | ||
if [[ "$host" =~ ^#.* ]];then | ||
continue | ||
else | ||
echo -n -e "\033[33m$host \033[0m " | ||
fi | ||
done | ||
|
||
echo "" | ||
|
||
user=`whoami` | ||
if [[ "$user" = "root" ]];then | ||
DEFAULT_PATH=/root/ | ||
else DEFAULT_PATH=/home/$user/ | ||
fi | ||
|
||
while true;do | ||
read -p "Do you want to continue installing? Please type [Y|y] or [N|n]: | ||
" yn | ||
case $yn in | ||
[Yy]* ) | ||
read -p "$(echo -e "Please type in the path where you want to install SSM (\033[33mempty means using default path '$DEFAULT_PATH'\033[0m)":) | ||
" INSTALL_PATH | ||
break;; | ||
[Nn]* ) exit 1;; | ||
* ) continue;; | ||
esac | ||
done | ||
|
||
if [ -z "$INSTALL_PATH" ];then | ||
INSTALL_PATH=$DEFAULT_PATH | ||
fi | ||
|
||
echo installing... | ||
|
||
if [[ $INSTALL_PATH != */ ]];then | ||
INSTALL_PATH=${INSTALL_PATH}/ | ||
fi | ||
|
||
tar cf "${SSM_NAME}.tar" ${SSM_NAME} | ||
|
||
for host in `cat $CONF_DIR/servers;echo '';cat $CONF_DIR/agents` | ||
do | ||
host=$(echo $host | tr -d " ") | ||
if [[ "$host" =~ ^#.* ]];then | ||
continue | ||
else | ||
#Before install on a host, delete ssm home directory if there exists | ||
ssh $host "if [ -d ${INSTALL_PATH}${SSM_NAME} ];then rm -rf ${INSTALL_PATH}${SSM_NAME};fi" | ||
flag=`ssh $host "if [ -d $INSTALL_PATH ];then echo 1; else echo 0; fi"` | ||
if [ $flag = 1 ];then | ||
echo installing SSM to $host... | ||
scp ${SSM_NAME}.tar $host:$INSTALL_PATH >> /dev/null | ||
ssh $host "cd ${INSTALL_PATH};tar xf ${SSM_NAME}.tar;rm -f ${SSM_NAME}.tar" | ||
elif [ $flag = 0 ];then | ||
ssh $host "mkdir $INSTALL_PATH" | ||
echo installing SSM to $host... | ||
scp ${SSM_NAME}.tar $host:$INSTALL_PATH >> /dev/null | ||
ssh $host "cd ${INSTALL_PATH};tar xf ${SSM_NAME}.tar;rm -f ${SSM_NAME}.tar" | ||
else | ||
rm -f ${SSM_NAME}.tar | ||
exit 1 | ||
fi | ||
fi | ||
done | ||
|
||
rm -f ${SSM_NAME}.tar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -190,7 +190,7 @@ After finishing the SSM configuration, we can start to deploy the SSM package wi | |
# Deploy SSM | ||
--------------------------------------------------------------------------------- | ||
|
||
SSM supports two running modes, standalone service and SSM service with multiple Smart Agents. If file move performance is not the concern, then standalone service mode is enough. If better performance is desired, we recommend to deploy one agent on each Datanode. | ||
SSM supports two running modes, standalone service and SSM service with multiple Smart Agents. If file move performance is not the concern, then standalone service mode is enough. If better performance is desired, we recommend to deploy one agent on each Datanode. To deploy SSM to Smart Server nodes and Smart Agent nodes (if configured), you can enter into ${SMART_HOME} directory and type ./bin/install.sh. You can use --config <config-dir> to specify where SSM's config directory is.${SMART_HOME}/conf is the default config directory if the config option is not used. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. type ./bin/install.sh -> type Keep a space before sentence ${SMART_HOME}/conf is the default.... |
||
|
||
## Standalone SSM Service | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will look better if the brackets has same color as the words enclosed by them. Another prompt with brackets should be same.