环境:
docker: 1.14.3
linux: centos 7.2+
maxwell:
docker.io/zendesk/maxwell latest 3d49624cf6dc 3 weeks ago 524 MB
复现好几次,本地正常(MAC环境),线上服务器异常
问题:
在linux 中docker启动maxwell 后一直提示异常:
/app/lib/ access deney
具体分析步骤:
执行: ` docker run -it --rm zendesk/maxwell bash ` 进入容器内部:
进行测试直接启动:/app/bin/maxwell -user='maxwell' --password='xxxxx' --host='xxxxxxxx' --producer=stdout 仍旧无法启动
执行:ls -alh /app/ 亦提示 权限不足
执行: ls -alh / 出现一串乱码? 用户角色权限异常;
具体如下:
maxwell@e6a1596e028b:~$ ls -alh /app/
ls: cannot access '/app/': Operation not permittedmaxwell@e6a1596e028b:/$ ls -alh
ls: cannot access 'srv': Operation not permitted
ls: cannot access 'mnt': Operation not permitted
ls: cannot access 'usr': Operation not permitted
ls: cannot access '..': Operation not permitted
ls: cannot access 'run': Operation not permitted
ls: cannot access 'home': Operation not permitted
ls: cannot access 'etc': Operation not permitted
ls: cannot access '.': Operation not permitted
ls: cannot access 'var': Operation not permitted
ls: cannot access 'tmp': Operation not permitted
ls: cannot access 'proc': Operation not permitted
ls: cannot access 'dev': Operation not permitted
ls: cannot access 'root': Operation not permitted
ls: cannot access 'sbin': Operation not permitted
ls: cannot access 'sys': Operation not permitted
ls: cannot access 'lib64': Operation not permitted
ls: cannot access 'opt': Operation not permitted
ls: cannot access 'bin': Operation not permitted
ls: cannot access 'media': Operation not permitted
ls: cannot access 'lib': Operation not permitted
ls: cannot access 'boot': Operation not permitted
ls: cannot access '.dockerenv': Operation not permitted
ls: cannot access 'REVISION': Operation not permitted
ls: cannot access 'app': Operation not permitted
total 0
d????????? ? ? ? ? ? .
d????????? ? ? ? ? ? ..
-????????? ? ? ? ? ? .dockerenv
-????????? ? ? ? ? ? REVISION
d????????? ? ? ? ? ? app
d????????? ? ? ? ? ? bin
d????????? ? ? ? ? ? boot
d????????? ? ? ? ? ? dev
d????????? ? ? ? ? ? etc
d????????? ? ? ? ? ? home
d????????? ? ? ? ? ? lib
d????????? ? ? ? ? ? lib64
d????????? ? ? ? ? ? media
d????????? ? ? ? ? ? mnt
d????????? ? ? ? ? ? opt
d????????? ? ? ? ? ? proc
d????????? ? ? ? ? ? root
d????????? ? ? ? ? ? run
d????????? ? ? ? ? ? sbin
d????????? ? ? ? ? ? srv
d????????? ? ? ? ? ? sys
d????????? ? ? ? ? ? tmp
d????????? ? ? ? ? ? usr
d????????? ? ? ? ? ? var
后尝试解决各种办法,其中最有效是升级系统docker版本:
基本步骤如下:
1、使用 root 权限用户登录 Centos系统(普通用户加sudo,此处是用root)
yum update (目的是确保 相关yum 包更新到最新)
2、旧版本进行卸载
yum remove docker docker-common docker-selinux docker-engine
3、安装需要的软件包
yum install -y yum-utils device-mapper-persistent-data lvm2
4、设置yum源
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
5、可以查看所有仓库中所有docker版本,并选择特定版本安装
yum list docker-ce --showduplicates | sort -r
6、安装docker
yum install docker-ce
7、启动并加入开机启动
systemctl start docker
systemctl enable docker
8、验证安装是否成功(有client和service两部分表示docker安装启动都成功了)
docker version
后正常启动恢复正常!