-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
executable file
·51 lines (40 loc) · 1.66 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
# ES data will be stored in the home partition,
# where the OS associate all available disk space:
# - for the ES data: /home/data/elasticsearch
# - for the ES log: /home/data/log
# Firewall settings
firewall-cmd --permanent --add-port=9200/tcp
firewall-cmd --permanent --add-port=9300/tcp
firewall-cmd --reload
# ES init
echo 'elasticsearch - nofile 65536' >> /etc/security/limits.conf
echo 'elasticsearch - nproc 4096' >> /etc/security/limits.conf
echo 'elasticsearch soft memlock unlimited' >> /etc/security/limits.conf
echo 'elasticsearch hard memlock unlimited' >> /etc/security/limits.conf
# ES Installation
yum -y install elasticsearch
# App as service with auto startup
chkconfig --add elasticsearch
systemctl daemon-reload
systemctl enable elasticsearch.service
# Tuning (specific to lock memory)
echo 'MAX_OPEN_FILES=65536' >> /etc/sysconfig/elasticsearch
echo 'MAX_LOCKED_MEMORY=unlimited' >> /etc/sysconfig/elasticsearch
echo 'MAX_MAP_COUNT=262144' >> /etc/sysconfig/elasticsearch
# Copy specific files
echo "Thanks to copy/paste the necessary file according to your setup/env/node..."
mv /etc/elasticsearch/elasticsearch.yml /etc/elasticsearch/elasticsearch.yml.orig
echo "cp ./elasticsearch_XXX_X.yml /etc/elasticsearch/elasticsearch.yml"
read
mv /etc/elasticsearch/jvm.options /etc/elasticsearch/jvm.options.orig
cp ./jvm.options /etc/elasticsearch/jvm.options
# Start the app
systemctl start elasticsearch.service && tail -f /var/log/elasticsearch/*log
# Curator install
yum -y install elasticsearch-curator
# Curator
cp -fr curator /root/.curator
curator cdr_cmr
echo "todo: curator conf"
exit 0