服务器版本: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 解决办法的更多相关文章

  1. 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 ...

  2. iis服务器php环境 failed to open stream: No such file or directory解决办法

    项目主机用的windows系统,iis服务器:远程连接桌面—>本地资源->映射D盘驱动器,将本地d盘修改后的文件放在远程主机项目目录里,访问报出failed to open stream: ...

  3. ././include/linux/kconfig.h:4:32: fatal error: generated/autoconf.h: No such file or directory 解决办法

    我在编写内核驱动模块的时候报了一个非常奇怪的错误,如下图: 在目录下看了一下确实没有发现这个文件,感觉很奇怪,因为我记得之前编译模块是没有错误的,所以不可能是我代码写的有问题. 查阅了资料很多说要清除 ...

  4. 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 ...

  5. 解决: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 ...

  6. 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 ...

  7. 【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) ...

  8. 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 ...

  9. 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 ...

随机推荐

  1. 手动搭建一个webpack+react笔记

    { "name": "lottery", "version": "1.0.0", "description&q ...

  2. iOS开发学习-放大长图与屏幕等宽

    /* 需要得到一个图片的放大比例,这个比例就是屏幕的宽度与图片真实宽度的比值 */ CGFloat newZoomScale = LZ_SCREEN_WIDTH / [_photoImageView. ...

  3. web06-PanduanLogin

    电影网站:www.aikan66.com 项目网站:www.aikan66.com 游戏网站:www.aikan66.com 图片网站:www.aikan66.com 书籍网站:www.aikan66 ...

  4. 用java进行简单的万年历编写

    import java.util.Scanner; public class PrintCalendarDemo1 { public static void main(String[] args) { ...

  5. 第二阶段Sprint冲刺会议3

     进展:讨论视频录制的具体功能,查看有关资料,开始着手编写有关代码.

  6. 404 Note Found Team's First Blood

    团队构成: 队员学号姓名队长标注: 031602114--胡绪佩(队长) 031602113--何宇恒 081600410--胡青元 031602627--刘恺琳 031602525--刘一好 031 ...

  7. 22_IO_第22天(File、递归)_讲义

    今日内容介绍 1.File 2.递归 xmind:下载地址: 链接:https://pan.baidu.com/s/1Eaj9yP5i0x4PiJsZA4StQg 密码:845a 01IO技术概述 * ...

  8. [BUAA2017软工]个人作业week-1

    一.快速看完整部教材,列出你仍然不懂的5到10个问题,发布在你的个人博客上. 1.在第二章个人技术和流程,邹欣老师提到了一张表格,主要解释了效能分析的一些名词,其中有这么几个概念: 调用者:函数Foo ...

  9. HTTP压力测试工具wrk的安装及测试

    本次在VMware虚拟机的CentOS6.3系统中进行安装wrk压测工具,具体如下: 一.预先安装需求项 为了安装顺利,不受权限的限制,首先可以把用户切换为root用户# su + 输入root用户对 ...

  10. es6 const关键字

    const是constant(常量)的缩写,const和 let一样,也是用来声明变量的,但是const是专门用于声明一个常量的,顾名思义,常量的值是不可改变的.以前用var声明的变量,想怎么改就怎么 ...