Elasticsearch安装学习记录

来源:互联网 发布:ubuntu pyqt5 编辑:程序博客网 时间:2024/05/20 01:10

Elasticsearch

搜索引擎解决方案 版本 elasticsearch 5.6

Author : Janloong Do_O

配置

elasticsearch.in.shexport JAVA_HOME=/usr/local/jdk8export JRE_HOME=/usr/local/jdk8/jreroot用户运行ES_JAVA_OPTS="-Des.insecure.allow.root=true"错误1如果这时报错"max virtual memory areas vm.maxmapcount [65530] is too low",运行当前生效$ sudo sysctl -w vm.max_map_count=262144修改文件/etc/sysctl.confvm.max_map_count= 262144执行命令sysctl -p错误2max file descriptors [65535] forelasticsearch process likely too low, increase to at least [65536]/etc/security/limits.conf,末尾增加如下内容soft nofile 65536hard nofile 65536max virtual memory或* - nofile65536* - memlock unlimited需要重启接触ip绑定限制 config/elasticsearch.ymlnetwork.host: 0.0.0.0

基础命令

查看当前节点的所有index$ curl -X GET 'http://localhost:9200/_cat/indices?v'新增index$ curl -X PUT 'localhost:9200/weather'删除一个index$ curl -X DELETE 'localhost:9200/weather'安装xpack后修改密码curl -XPUT -u elastic 'localhost:9200/_xpack/security/user/elastic/_password' -d '{  "password" : "elastic"}'

插件

中文分词器$ ./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v5.6.3/elasticsearch-analysis-ik-5.6.3.zip日志查看插件./bin/elasticsearch-plugin install mobz/elasticsearch-head

参考:

阮一峰elasticsearch

elasticsearch官方手册

原创粉丝点击