docker容器启动报错/WARNING: IPv4 forwarding is disabled. Networking will not work或者启动elasticsearch7.4.0报错

docker容器启动报错/WARNING: IPv4 forwarding is disabled. Networking will not work或者启动elasticsearch7.4.0报错

1. docker容器启动报错WARNING: IPv4 forwarding is disabled. Networking will not work

解决方法

vim /etc/sysctl.conf

或者

vi /usr/lib/sysctl.d/00-system.conf

添加如下代码:

net.ipv4.ip_forward=1

重启network服务

systemctl restart network

查看是否修改成功

sysctl net.ipv4.ip_forward

如果返回为“net.ipv4.ip_forward = 1”则表示成功了 重启容器即可

2. 启动elasticsearch7.4.0报错

[root@lisongyu ~]# docker run -p 9200:9200 hub.c.163.com/library/elasticsearch:5.5.2  
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

原因:默认启动参数jvm内存设置是2g,而我的服务器只是一台1g运存的便宜货,所以需要手动修改参数
解决办法: 在启动参数中配置修改掉jvm的默认值

-e "ES_JAVA_OPTS=-Xms512m -Xmx512m"

原文地址:https://www.cnblogs.com/lisongyu/p/11427013.html
https://cloud.tencent.com/developer/article/1552661

docker容器启动报错/WARNING: IPv4 forwarding is disabled. Networking will not work或者启动elasticsearch7.4.0报错

上一篇:高并发场景下HTTP请求连接池


下一篇:ajax