-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathes-cd.sh
More file actions
35 lines (28 loc) · 1.12 KB
/
es-cd.sh
File metadata and controls
35 lines (28 loc) · 1.12 KB
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
#!/bin/bash
# author: Martin Liu
# url:martinliu.cn
#指定安装的版本
elastic_version='7.9.1'
#开始安装流程
echo "Provisioning a Elasticsearch "$elastic_version" Server..."
sudo date > /etc/vagrant_provisioned_at
#配置 ES 需要的操作系统参数
sudo swapoff -a
sudo sysctl -w vm.max_map_count=262144
sudo sysctl -p
sudo sh -c "echo 'elasticsearch - nofile 65535' >> /etc/security/limits.conf"
#设置个性化 SSH 登录提示信息
sudo sh -c "echo '**** -- -- -- -- -- -- -- -- ****' > /etc/motd"
sudo sh -c "echo '**** Welcome to Elastic Stack Labs' >> /etc/motd"
sudo sh -c "echo '**** -- -- -- -- -- -- -- -- ****' >> /etc/motd"
sudo sh -c "echo '*' >> /etc/motd"
#安装 ES 软件包
sudo rpm -ivh /vagrant/rpm/elasticsearch-$elastic_version-x86_64.rpm
#更新 ES 默认的配置文件
#sudo cp /vagrant/jvm.options.256m /etc/elasticsearch/jvm.options
sudo cp /vagrant/es-cd.yml /etc/elasticsearch/elasticsearch.yml
#配置和启动 ES 系统服务
sudo systemctl daemon-reload
sudo systemctl enable elasticsearch.service
sudo systemctl start elasticsearch.service
sudo systemctl status elasticsearch