bootstrap.memory_lock: true导致Elasticsearch启动失败问题

elasticsearch官网建议生产环境需要设置bootstrap.memory_lock: true

重新启动elasticsearch,报错信息如下:

[baoshan@test-43.dev.rokid-inc.com /home/baoshan/elk/elasticsearch-5.3.0]
$bin/elasticsearch
[2017-04-20T21:45:36,741][WARN ][o.e.b.JNANatives ] Unable to lock JVM Memory: error=12, reason=无法分配内存
[2017-04-20T21:45:36,746][WARN ][o.e.b.JNANatives ] This can result in part of the JVM being swapped out.
[2017-04-20T21:45:36,746][WARN ][o.e.b.JNANatives ] Increase RLIMIT_MEMLOCK, soft limit: 65536, hard limit: 65536
[2017-04-20T21:45:36,747][WARN ][o.e.b.JNANatives ] These can be adjusted by modifying /etc/security/limits.conf, for example:
# allow user 'baoshan' mlockall
baoshan soft memlock unlimited
baoshan hard memlock unlimited
[2017-04-20T21:45:36,747][WARN ][o.e.b.JNANatives ] If you are logged in interactively, you will have to re-login for the new limits to take effect.
[2017-04-20T21:45:37,057][INFO ][o.e.n.Node ] [node-43] initializing ...
[2017-04-20T21:45:37,584][INFO ][o.e.e.NodeEnvironment ] [node-43] using [1] data paths, mounts [[/ (/dev/mapper/vg_root-lv_root)]], net usable_space [39.6gb], net total_space [44.7gb], spins? [possibly], types [ext4]
[2017-04-20T21:45:37,585][INFO ][o.e.e.NodeEnvironment ] [node-43] heap size [1.9gb], compressed ordinary object pointers [unknown]
[2017-04-20T21:45:37,587][INFO ][o.e.n.Node ] [node-43] node name [node-43], node ID [oUSfip81Sc-SGtZP9GCydg]
[2017-04-20T21:45:37,588][INFO ][o.e.n.Node ] [node-43] version[5.3.0], pid[5150], build[3adb13b/2017-03-23T03:31:50.652Z], OS[Linux/2.6.32-504.el6.x86_64/i386], JVM[Oracle Corporation/Java HotSpot(TM) Server VM/1.8.0_121/25.121-b13]
[2017-04-20T21:45:39,914][INFO ][o.e.p.PluginsService ] [node-43] loaded module [aggs-matrix-stats]
[2017-04-20T21:45:39,915][INFO ][o.e.p.PluginsService ] [node-43] loaded module [ingest-common]
[2017-04-20T21:45:39,916][INFO ][o.e.p.PluginsService ] [node-43] loaded module [lang-expression]
[2017-04-20T21:45:39,916][INFO ][o.e.p.PluginsService ] [node-43] loaded module [lang-groovy]
[2017-04-20T21:45:39,916][INFO ][o.e.p.PluginsService ] [node-43] loaded module [lang-mustache]
[2017-04-20T21:45:39,916][INFO ][o.e.p.PluginsService ] [node-43] loaded module [lang-painless]
[2017-04-20T21:45:39,917][INFO ][o.e.p.PluginsService ] [node-43] loaded module [percolator]
[2017-04-20T21:45:39,917][INFO ][o.e.p.PluginsService ] [node-43] loaded module [reindex]
[2017-04-20T21:45:39,917][INFO ][o.e.p.PluginsService ] [node-43] loaded module [transport-netty3]
[2017-04-20T21:45:39,917][INFO ][o.e.p.PluginsService ] [node-43] loaded module [transport-netty4]
[2017-04-20T21:45:39,919][INFO ][o.e.p.PluginsService ] [node-43] no plugins loaded
[2017-04-20T21:45:42,143][INFO ][o.e.n.Node ] [node-43] initialized
[2017-04-20T21:45:42,150][INFO ][o.e.n.Node ] [node-43] starting ...
[2017-04-20T21:45:42,282][WARN ][i.n.u.i.MacAddressUtil ] Failed to find a usable hardware address from the network interfaces; using random bytes: 5b:5f:0c:d6:78:e5:0b:ec
[2017-04-20T21:45:42,381][INFO ][o.e.t.TransportService ] [node-43] publish_address {10.88.128.88:9300}, bound_addresses {10.88.128.88:9300}
[2017-04-20T21:45:42,395][INFO ][o.e.b.BootstrapChecks ] [node-43] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
ERROR: bootstrap checks failed
memory locking requested for elasticsearch process but memory is not locked
[2017-04-20T21:45:42,430][INFO ][o.e.n.Node ] [node-43] stopping ...
[2017-04-20T21:45:42,500][INFO ][o.e.n.Node ] [node-43] stopped
[2017-04-20T21:45:42,500][INFO ][o.e.n.Node ] [node-43] closing ...
[2017-04-20T21:45:42,525][INFO ][o.e.n.Node ] [node-43] closed

 

解决办法如下:

需要修改
/etc/security/limits.conf
baoshan soft memlock unlimited
baoshan hard memlock unlimited

修改:
/etc/sysctl.conf
vm.swappiness=0

之后重启机器

 

再次启动elasticsearch,成功,信息如下:

[baoshan@test-43.dev.rokid-inc.com /home/baoshan/elk/elasticsearch-5.3.0]
$bin/elasticsearch
[2017-04-20T21:49:34,755][INFO ][o.e.n.Node ] [node-43] initializing ...
[2017-04-20T21:49:35,168][INFO ][o.e.e.NodeEnvironment ] [node-43] using [1] data paths, mounts [[/ (/dev/mapper/vg_root-lv_root)]], net usable_space [39.6gb], net total_space [44.7gb], spins? [possibly], types [ext4]
[2017-04-20T21:49:35,170][INFO ][o.e.e.NodeEnvironment ] [node-43] heap size [1.9gb], compressed ordinary object pointers [unknown]
[2017-04-20T21:49:35,176][INFO ][o.e.n.Node ] [node-43] node name [node-43], node ID [oUSfip81Sc-SGtZP9GCydg]
[2017-04-20T21:49:35,178][INFO ][o.e.n.Node ] [node-43] version[5.3.0], pid[1208], build[3adb13b/2017-03-23T03:31:50.652Z], OS[Linux/2.6.32-504.el6.x86_64/i386], JVM[Oracle Corporation/Java HotSpot(TM) Server VM/1.8.0_121/25.121-b13]
[2017-04-20T21:49:38,647][INFO ][o.e.p.PluginsService ] [node-43] loaded module [aggs-matrix-stats]
[2017-04-20T21:49:38,647][INFO ][o.e.p.PluginsService ] [node-43] loaded module [ingest-common]
[2017-04-20T21:49:38,647][INFO ][o.e.p.PluginsService ] [node-43] loaded module [lang-expression]
[2017-04-20T21:49:38,648][INFO ][o.e.p.PluginsService ] [node-43] loaded module [lang-groovy]
[2017-04-20T21:49:38,648][INFO ][o.e.p.PluginsService ] [node-43] loaded module [lang-mustache]
[2017-04-20T21:49:38,648][INFO ][o.e.p.PluginsService ] [node-43] loaded module [lang-painless]
[2017-04-20T21:49:38,649][INFO ][o.e.p.PluginsService ] [node-43] loaded module [percolator]
[2017-04-20T21:49:38,650][INFO ][o.e.p.PluginsService ] [node-43] loaded module [reindex]
[2017-04-20T21:49:38,650][INFO ][o.e.p.PluginsService ] [node-43] loaded module [transport-netty3]
[2017-04-20T21:49:38,650][INFO ][o.e.p.PluginsService ] [node-43] loaded module [transport-netty4]
[2017-04-20T21:49:38,652][INFO ][o.e.p.PluginsService ] [node-43] no plugins loaded
[2017-04-20T21:49:43,478][INFO ][o.e.n.Node ] [node-43] initialized
[2017-04-20T21:49:43,478][INFO ][o.e.n.Node ] [node-43] starting ...
[2017-04-20T21:49:43,650][WARN ][i.n.u.i.MacAddressUtil ] Failed to find a usable hardware address from the network interfaces; using random bytes: 5d:dc:90:e8:b1:e1:50:72
[2017-04-20T21:49:43,858][INFO ][o.e.t.TransportService ] [node-43] publish_address {10.88.128.88:9300}, bound_addresses {10.88.128.88:9300}
[2017-04-20T21:49:43,872][INFO ][o.e.b.BootstrapChecks ] [node-43] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
[2017-04-20T21:50:13,896][WARN ][o.e.n.Node ] [node-43] timed out while waiting for initial discovery state - timeout: 30s
[2017-04-20T21:50:13,935][INFO ][o.e.h.n.Netty4HttpServerTransport] [node-43] publish_address {10.88.128.88:9200}, bound_addresses {10.88.128.88:9200}
[2017-04-20T21:50:13,950][INFO ][o.e.n.Node ] [node-43] started


OK,搞定!

请移除邮件后完整的发给我 我直接复制进去 services: onlyoffice-mysql-server: container_name: onlyoffice-mysql-server image: mysql:8.0.29 environment: - MYSQL_ROOT_PASSWORD=my-secret-pw networks: - onlyoffice stdin_open: true tty: true restart: always volumes: - ./config/mysql/conf.d:/etc/mysql/conf.d - ./config/mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d - mysql_data:/var/lib/mysql onlyoffice-community-server: container_name: onlyoffice-community-server image: onlyoffice/communityserver:12.6.0.1900 depends_on: - onlyoffice-mysql-server - onlyoffice-document-server - onlyoffice-mail-server - onlyoffice-elasticsearch environment: - ONLYOFFICE_CORE_MACHINEKEY=core_secret - CONTROL_PANEL_PORT_80_TCP=80 - CONTROL_PANEL_PORT_80_TCP_ADDR=onlyoffice-control-panel - DOCUMENT_SERVER_PORT_80_TCP_ADDR=onlyoffice-document-server - DOCUMENT_SERVER_JWT_ENABLED=true - DOCUMENT_SERVER_JWT_SECRET=jwt_secret - DOCUMENT_SERVER_JWT_HEADER=AuthorizationJwt - MYSQL_SERVER_ROOT_PASSWORD=my-secret-pw - MYSQL_SERVER_DB_NAME=onlyoffice - MYSQL_SERVER_HOST=onlyoffice-mysql-server - MYSQL_SERVER_USER=onlyoffice_user - MYSQL_SERVER_PASS=onlyoffice_pass - MAIL_SERVER_API_PORT=8081 - MAIL_SERVER_API_HOST=onlyoffice-mail-server - MAIL_SERVER_DB_HOST=onlyoffice-mysql-server - MAIL_SERVER_DB_PORT=3306 - MAIL_SERVER_DB_NAME=onlyoffice_mailserver - MAIL_SERVER_DB_USER=mail_admin - MAIL_SERVER_DB_PASS=Isadmin123 - ELASTICSEARCH_SERVER_HOST=onlyoffice-elasticsearch - ELASTICSEARCH_SERVER_HTTPPORT=9200 networks: - onlyoffice ports: - '80:80' - '443:443' - '5222:5222' stdin_open: true tty: true restart: always privileged: true cgroup: host volumes: - community_data:/var/www/onlyoffice/Data - community_log:/var/log/onlyoffice - community_letsencrypt:/etc/letsencrypt - document_data:/var/www/onlyoffice/DocumentServerData - /sys/fs/cgroup:/sys/fs/cgroup:rw - ./certs:/var/www/onlyoffice/Data/certs onlyoffice-elasticsearch: image: onlyoffice/elasticsearch:7.16.3 container_name: onlyoffice-elasticsearch restart: always environment: - discovery.type=single-node - bootstrap.memory_lock=true - "ES_JAVA_OPTS=-Xms1g -Xmx1g -Dlog4j2.formatMsgNoLookups=true" - "indices.fielddata.cache.size=30%" - "indices.memory.index_buffer_size=30%" - "ingest.geoip.downloader.enabled=false" networks: - onlyoffice ulimits: memlock: soft: -1 hard: -1 nofile: soft: 65535 hard: 65535 volumes: - es_data:/usr/share/elasticsearch/data expose: - "9200" - "9300" onlyoffice-document-server: container_name: onlyoffice-document-server image: onlyoffice/documentserver:8.1 stdin_open: true tty: true restart: always environment: - JWT_ENABLED=true - JWT_SECRET=jwt_secret - JWT_HEADER=AuthorizationJwt networks: - onlyoffice expose: - '80' - '443' volumes: - document_data:/var/www/onlyoffice/Data - document_log:/var/log/onlyoffice - ./document_fonts:/usr/share/fonts/truetype/custom - document_forgotten:/var/lib/onlyoffice/documentserver/App_Data/cache/files/forgotten onlyoffice-mail-server: container_name: onlyoffice-mail-server image: onlyoffice/mailserver:1.6.75 depends_on: - onlyoffice-mysql-server hostname: ${MAIL_SERVER_HOSTNAME} environment: - MYSQL_SERVER=onlyoffice-mysql-server - MYSQL_SERVER_PORT=3306 - MYSQL_ROOT_USER=mail_admin - MYSQL_ROOT_PASSWD=Isadmin123 - MYSQL_SERVER_DB_NAME=onlyoffice_mailserver networks: - onlyoffice restart: always privileged: true ports: ['25:25','143:143','587:587'] stdin_open: true tty: true expose: - '8081' - '3306' volumes: - mail_data:/var/vmail - mail_certs:/etc/pki/tls/mailserver - mail_log:/var/log onlyoffice-control-panel: container_name: onlyoffice-control-panel depends_on: - onlyoffice-document-server - onlyoffice-mail-server - onlyoffice-community-server image: onlyoffice/controlpanel:3.5.2.530 environment: - ONLYOFFICE_CORE_MACHINEKEY=core_secret expose: - '80' - '443' restart: always volumes: - /var/run/docker.sock:/var/run/docker.sock - controlpanel_data:/var/www/onlyoffice/Data - controlpanel_log:/var/log/onlyoffice networks: - onlyoffice stdin_open: true tty: true networks: onlyoffice: driver: 'bridge' volumes: mail_data: mail_certs: mail_log: mail_mysql: document_data: document_log: document_forgotten: community_mysql: community_data: community_log: community_letsencrypt: controlpanel_data: controlpanel_log: mysql_data: es_data:
最新发布
07-21
# ======================== Elasticsearch Configuration ========================= # # NOTE: Elasticsearch comes with reasonable defaults for most settings. # Before you set out to tweak and tune the configuration, make sure you # understand what are you trying to accomplish and the consequences. # # The primary way of configuring a node is via this file. This template lists # the most important settings you may want to configure for a production cluster. # # Please consult the documentation for further information on configuration options: # https://www.elastic.co/guide/en/elasticsearch/reference/index.html # # ---------------------------------- Cluster ----------------------------------- # # Use a descriptive name for your cluster: # cluster.name: MyES # # ------------------------------------ Node ------------------------------------ # # Use a descriptive name for the node: node.name: master node.master: true node.data: true # # Add custom attributes to the node: # #node.attr.rack: r1 # # ----------------------------------- Paths ------------------------------------ # # Path to directory where to store the data (separate multiple locations by comma): # path.data: /var/lib/elasticsearch # # Path to log files: # path.logs: /var/log/elasticsearch # # ----------------------------------- Memory ----------------------------------- # # Lock the memory on startup: # #bootstrap.memory_lock: true # # Make sure that the heap size is set to about half the memory available # on the system and that the owner of the process is allowed to use this # limit. # bootstrap.memory_lock: false bootstrap.system_call_filter: false # Elasticsearch performs poorly when the system is swapping the memory. # # ---------------------------------- Network ----------------------------------- # # Set the bind address to a specific IP (IPv4 or IPv6): # network.host: 192.168.100.130 # # Set a custom port for HTTP: # http.port: 9200 http.cors.enabled: true http.cors.allow-origin: "*" # # For more information, consult the network module documentation. # # --------------------------------- Discovery ---------------------------------- # # Pass an initial list of hosts to perform discovery when new node is started: # The default list of hosts is ["127.0.0.1", "[::1]"] # #discovery.zen.ping.unicast.hosts: ["host1", "host2"] discovery.zen.ping.unicast.hosts: ["192.168.100.130", "192.168.100.131","192.168.100.132"] # Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1): discovery.zen.minimum_master_nodes: 3 #discovery.zen.minimum_master_nodes: # # For more information, consult the zen discovery module documentation. # # ---------------------------------- Gateway ----------------------------------- # # Block initial recovery after a full cluster restart until N nodes are started: # #gateway.recover_after_nodes: 3 # # For more information, consult the gateway module documentation. # # ---------------------------------- Various ----------------------------------- # # Require explicit names when deleting indices: # #action.destructive_requires_name: true 这是我的master里的配置,请帮我配置slave1和slave2
05-23
uncaught exception in thread [main] java.lang.IllegalArgumentException: unknown setting [X-Packhttp.cors.enabled] did you mean [http.cors.enabled]? at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:561) at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:507) at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:477) at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:447) at org.elasticsearch.common.settings.SettingsModule.<init>(SettingsModule.java:137) at org.elasticsearch.node.Node.<init>(Node.java:502) at org.elasticsearch.node.Node.<init>(Node.java:309) at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:234) at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:234) at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:434) at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:166) at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:157) at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:77) at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:112) at org.elasticsearch.cli.Command.main(Command.java:77) at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:122) at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80) For complete error details, refer to the log at /root/elasticsearch-7.17.0/logs/my-application.log
06-11
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值