|
|
|
# Clone Debian Stretch template, set up IPs, hostname, ssh keys
|
|
|
|
apt update
|
|
|
|
apt -y dist-upgrade
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
# Install Java dependency
|
|
|
|
apt install openjdk-8-jre-headless
|
|
|
|
|
|
|
|
|
|
|
|
# Install Elasticsearch version 6 (latest)
|
|
|
|
# Get key
|
|
|
|
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
|
|
|
|
# Install deps (should be installed already):
|
|
|
|
apt-get -y install apt-transport-https
|
|
|
|
# Set up repo for release 6.x
|
|
|
|
echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list
|
|
|
|
|
|
|
|
# Disable apt-cache in /etc/apt/apt.conf, it doesn't work with https
|
|
|
|
apt update
|
|
|
|
|
|
|
|
# It doesn't appear the open source version is in the repo, needs manual install. XXX
|
|
|
|
#apt install elasticsearch-oss
|
|
|
|
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-6.3.2.deb
|
|
|
|
dpkg -i elasticsearch-oss-6.3.2.deb
|
|
|
|
|
|
|
|
# Configure a cluster name and answer on IP.
|
|
|
|
# Open firewall
|
|
|
|
# Allow elasticsearch
|
|
|
|
-A INPUT -p tcp --dport 9200 -j ACCEPT
|
|
|
|
-A INPUT -p tcp --dport 9300 -j ACCEPT
|
|
|
|
|
|
|
|
# Set up configuration:
|
|
|
|
vim /etc/elasticsearch/elasticsearch.yml
|
|
|
|
# Set:
|
|
|
|
cluster.name: elasticsearch
|
|
|
|
network.host: 10.22.22.124
|
|
|
|
|
|
|
|
# Start:
|
|
|
|
systemctl start elasticsearch.service
|
|
|
|
|
|
|
|
# Start on boot:
|
|
|
|
systemctl enable elasticsearch.service
|
|
|
|
|
|
|
|
### XXX Backups
|
|
|
|
### XXX Prometheus :)
|
|
|
|
|
|
|
|
##############################################################################
|