apt-get update && apt-get dist-upgrade -y
apt-get autoremove -y
Create and expose a SSH Key for the new user
ssh-keygen -t rsa -C "[email protected]"
cat ~/.ssh/id_rsa.pub
apt-get install -y \
build-essential \
python \
software-properties-common \
g++ \
make \
curl \
bc \
htop \
ntp \
ntpdate
dpkg-reconfigure tzdata
timedatectl set-timezone America/Sao_Paulo
timedatectl set-ntp on
wget --no-check-certificate -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/9.0.4+11/c2514751926b4512b076cc82f959763f/jdk-9.0.4_linux-x64_bin.tar.gz
tar vxfz jdk-9.0.4_linux-x64_bin.tar.gz
mv jdk-9.0.4 /usr/local/jdk
vi /etc/profile
#add variables
JAVA_HOME=/usr/local/jdk
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin:
export PATH
source /etc/profile
java -version
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
sudo apt-get install apt-transport-https
echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list
sudo apt-get update && sudo apt-get install elasticsearch
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service
sudo systemctl start elasticsearch.service
sudo systemctl stop elasticsearch.service
sudo journalctl -f
sudo journalctl --unit elasticsearch