code/src/resources/scripts/create-elastic-user.sh to code/src/resources/scripts/utils/create-elastic-user.sh
File was renamed.
code/src/resources/scripts/install-elk.sh to code/src/resources/scripts/utils/run-elk.sh
--- a/code/src/resources/scripts/install-elk.sh +++ b/code/src/resources/scripts/utils/run-elk.sh @@ -13,89 +13,33 @@ ELA_HOME=$1 cd "$ELA_HOME" -# Create user -#sudo useradd -d /tmp/component/elastic -s /bin/sh elastic -#sudo sh -c "echo \"group ALL=(elastic) NOPASSWD: ALL\" >> /etc/sudoers" - -#./create-elastic-user.sh "$ELA_HOME" - -adduser --disabled-password --gecos "" elastic -su -c 'echo "ELASTIC: I am $USER, with uid $UID"' elastic -chown -R "$(id -u elastic)":"$(id -u elastic)" "$ELA_HOME" - -ELASTIC_VERSION="5.6.4" -EA_FILE="elasticsearch-${ELASTIC_VERSION}.tar.gz" -EA_PATH="$ELA_HOME/$EA_FILE" - -LOGSTASH_VERSION="5.6.4" -LOGSTASH_FILE="logstash-${ELASTIC_VERSION}.tar.gz" -LOGSTASH_PATH="$ELA_HOME/$LOGSTASH_FILE" - -# KIBANA_VERSION="4.4.2" -KIBANA_VERSION="5.6.4" -KIBANA_FILE="kibana-${ELASTIC_VERSION}-linux-x86_64.tar.gz" -KIBANA_PATH="$ELA_HOME/$KIBANA_FILE" - -if [ ! -f "$EA_PATH" ]; then - echo "\n✘ ERROR File $EA_FILE not found" 1>&2; - exit 0 -fi - -if [ ! -f "$LOGSTASH_PATH" ]; then - echo "\n✘ ERROR File $LOGSTASH_FILE not found" 1>&2; - exit 0 -fi - -if [ ! -f "$KIBANA_PATH" ]; then - echo "\n✘ ERROR File $KIBANA_FILE not found" 1>&2; - exit 0 -fi - -if [ ! -f "$EA_PATH" ]; then - wget -nv https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ELASTIC_VERSION}.tar.gz - echo "Elastic Search $ELASTIC_VERSION Downloaded" -fi - -if [ ! -f "$LOGSTASH_PATH" ]; then - wget -nv https://artifacts.elastic.co/downloads/logstash/logstash-${LOGSTASH_VERSION}.tar.gz - echo "Logstash $LOGSTASH_VERSION Downloaded" -fi - -if [ ! -f "$KIBANA_PATH" ]; then - wget -nv https://download.elastic.co/kibana/kibana/kibana-${KIBANA_VERSION}-linux-x64.tar.gz - echo "Kibana $KIBANA_VERSION Downloaded" -fi - -tar -xzf "$EA_PATH" -C "$ELA_HOME" -echo "ElasticSearch $ELASTIC_VERSION extracted" - -tar -xzf "$LOGSTASH_PATH" -C "$ELA_HOME" -echo "Logstash $LOGSTASH_VERSION extracted" - -tar -xzf "$KIBANA_PATH" -C "$ELA_HOME" -echo "Kibana $KIBANA_VERSION extracted" - -chown -R "$(id -u elastic)":"$(id -u elastic)" "$ELA_HOME" - export JAVACMD=`which java` # run elasticsearch as a daemon #sudo -H -u elastic bash -c "$ELA_HOME/elasticsearch-5.6.4/bin/elasticsearch -d -p pid-elasticsearch" & #sudo -u elastic -c "$ELA_HOME/elasticsearch-5.6.4/bin/elasticsearch -d -p pid-elasticsearch" -s /bin/sh & #su -c "./elasticsearch-5.6.4/bin/elasticsearch -d -p pid-elasticsearch" elastic & -#su -c "$ELA_HOME/elasticsearch-5.6.4/bin/elasticsearch -d -p pid-elasticsearch" elastic & +su -c "$ELA_HOME/elasticsearch-5.6.4/bin/elasticsearch -d -p pid-elasticsearch" elastic & # run kibana as a daemon # sudo -H -u elastic bash -c "$ELA_HOME/kibana-5.6.4-linux-x86_64/bin/kibana -p pid-kibana" & #sudo -u elastic -c "$ELA_HOME/kibana-5.6.4-linux-x86_64/bin/kibana -p pid-kibana" -s /bin/sh & #"$ELA_HOME/kibana-5.6.4-linux-x86_64/bin/kibana" & -#su -c "$ELA_HOME/kibana-5.6.4-linux-x86_64/bin/kibana" elastic & +### +#h, --help output usage information +# -e, --elasticsearch <uri> Elasticsearch instance +# -c, --config <path> Path to the config file, can be changed with the CONFIG_PATH environment variable as well. Use multiple --config args to include multiple config files. +# -p, --port <port> The port to bind to +# -q, --quiet Prevent all logging except errors +# -Q, --silent Prevent all logging +# --verbose Turns on verbose logging +# -H, --host <host> The host to bind to +# -l, --log-file <path> The file to log to +### +su -c "$ELA_HOME/kibana-5.6.4-linux-x86_64/bin/kibana" elastic + +#cambiar permisos de los directorios creados Exception in thread "main" 2017-11-24 15:16:22,074 main #ERROR No log4j2 configuration file found. Using default configuration: logging only errors to the console. Set system property 'log4j2.debug' to show Log4j2 internal initialization logging. 2017-11-24 15:16:22,129 main #ERROR Could not register mbeans java.security.AccessControlException: access denied ("javax.management.MBeanTrustPermission"a elastic SettingsException[Failed to load settings from /eslap/component/resources/elastic/elasticsearch-5.6.4/config/elasticsearch.yml]; nested: AccessDeniedException[/eslap/component/resources/elastic/elasticsearch-5.6.4/config/elasticsearch.yml]; - -# Remove to save disk -#rm "$EA_PATH" -#rm "$LOGSTASH_PATH" -#rm "$KIBANA_PATH"