Docker中启动mysql报错: Failed to get D-Bus connection

本文涉及的产品
云数据库 RDS MySQL Serverless,0.5-2RCU 50GB
简介:

docker版本:

[root@localhost ~]# docker versionClient:

 Version:         1.10.3

 API version:     1.22

 Package version: docker-common-1.10.3-46.el7.centos.10.x86_64

 Go version:      go1.6.3

 Git commit:      d381c64-unsupported

 Built:           Thu Aug  4 13:21:17 2016

 OS/Arch:         linux/amd64


Server:

 Version:         1.10.3

 API version:     1.22

 Package version: docker-common-1.10.3-46.el7.centos.10.x86_64

 Go version:      go1.6.3

 Git commit:      d381c64-unsupported

 Built:           Thu Aug  4 13:21:17 2016

 OS/Arch:         linux/amd64123456789101112131415161718

镜像版本


[root@b2ca5610d3da /]# cat /etc/redhat-releaseCentOS Linux release 7.2.1511 (Core) 12

    在docker中通过systemctl 启动服务的时候总是报Failed to get D-Bus connection: Operation not permitted 这样的错误提示。


[root@25d27693a24d ~]# systemctl start sshd

Failed to get D-Bus connection: Operation not permitted

    解决办法就是在docker run 的时候运行/usr/sbin/init 。比如:


[root@localhost /]# docker run -tid --name hadoopbase centos/hadoopbase:v001 /usr/sbin/init

    这样运行起来的container就可以使用systemctl来启动服务了,有的人说在CentOS7.2中解决了通过systemctl运行报错的问题,但是我在实际操作中还是遇到这样的问题。

    还有一种解决办法,就是在通过Dockerfile生成镜像文件的时候,通过CMD来执行/usr/sbin/init这条命令,即:CMD [ "/usr/sbin/init"];


本文转自 Mr_sheng 51CTO博客,原文链接:http://blog.51cto.com/sf1314/2057098


相关实践学习
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
关系型数据库 MySQL Docker
Docker - 运行 Mysql 容器后报错:[ERROR] --initialize specified but the data directory has files in it. Aborting.
Docker - 运行 Mysql 容器后报错:[ERROR] --initialize specified but the data directory has files in it. Aborting.
1177 0
Docker - 运行 Mysql 容器后报错:[ERROR] --initialize specified but the data directory has files in it. Aborting.
|
5月前
|
关系型数据库 MySQL Linux
DVWA CentOS Could not connect to the MySQL service. Please check the config file.
DVWA CentOS Could not connect to the MySQL service. Please check the config file.
37 0
|
5月前
|
关系型数据库 MySQL Linux
Linux下MySQL起动报错The server quit without updating PID file
Linux下MySQL起动报错The server quit without updating PID file
|
6月前
|
关系型数据库 MySQL Linux
suse系统mysql不能启动:Unit mysql.service failed to load: No such file or directory
suse系统mysql不能启动:Unit mysql.service failed to load: No such file or directory
|
域名解析 关系型数据库 MySQL
mysql中出现Unit mysql.service could not be found 的解决方法
mysql中出现Unit mysql.service could not be found 的解决方法
2894 1
|
关系型数据库 MySQL 数据库
mysql 安装失败 start service执行不下去
mysql 安装失败 start service执行不下去
142 0
|
关系型数据库 MySQL Linux
linux 安装mysql ERROR:Job for mysqld.service failed See “systemctl status mysqld.service”
linux 安装mysql ERROR:Job for mysqld.service failed See “systemctl status mysqld.service”
244 0
|
关系型数据库 MySQL
mysql启动提示unrecognized service错误
mysql启动提示unrecognized service错误
595 0
|
网络协议 网络安全 Android开发
ADB Server failed to start daemon * error: cannot connect to daemon
问题描述:Invalid argument: cannot open transport registration socketpair could not read ok from ADB Server failed to start daemon * error: cannot connect to daemon
539 0
|
关系型数据库 MySQL 数据安全/隐私保护
navicat 连接Docker中mysql容器报错:Client does not support authentication protocol requested by server;
navicat 连接Docker中mysql容器报错:Client does not support authentication protocol requested by server;
277 0
navicat 连接Docker中mysql容器报错:Client does not support authentication protocol requested by server;