ElasticSearch-5.21安装

环境
  • 操作系统:Centos 6.5 X64
  • IP地址:192.168.56.100
  • JDK 环境:
# java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

新建立用户:

# useradd elastic
# su - elastic
# mkdir ~/opt

接下来的操作都是使用elastic用户的opt/目录来进行操作。

下载安装

下载

下载地址:https://www.elastic.co/downloads/past-releases/elasticsearch-5-2-1

下载后解压

$ ls -l elasticsearch-5.2.1.zip
-rw-r--r--. 1 elastic elastic 33533234 Feb 15 14:24 elasticsearch-5.2.1.zip

$ unzip elasticsearch-5.2.1.zip

主要的文件及目录:

elasticsearch-5.2.1
├── bin/ #命令
│   ├── elasticsearch  #启动服务命令
│   ├── elasticsearch.in.sh
│   ├── elasticsearch-plugin
│   ├── elasticsearch-translog
├── config/ #配置目录
│   ├── elasticsearch.yml  #主要配置文件
│   ├── jvm.options
│   └── log4j2.properties
├── lib/
├── modules/
├── NOTICE.txt
├── plugins/  #插件目录
└── README.textile

安装

elasticsearch是开箱即用软件,解压完后,可以先试运行一次

$ cd ~/opt/elasticsearch-5.2.1
$ bin/elasticsearch
  ......

启动完后,可以在另一个终端查看运行情况:

$ curl -XGET "http://localhost:9200?pretty"
{
  "name" : "es-node-01",
  "cluster_name" : "es-cluster",
  "cluster_uuid" : "wDw2aF-1THGSCqvyq6KPNw",
  "version" : {
    "number" : "5.2.1",
    "build_hash" : "db0d481",
    "build_date" : "2017-02-09T22:05:32.386Z",
    "build_snapshot" : false,
    "lucene_version" : "6.4.1"
  },
  "tagline" : "You Know, for Search"
}
配置

elasticsearch 5.x版本后,需要配置才可以通过IP来进行访问,主要配置如下:

系统配置(root用户操作)

# cat >> /etc/security/limits.conf <EOF
* soft nofile 65536
* hard nofile 65536
EOF

# vim /etc/security/limits.d/90-nproc.conf
soft nproc 1024 =>修改为soft nproc 2048

# cat >> /etc/sysctl.conf <EOF
vm.max_map_count=655360
EOF

# sysctl -p

elasticsearch配置

修改配置文件~/opt/elasticsearch-5.2.1/config/elasticsearch.yml

cluster.name: "es-cluster"
node.name: "es-node-01"
node.master: true
node.data: true
http.enabled: true

network.host: 0.0.0.0
http.port: 9200
http.cors.enabled: true
http.cors.allow-origin: "*"

bootstrap.memory_lock: false
bootstrap.system_call_filter: false
启动

elasticsearch可以直接启动,也可以加上-b参数在后台启动

$ bin/elasticsearch -b
  ......

转载于:https://www.cnblogs.com/shrec/p/6439829.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值