码迷,mamicode.com
首页 > 其他好文 > 详细

elasticsearch

时间:2017-11-22 13:10:08      阅读:133      评论:0      收藏:0      [点我收藏+]

标签:sys   security   you   tar   ack   star   proc   ocs   报错   

0.前提 jdk env

1.下载

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.1.zip   

2. 解压

unzip elasticsearch-5.5.1.zip

3. 运行

cd /usr/local/mydev/elasticsearch-5.5.1

./bin/elasticsearch

3.1 报错如下

org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root

解决方法

groupadd test

useradd test -g test -p mypassword

chown -R test:test /usr/local/mydev/elasticsearch-5.5.1

su test #switch to user test, run again

 3.2 报错如下

  max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

解决方法:

su -  #切换到root

vi  /etc/sysctl.conf

vm.max_map_count=655360# 添加该行

 sysctl -p#退出在执行

3.2 报错如下

max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

vi /etc/security/limits.conf

#rocky dev is username , * equals all
 dev            soft    nofile          65536
 dev            hard    nofile          65536

#再切换回dev

4. 另起一个窗口

[rocky@dev_pc1 ~]$ curl localhost:9200
{
  "name" : "426eH55",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "KX_7vn6iS06pHfhpKh1qDQ",
  "version" : {
    "number" : "5.5.1",
    "build_hash" : "19c13d0",
    "build_date" : "2017-07-18T20:44:24.823Z",
    "build_snapshot" : false,
    "lucene_version" : "6.6.0"
  },
  "tagline" : "You Know, for Search"
}

5. Index

5.1 查看当前节点的所有Index

[rocky@dev_pc1 ~]$ curl -X GET ‘http://localhost:9200/_cat/indices?v‘
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size

5.2 新建名叫weather的Index 使用put方式

[rocky@dev_pc1 ~]$ curl -X PUT  ‘localhost:9200/weather‘
{"acknowledged":true,"shards_acknowledged":true}

5.3 删除这个weather

[rocky@dev_pc1 ~]$ curl -X DELETE ‘localhost:9200/weather‘
{"acknowledged":true}

 

elasticsearch

标签:sys   security   you   tar   ack   star   proc   ocs   报错   

原文地址:http://www.cnblogs.com/rocky-fang/p/7872234.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!