ElasticSearch7.1.1安装

规划:三台机器 两台选主
10.231.132.XX: master
10.231.132.XX: data
10.231.132.XX: master

手动下载安装
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.1.1-x86_64.rpm
rpm -ivh elasticsearch-7.1.1-x86_64.rpm
自动创建 elasticsearch用户及elasticsearch用户组
passwd elasticsearch
chown -R elasticsearch:elasticsearch elasticsearch #修改文件所属用户为elasticsearch,所属用户组为elasticsearch

加入服务到Linux

sudo systemctl daemon-reload
sudo systemctl enable elasticsearch.service
sudo systemctl start elasticsearch.service

–安装之前系统参数设置:

vim /etc/security/limits.conf

* soft nofile 100000  #可打开的文件句柄的最大数
* hard nofile 100000  #soft:软限制、hard:硬限制
* soft nproc 4096     #单个用户可用的最大进程数量
* hard nproc 4096
* soft memlock unlimited #可打开的文件描述符的最大数
* hard memlock unlimited #unlimited:无限制

vim /etc/sysctl.conf


net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv4.ip_local_port_range = 1024 65000
fs.file-max = 100000
vm.max_map_count = 262144  #JVM能开启的最大线程数
#vm.swappiness = 0   # 禁用 swap
//运行 sysctl -p 使修改的内核参数生效

创建自定义的目录,不使用默认的数据目录:

mkdir -p /data/elasticsearch
chown -R elasticsearch:elasticsearch /data/elasticsearch/

– 文件配置:
vi /etc/elasticsearch/elasticsearch.yml

cluster.name: ES_cluster
node.name: node0
node.master: true
node.data: false
node.ingest: false
path.data: /data/elasticsearch/data
path.logs: /data/elasticsearch/log
bootstrap.memory_lock: true
network.host: 10.231.132.XX
http.port: 9200
transport.tcp.port: 9300
discovery.seed_hosts: ["10.231.132.XX","10.231.132.XX","10.231.132.XX"]
cluster.initial_master_nodes: ["10.231.132.XX"] 

– ES的内存设置:默认只有1G 其他的默认即可
vim /etc/elasticsearch/jvm.options
-Xms4g
-Xmx4g

–启动
/use/share/elasticsearch/bin/elasticsearch &
启动找不到jdk( /etc/sysconfig/elasticsearch 指定jdk路径)
访问http://10.X.X.XX:9200/
http://10.X.X.X:9200/_cat/nodes

–配置IK分词器(https://github.com/medcl/elasticsearch-analysis-ik)
切换elasticsearch用户
更改目录权限
chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/

 ./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.1.1/elasticsearch-analysis-ik-7.1.1.zip
-> Downloading https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.1.1/elasticsearch-analysis-ik-7.1.1.zip
[=================================================] 100%   
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@     WARNING: plugin requires additional permissions     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
* java.net.SocketPermission * connect,resolve
See http://docs.oracle.com/javase/8/docs/technotes/guides/security/permissions.html
for descriptions of what these permissions allow and the associated risks.

Continue with installation? [y/N]y
-> Installed analysis-ik```
重启 OK
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值