安装Elasticsearch(单节点Linux环境)

1 安装包下载

1)Elasticsearch官网: https://www.elastic.co/products/elasticsearch

 

2 安装Elasticsearch(单节点Linux环境)

1)解压elasticsearch-5.2.2.tar.gz到/opt/module目录下

[atguigu@hadoop102 software]$ tar -zxvf elasticsearch-5.2.2.tar.gz -C /opt/module/

2)在/opt/module/elasticsearch-5.2.2路径下创建datalogs文件夹

[atguigu@hadoop102 elasticsearch-5.2.2]$ mkdir data

[atguigu@hadoop102 elasticsearch-5.2.2]$ mkdir logs

3)修改配置文件/opt/module/elasticsearch-5.2.2/config/elasticsearch.yml

[atguigu@hadoop102 config]$ pwd

/opt/module/elasticsearch-5.2.2/config

[atguigu@hadoop102 config]$ vi elasticsearch.yml

# ---------------------------------- Cluster -----------------------------------

cluster.name: my-application

# ------------------------------------ Node ------------------------------------

node.name: node-102

# ----------------------------------- Paths ------------------------------------

path.data: /opt/module/elasticsearch-5.2.2/data

path.logs: /opt/module/elasticsearch-5.2.2/logs

# ----------------------------------- Memory -----------------------------------

bootstrap.memory_lock: false

bootstrap.system_call_filter: false

# ---------------------------------- Network -----------------------------------

network.host: 192.168.1.102

# --------------------------------- Discovery ----------------------------------

discovery.zen.ping.unicast.hosts: ["hadoop102"]

       (1)cluster.name

如果要配置集群需要两个节点上的elasticsearch配置的cluster.name相同,都启动可以自动组成集群,这里如果不改cluster.name则默认是cluster.name=my-application,

(2)nodename随意取但是集群内的各节点不能相同

3)修改后的每行前面不能有空格,修改后的“:”后面必须有一个空格

5)配置linux系统环境(参考:http://blog.csdn.net/satiling/article/details/59697916)

       (1)切换到root用户,编辑limits.conf 添加类似如下内容

[root@hadoop102 elasticsearch-5.2.2]# vi /etc/security/limits.conf

添加如下内容:

* soft nofile 65536

* hard nofile 131072

* soft nproc 2048

* hard nproc 4096

       (2)切换到root用户,进入limits.d目录下修改配置文件。

[root@hadoop102 elasticsearch-5.2.2]# vi /etc/security/limits.d/90-nproc.conf

修改如下内容:

* soft nproc 1024

#修改为

* soft nproc 2048

       (3)切换到root用户修改配置sysctl.conf

[root@hadoop102 elasticsearch-5.2.2]# vi /etc/sysctl.conf 

添加下面配置:

vm.max_map_count=655360

并执行命令:

[root@hadoop102 elasticsearch-5.2.2]# sysctl -p

然后,重新启动elasticsearch,即可启动成功。

6)启动集群

[atguigu@hadoop102 elasticsearch-5.2.2]$ bin/elasticsearch

7)测试集群

[atguigu@hadoop102 elasticsearch-5.2.2]$ curl http://hadoop102:9200

{

  "name" : "node-102",

  "cluster_name" : "my-application",

  "cluster_uuid" : "v-nwhc7ITsmVHECpNQYzHw",

  "version" : {

    "number" : "5.2.2",

    "build_hash" : "57e20f3",

    "build_date" : "2017-09-23T13:16:45.703Z",

    "build_snapshot" : false,

    "lucene_version" : "6.6.1"

  },

  "tagline" : "You Know, for Search"

}

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值