error: failed to connect to the hypervisor error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory 解决办法
服务器版本:CentOS Linux release 7.4
Linux lb 3.10.0-693.el7.x86_64 #1 SMP Tue Aug 22 21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
参考:https://www.cnblogs.com/yogurtwu/p/9988974.html
注:在翻了很多baidu和google相关文章后,逐步排查,根据手动执行libvirtd命令出现的报错信息才查到解决方法。一路坑。
对装有kvm虚拟机的服务器执行了安装libguestfs-tools后,发现出现了故障。
执行virsh list命令后会报以下错误:

virsh list
error: failed to connect to the hypervisor
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory
执行systemctl status libvirtd后报错:

● libvirtd.service - Virtualization daemon
Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)
Active: failed (Result: start-limit) since Tue 2019-03-19 16:44:52 CST; 49min ago
Docs: man:libvirtd(8)
https://libvirt.org
Process: 21280 ExecStart=/usr/sbin/libvirtd $LIBVIRTD_ARGS (code=exited, status=3)
Main PID: 21280 (code=exited, status=3)
Tasks: 2 (limit: 32768)
CGroup: /system.slice/libvirtd.service
├─1007 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper
└─1008 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper
Mar 19 16:44:52 develop systemd[1]: Failed to start Virtualization daemon.
Mar 19 16:44:52 develop systemd[1]: Unit libvirtd.service entered failed state.
Mar 19 16:44:52 develop systemd[1]: libvirtd.service failed.
Mar 19 16:44:52 develop systemd[1]: libvirtd.service holdoff time over, scheduling restart.
Mar 19 16:44:52 develop systemd[1]: Stopped Virtualization daemon.
Mar 19 16:44:52 develop systemd[1]: start request repeated too quickly for libvirtd.service
Mar 19 16:44:52 develop systemd[1]: Failed to start Virtualization daemon.
Mar 19 16:44:52 develop systemd[1]: Unit libvirtd.service entered failed state.
Mar 19 16:44:52 develop systemd[1]: libvirtd.service failed.
执行systemctl restart libvirtd后报错:

Job for libvirtd.service failed because start of the service was attempted too often. See "systemctl status libvirtd.service" and "journalctl -xe" for details.
To force a start use "systemctl reset-failed libvirtd.service" followed by "systemctl start libvirtd.service" again.
原因:
因为依赖安装了某些包(比如libguestfs-tools)后,跟着KVM相关的软件也跟着升级,但是CentOS7.4无法运行这个版本的libvirt,最简单粗暴的做法就是移除该模块,重启libvirtd。
解决办法:
mv /usr/lib64/libvirt/storage-backend/libvirt_storage_backend_rbd.so /usr/lib64/libvirt/storage-backend/libvirt_storage_backend_rbd.so-bak
systemctl restart libvirtd
再次执行virsh list,正常了:


error: failed to connect to the hypervisor error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory 解决办法的更多相关文章
- rpm: error while loading shared libraries: libgcc_s.so.1: cannot open shared object file: No such file or directory解决办法
不多说,直接上干货! 问题详情 [root@bigdatamaster app]# rpm -qa | grep gcc rpm: error : cannot open shared object ...
- iis服务器php环境 failed to open stream: No such file or directory解决办法
项目主机用的windows系统,iis服务器:远程连接桌面—>本地资源->映射D盘驱动器,将本地d盘修改后的文件放在远程主机项目目录里,访问报出failed to open stream: ...
- ././include/linux/kconfig.h:4:32: fatal error: generated/autoconf.h: No such file or directory 解决办法
我在编写内核驱动模块的时候报了一个非常奇怪的错误,如下图: 在目录下看了一下确实没有发现这个文件,感觉很奇怪,因为我记得之前编译模块是没有错误的,所以不可能是我代码写的有问题. 查阅了资料很多说要清除 ...
- command ' cl.exe' failed: No such file or directory解决办法
1.安装C ++编译器 https://pan.baidu.com/s/1D1-tM-mWO4TVLdTrh3k1GA 提取码:ym67 2.找到安装文件夹:Visual C++ Build T ...
- 解决:error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
在使用 deamon@deamon-H55M-S2:/usr/bin$ mysqladmin -u root -p shutdown 关闭MySQL之后试图通过: deamon@deamon-H55M ...
- mysql之ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'解决方法
LAMPP安装完成之后,mysql -u root -p连不上,报这个错误: ERROR 2002 (HY000): Can't connect to local MySQL server throu ...
- 【error】: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
错误描述如下: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) ...
- ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)-mysql.sock丢失解决方案
我们的LAMP是搭建在UBUNTU 12.04 LTS上的. LAMP是通过编译的方式进来安装的. 在一次处理意外挂机时由于未知的原因在重启后发现无法连接数据库了, 在打开网站时出现如下的的提示: E ...
- Running MYSQL 5.7 By Bash On Ubuntu On Windows:ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
root@PC-RENGUOQIANG:/usr/sbin# /etc/init.d/mysql start * Starting MySQL database server mysqld [ OK ...
随机推荐
- DB2分页查询简单示例
select * from ( select a.* ,rownumber() over(order by create_time desc) as rowid from ( select * fro ...
- bootstrap中的data-toggle模态框相关
一,点击即打开1,点击按钮 <a href="javascript:void(0)" class="btn btn-primary" data-toggl ...
- 记事本APP之Alpha报告
项目名称 记事本APP 项目版本 Alpha版本 负责人 北京航空航天大学计算机学院 Echo软件团队 联系方式 http://www.cnblogs.com/echo-buaa/ 要求发布日期 20 ...
- Task 6.2冲刺会议四 /2015-5-17
今天主要是学习并熟悉了C#的开发流程,把他的文件的大体结构和每个组件之间的联系弄清楚之后.开始写服务器部分的内容.学习过程中,感觉网上的资料有些太鱼龙混杂了,不知道该怎么取舍.明天准备完善服务器的功能 ...
- HDU 1015 Jury Compromise 01背包
题目链接: http://poj.org/problem?id=1015 Jury Compromise Time Limit: 1000MSMemory Limit: 65536K 问题描述 In ...
- mac下面安装redis
本文只记录了在homebrew下面安装redis的过程,过程比较简单,作为自己以后翻阅用吧, 首先安装homebrew,打开终端,在终端下面允许下面的命令(不要用root用户): /usr/bin/r ...
- JavaScript 稀奇的js语法
function c(expression) { console.log(expression); } c(-0); // -0 c(-0 === +0); // true c((-0).toStri ...
- 微信小程序 功能函数 获取验证码*
yanZhengInput: function (e) { var that = this; var yanzheng = e.detail.value; var huozheng = this.da ...
- java与C++相比增加和缺少的特性--持续更新
缺少的特性 java值类型中没有无符号数 java没有运算符重载语法 java中没有struct和union等用户自定义值类型 java中没有虚函数的概念,所有函数默认具有虚函数的特性 java采用单 ...
- Spring、MyBatis和SpringMVC整合的jar包下载
spring mvc的jar包下载:http://repo.springsource.org/libs-release-local/org/springframework/spring/我下载的5.0 ...