博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Elasticsearch上遇到的部分问题及处理
阅读量:6151 次
发布时间:2019-06-21

本文共 4836 字,大约阅读时间需要 16 分钟。

hot3.png

elasticsearch-0.90.3/bin/plugin -install mobz/elasticsearch-head

上面的命令会把 elasticsearch-head插件装到你的环境里
访问http://192.168.40.105:9200/_plugin/head/

可以使用 curl 命令发送请求来查看 ES 是否接收到了数据:

# curl ‘

下载rpm包启动
# service elasticsearch start
Starting elasticsearch: Exception in thread "main" java.lang.IllegalStateException: Failed to created node environment
Likely root cause: java.nio.file.AccessDeniedException: /opt/data/bigdata/nodes
    at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
    at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384)
    at java.nio.file.Files.createDirectory(Files.java:674)
    at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781)
    at java.nio.file.Files.createDirectories(Files.java:767)
    at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:169)
    at org.elasticsearch.node.Node.<init>(Node.java:165)
    at org.elasticsearch.node.Node.<init>(Node.java:140)
    at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:143)
    at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:178)
    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:270)
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Refer to the log for complete error details.
                                                           [FAILED]
解决方法:
数据路径给Elasticsearch用户权限
chown -R elasticsearch.elasticsearch /opt/data
# service elasticsearch start
Starting elasticsearch:                                    [  OK  ]

Elasticsearch启动时报错:

[2017-04-17 19:18:08,835][WARN ][bootstrap                ] unable to install syscall filter: seccomp unavailable: CONFIG_SECCOMP not compiled into kernel, CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER are needed
[2017-04-17 19:18:08,842][WARN ][bootstrap                ] Unable to lock JVM Memory: error=12,reason=Cannot allocate memory
[2017-04-17 19:18:08,842][WARN ][bootstrap                ] This can result in part of the JVM being swapped out.
[2017-04-17 19:18:08,842][WARN ][bootstrap                ] Increase RLIMIT_MEMLOCK, soft limit: 65536, hard limit: 65536
[2017-04-17 19:18:08,842][WARN ][bootstrap                ] These can be adjusted by modifying /etc/security/limits.conf, for example:
    # allow user 'elasticsearch' mlockall
    elasticsearch soft memlock unlimited
    elasticsearch hard memlock unlimited
[2017-04-17 19:18:08,843][WARN ][bootstrap                ] If you are logged in interactively, you will have to re-login for the new limits to take effect.
[2017-04-17 19:18:09,112][INFO ][node                     ] [test5] version[2.3.4], pid[5058], build[e455fd0/2016-06-30T11:24:31Z]
[2017-04-17 19:18:09,112][INFO ][node                     ] [test5] initializing ...
[2017-04-17 19:18:10,541][INFO ][plugins                  ] [test5] modules [reindex, lang-expression, lang-groovy], plugins [bigdesk, head, kopf], sites [bigdesk, kopf, head]
[2017-04-17 19:18:10,574][INFO ][env                      ] [test5] using [1] data paths, mounts [[/ (/dev/mapper/vg_lvm-lv1)]], net usable_space [14.9gb], net total_space [19.5gb], spins? [possibly], types [ext4]
[2017-04-17 19:18:10,574][INFO ][env                      ] [test5] heap size [1.9gb], compressed ordinary object pointers [true]
[2017-04-17 19:18:14,021][INFO ][node                     ] [test5] initialized
[2017-04-17 19:18:14,028][INFO ][node                     ] [test5] starting ...
[2017-04-17 19:18:14,284][INFO ][transport                ] [test5] publish_address {192.168.40.105:9300}, bound_addresses {0.0.0.0:9300}
[2017-04-17 19:18:14,309][INFO ][discovery                ] [test5] bigdata/zJA8zeAdTQeyy7pSU8DJsA
[2017-04-17 19:18:17,446][INFO ][cluster.service          ] [test5] new_master {test5}{zJA8zeAdTQeyy7pSU8DJsA}{192.168.40.105}{192.168.40.105:9300}{data=false, master=true}, reason: zen-disco-join(elected_as_master, [0] joins received)
[2017-04-17 19:18:17,479][INFO ][http                     ] [test5] publish_address {192.168.40.105:9200}, bound_addresses {0.0.0.0:9200}
[2017-04-17 19:18:17,479][INFO ][node                     ] [test5] started
[2017-04-17 19:18:17,601][INFO ][gateway                  ] [test5] recovered [3] indices into cluster_state
解决方法:
[2017-04-17 19:23:06,291][WARN ][env                      ] [test5] max file descriptors [65535] for elasticsearch process likely too low, consider increasing to at least [65536]
错误解决:
/etc/security/limits.conf
。。。。。
# End of file
* soft nofile 65536
* hard nofile 65536
其他错误解决:
添加下面内容到/etc/security/limits.conf
# allow user 'elasticsearch' mlockall
elasticsearch soft memlock unlimited
elasticsearch hard memlock unlimited
下面这个WARN可以忽略
[2017-04-17 19:25:51,208][WARN ][bootstrap                ] unable to install syscall filter: seccomp unavailable: CONFIG_SECCOMP not compiled into kernel, CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER are needed

ES JVM配置文件为/etc/sysconfig/elasticsearch

JVM参数             Elasticsearch默认值        Environment变量

-Xms            256m                    ES_MIN_MEM
-Xmx            1g                        ES_MAX_MEM
-Xms and -Xmx                            ES_HEAP_SIZE
-Xmn                                    ES_HEAP_NEWSIZE
-XX:MaxDirectMemorySize                    ES_DIRECT_SIZE

elasticsearch文档

查询索引
#curl
#curl       # 查询Elasticsearch所有索引列表

转载于:https://my.oschina.net/u/1762991/blog/887799

你可能感兴趣的文章
DTCC2013:基于网络监听数据库安全审计
查看>>
CCNA考试要点大搜集(二)
查看>>
ajax查询数据库时数据无法更新的问题
查看>>
Kickstart 无人职守安装,终于搞定了。
查看>>
linux开源万岁
查看>>
linux/CentOS6忘记root密码解决办法
查看>>
25个常用的Linux iptables规则
查看>>
集中管理系统--puppet
查看>>
分布式事务最终一致性常用方案
查看>>
Exchange 2013 PowerShell配置文件
查看>>
JavaAPI详解系列(1):String类(1)
查看>>
HTML条件注释判断IE<!--[if IE]><!--[if lt IE 9]>
查看>>
发布和逸出-构造过程中使this引用逸出
查看>>
Oracle执行计划发生过变化的SQL语句脚本
查看>>
使用SanLock建立简单的HA服务
查看>>
发现一个叫阿尔法城的小站(以后此贴为我记录日常常用网址的帖子了)
查看>>
Subversion使用Redmine帐户验证简单应用、高级应用以及优化
查看>>
Javascript Ajax 异步请求
查看>>
DBCP连接池
查看>>
cannot run programing "db2"
查看>>