elasticsearch运行

1、报错

OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000085330000, 2060255232, 0) failed; error='Cannot allocate memory' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 2060255232 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /tmp/hs_err_pid1.log

原因是内存不足,修改elasticsearch的配置文件即可

2、解决方法

docker run -itd --privileged -p 9200:9200 -p 9300:9300 --name="es" -e ES_JAVA_OPTS="-Xms256m -Xmx256m" elasticsearch:5.6.12

3、测试

[root@controller ~]# curl 'http://localhost:9200/?pretty'
{
    
    
  "name" : "RHezJYn",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "rXYZfXdkRfG9M_oW2P7FpA",
  "version" : {
    
    
    "number" : "5.6.12",
    "build_hash" : "cfe3d9f",
    "build_date" : "2018-09-10T20:12:43.732Z",
    "build_snapshot" : false,
    "lucene_version" : "6.6.1"
  },
  "tagline" : "You Know, for Search"
}

猜你喜欢

转载自blog.csdn.net/qq_26884501/article/details/109189671