Skip to content

Commit

Permalink
KYLO-658 - Updated elasticsearch to use a different setup location
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremymerrifield committed May 26, 2017
1 parent 5baeae8 commit 7ea3776
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 14 deletions.
34 changes: 22 additions & 12 deletions install/setup/elasticsearch/install-elasticsearch.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
#!/bin/bash

#########
# Example 1: ./install-elasticsearch /opt/kylo-dev/setup
# Example 2: ./install-elasticsearch /tmp/offline-install -o
#########
echo "Installing Elasticsearch"
offline=false
working_dir=$2
SETUP_FOLDER=/opt/kylo/setup

if [ $# > 1 ]
if [ $# -eq 0 ]
then
echo "No setup folder specified. Defaulting to /opt/kylo/setup"
elif [ $# -eq 1 ]
then
echo "The setup folder is $1 "
SETUP_FOLDER=$1
elif [ $# -eq 2 ] && ([ "$2" = "-o" ] || [ "$2" = "-O" ])
then
if [ "$1" = "-o" ] || [ "$1" = "-O" ]
then
echo "Working in offline mode"
echo "Working in offline mode"
offline=true
fi
else
echo "Unknown arguments. The first argument should be the path to the setup folder. Optional you can pass a second argument to set offline mode. The value is -o or -O "
exit 1
fi

# function for determining way to handle startup scripts
Expand All @@ -27,7 +39,7 @@ linux_type=$(get_linux_type)

if [ $offline = true ]
then
cd $working_dir/elasticsearch
cd $SETUP_FOLDER/elasticsearch

if [ "$linux_type" == "chkonfig" ]; then
echo "Executing RPM"
Expand All @@ -36,9 +48,9 @@ then
echo "Executing DEB"
rpm -ivh elasticsearch-2.3.0.deb
fi
cp $working_dir/elasticsearch/elasticsearch.yml /etc/elasticsearch/
cp $SETUP_FOLDER/elasticsearch/elasticsearch.yml /etc/elasticsearch/
else
cd /opt
cd $SETUP_FOLDER/elasticsearch

if [ "$linux_type" == "chkonfig" ]; then
echo "Downloading RPM"
Expand All @@ -61,9 +73,7 @@ else
update-rc.d elasticsearch defaults 95 10
fi

cp /opt/kylo/setup/elasticsearch/elasticsearch.yml /etc/elasticsearch/
echo "Installing HQ plugin"
/usr/share/elasticsearch/bin/plugin install royrusso/elasticsearch-HQ
cp $SETUP_FOLDER/elasticsearch/elasticsearch.yml /etc/elasticsearch/
fi

echo "Starting Elasticsearch"
Expand Down
4 changes: 2 additions & 2 deletions install/setup/setup-wizard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ echo " "
yes_no="^[yYnN]{1}$"
# (1) prompt user, and read command line argument
while [[ ! $install_db =~ $yes_no ]]; do
read -p "Would you like to install the database scripts to a local database instance? Please enter y/n: " install_db
read -p "Would you like to install the database scripts in a database instance? Please enter y/n: " install_db
done

if [ "$install_db" == "y" ] || [ "$install_db" == "Y" ] ; then
Expand Down Expand Up @@ -127,7 +127,7 @@ if [ "$install_es" == "y" ] || [ "$install_es" == "Y" ] ; then
echo "Installing Elasticsearch"
if [ $offline = true ]
then
./elasticsearch/install-elasticsearch.sh -O $current_dir
./elasticsearch/install-elasticsearch.sh $current_dir -O
else
./elasticsearch/install-elasticsearch.sh
fi
Expand Down

0 comments on commit 7ea3776

Please sign in to comment.