Elasticsearch 6.3.2安装

  • 下载地址
https://www.elastic.co/products/elasticsearch
  1. 上传elasticsearch-6.3.2.tar.gz移动到 /usr/local/upload 下
  2. 解压,移到/usr/local/
tar -zxvf elasticsearch-6.1.1.tar.gz
mv elasticsearch-6.1.1 /usr/local/upload
在/usr/local/elasticsearch-6.3.2/ 新建目录data
  • 从5.0开始,ElasticSearch 安全级别提高了,不允许采用root帐号启动,所以我们要添加一个用户。
  1. 创建bigdata 用户组
groupadd bigdata
  1. 创建用户es
useradd es
passwd es
  1. 将es用户添加到bigdata组
usermod -G bigdata es
  1. 设置sudo权限
visudo

找到root ALL=(ALL) ALL一行,添加es用户,如下。

## Allow root to run any commands anywhere
root    ALL=(ALL)       ALL
es      ALL=(ALL)       ALL
  1. 切换用户
[root@node1 ~]# su es
[es@node1 root]$ cd
[es@node1 ~]$ 
  • 修改目录权限, 更改elasticsearch-6.3.2文件夹以及内部文件的所属用户为es, 用户组组为bigdata,-R表示逐级(N层目录)
[es@iZbp1hb9k9jtcple1ncwjzZ /]$ sudo chown -R es:bigdata /opt/elasticsearch-6.3.2
[es@iZbp1hb9k9jtcple1ncwjzZ /]$ ll /usr/local/elasticsearch-6.3.2/
total 464
drwxr-xr-x  3 es bigdata   4096 Aug  2 14:59 bin
drwxr-xr-x  2 es bigdata   4096 Aug  2 15:11 config
drwxr-xr-x  2 es bigdata   4096 Aug  2 15:17 data
drwxr-xr-x  2 es bigdata   4096 Jul 20 13:26 lib
-rw-r--r--  1 es bigdata  13675 Jul 20 13:15 LICENSE.txt
drwxr-xr-x  2 es bigdata   4096 Jul 20 13:26 logs
drwxr-xr-x 17 es bigdata   4096 Jul 20 13:26 modules
-rw-r--r--  1 es bigdata 416018 Jul 20 13:26 NOTICE.txt
drwxr-xr-x  2 es bigdata   4096 Jul 20 13:26 plugins
-rw-r--r--  1 es bigdata   8511 Jul 20 13:15 README.textile
[es@iZbp1hb9k9jtcple1ncwjzZ /]$
  • ElasticSearch 配置
  1. 修改elasticsearch.yml
cluster.name: wdz-es
path.data: /usr/local/elasticsearch-6.3.2/data
path.logs: /usr/local/elasticsearch-6.3.2/logs
bootstrap.system_call_filter: false
network.host: 0.0.0.0
http.port: 9200
  1. 修改/etc/sysctl.conf
切换到root用户
vi /etc/sysctl.conf
添加下面的配置
vm.max_map_count=655360
命令生效
[es@iZbp1hb9k9jtcple1ncwjzZ /]# sysctl -p
  1. 修改文件/etc/security/limits.conf
根据服务器配置来设置(最下面)
# End of file
* soft nproc 1000000
* hard nproc 1000000
* soft nofile 1000000
* hard nofile 1000000
重新登录 生效
  1. 修改 vi /etc/security/limits.d/90-nproc.conf_bk
#*          soft    nproc     1024
root       soft    nproc     unlimited
  • 启动es
  1. 切换到es用户,进入es目录下
bin/elasticsearch

如果不报错Ctrl+C 退出,可以通过参数-d后台运行

bin/elasticsearch -d
  1. 进程查询
[es@iZbp1hb9k9jtcple1ncwjzZ elasticsearch-6.3.2]$ jps
6891 Jps
5117 Elasticsearch
  1. 验证
[es@iZbp1hb9k9jtcple1ncwjzZ elasticsearch-6.3.2]$ curl localhost:9200
{
  "name" : "kczazM0",
  "cluster_name" : "wdz-es",
  "cluster_uuid" : "SrQcvSF1SE6pj4BIGlccww",
  "version" : {
    "number" : "6.3.2",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "053779d",
    "build_date" : "2018-07-20T05:20:23.451332Z",
    "build_snapshot" : false,
    "lucene_version" : "7.3.1",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}

  1. 如果ps -aux|grep elasticsearch看不到Java进程
chown -R es:es /tmp/hsperfdata_es

转载于:https://my.oschina.net/aiweiqing/blog/2962327

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值