docker启动报错 library initialization failed - unable to allocate file descriptor table (core dumped),
一般情况是ulimit -n 句柄问题,首先在宿主机执行ulimit -n 查看具体数量,如果是1024则需要调大一些,我这里设置的值为65536。
在/etc/profile增加:
ulimit -n 65536
执行source /etc/profile
刷新配置
然后在启动容器时增加ulimit配置,我这里使用的是docker-compose,我的配置如下:
hbase:
image: hbase:2.4.15-slim
#下方为ulimit配置soft和hard的大小
ulimits:
nofile:
soft: 65536
hard: 65536
container_name: hbase
hostname: master
restart: always
logging:
driver: "json-file"
options:
max-size: "500m"
volumes:
- ${HBASEDATA}/hbase-data:/data/hbase-data
- ${HBASEDATA}/zookeeper-data:/data/zookeeper-data
environment:
- TZ=Asia/Shanghai
#使用root
privileged: true
修改之后清除之前容器,这一步很重要,然后重新启动容器即可。