Skip to content

Instantly share code, notes, and snippets.

@iversond
Last active August 25, 2020 14:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iversond/02be20122953af8a3c0e4576a4d0f067 to your computer and use it in GitHub Desktop.
Save iversond/02be20122953af8a3c0e4576a4d0f067 to your computer and use it in GitHub Desktop.
ES Cluster setup for demos on a single Linux PI

On a fresh Linux PI installation

Set OS Settings

sudo sysctl -w vm.max_map_count=262144

Download getMOSPatch

sudo su - psadm1
curl -L https://github.com/MarisElsins/getMOSPatch/raw/master/getMOSPatch.jar -o getMOSPatch.jar

Install Elasticsearch

JAVA_HOME=/u01/app/oracle/product/pt/jdk1.8.0_191
PATH=$PATH:$JAVA_HOME/bin
java -jar getMOSPatch.jar patch=29589421 download=all platform=226P MOSUser=dan@psadmin.io MOSPass=<pass>
unzip ESK*.zip

# ##########
# Silent Install still not quite right
# The encrypt utility does not provide a {V2.1} key, but it
# will write it to an existing esuers.yml file.
# Not friendly for scripting an initial installation
# ##########

# cd archives
# tar xvf pt-elasticsearch-*.tgz
# ES_HOME=`pwd`
# PLUGIN_CLASSPATH="$ES_HOME/plugins/orcl-security-plugin/*"
# PLUGIN_CLASSPATH="$PLUGIN_CLASSPATH:$ES_HOME/lib/*"
# PASSWORD="Passw0rd"
# java -Dplugin.path.home="$ES_HOME/plugins/orcl-security-plugin" -Des.path.home="$ES_HOME/plugins/orcl-security-plugin" -cp "$PLUGIN_CLASSPATH"  com.peoplesoft.pt.elasticsearch.pscipherwrapper.PSESUser addusersilent esadmin2 "$PASSWORD" admin,read,security

cd ../setup
# vi silentInstall.config
# Add parameters and the encryption password
# ./psft-dpk-setup.sh --install_silent --install_base_dir /u01/app/oracle/product/pt/es --config_file silentinstall.config

./psft-dpk-setup.sh --install --install_base_dir /u01/app/oracle/product/pt/es 
# Passwords: Passw0rd
# Min Nodes: 2
# Install Kibana: n
# Discovery Hosts: ["127.0.0.1", "[::1]", "10.0.1.2"]
cat /u01/app/oracle/product/pt/es/pt/elasticsearch6.1.2/plugins/orcl-security-plugin/config/properties/esusers.yml
# Grab the encrypted passwords to re-use for nodes 2/3
# esadmin: "{V2.1}v26upR1zUWTQ1NvsEwbM6pfolWr/nXee"
# people: "{V2.1}v26upR1zUWTQ1NvsEwbM6pfolWr/nXee"

cp silentinstall.config silentinstall2.config
vi silentinstall2.config
# Install elasticsearch?[Y/N]= y
# network.host= <hostname>
# http.port= 9210
# discovery.zen.ping.unicast.hosts= ["127.0.0.1", "[::1]", "10.0.1.2"]
# minimum_master_nodes= 2
# ES_HEAP_SIZE= 1
# esadmin.password= {V2.1}v26upR1zUWTQ1NvsEwbM6pfolWr/nXee
# people.password= {V2.1}v26upR1zUWTQ1NvsEwbM6pfolWr/nXee
# Install kibana?[Y/N]= n
./psft-dpk-setup.sh --install_silent --install_base_dir /u01/app/oracle/product/pt/es2 --config_file silentinstall2.config

cp silentinstall2.config silentinstall3.config
vi silentinstall3.config
# http.port= 9220
./psft-dpk-setup.sh --install_silent --install_base_dir /u01/app/oracle/product/pt/es3 --config_file silentinstall3.config

# To start ES after a config change
nohup bin/elasticsearch &

# To find a specific ES node
ps -ef | grep elastic | grep es2

Install mitmproxy

curl -L https://snapshots.mitmproxy.org/4.0.4/mitmproxy-4.0.4-linux.tar.gz -o mitmproxy.tar.gz
tar xvf mitmproxy.tar.gz

Install Cerebtro

curl -L https://github.com/lmenezes/cerebro/releases/download/v0.8.3/cerebro-0.8.3.tgz -o cerebro.tgz
tar xvf cerebro.tgz
cd cerebro-0.8.3
vi conf/application.conf
# Add config/pass for the local cluster
JAVA_HOME=/u01/app/oracle/product/pt/jdk1.8.0_191
PATH=$PATH:$JAVA_HOME/bin
bin/cerebro &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment