centos libvirtd升级的两种方法

linux系统突然宕机,找不到原因。于是查看/var/log/messages里面记录的系统log发现以下错误,虽然可能不是宕机的原因但是还是需要解决的:

Failed to start Virtualization daemon.
localhost systemd: Unit libvirtd.service entered failed state.
localhost systemd: libvirtd.service failed.

在网上查找解决方法大部分都是用以下方法进行更新库:

yum update libvirtd
systemctl restart libvirtd 

但是我发现yum update显示的是no package to update。于是只能手工进行更新了:

yum install gcc libnl-devel libxml2-devel yajl-devel device-mapper-devel libpciaccess-devel libnl3-devel netcf-devel numactl-devel
wget https://libvirt.org/sources/libvirt-4.0.0.tar.xz
xz -d libvirt-4.0.0.tar.xz
tar -xvf libvirt-4.0.0.tar
cd libvirt-4.0.0
./configure --prefix=/usr --localstatedir=/var  --sysconfdir=/etc --with-numactl
make
make install
ldconfig
systemctl restart libvirtd.service

然后通过virsh version查看版本是否更新成功:

Compiled against library: libvirt 4.0.0
Using library: libvirt 4.0.0
Using API: QEMU 4.0.0
error: failed to get the hypervisor version
error: internal error: Cannot find suitable emulator for x86_64

下面两行报错很有可能是因为qemu没有安装好,所以进行安装:

yum -y install gcc gcc-c++ automake libtool zlib-devel glib2-devel bzip2-devel libuuid-devel spice-protocol spice-server-devel usbredir-devel libaio-devel ceph-devel pixman-devel
yum install libaio-devel 

#spice相关
wget https://www.spice-space.org/download/releases/spice-protocol-0.12.13.tar.bz2
tar -jxvf spice-protocol-0.12.13.tar.bz2
cd spice-protocol-0.12.13
./configure --prefix=/usr --sysconfdir=/etc  --localstatedir=/var --libdir=/usr/lib64
make -j30
make install
yum install celt051-devel
wget https://www.spice-space.org/download/releases/spice-0.14.0.tar.bz2
tar -jxvf spice-0.14.0.tar.bz2
cd spice-0.14.0
mkdir build && cd build
./configure --prefix=/usr --sysconfdir=/etc  --localstatedir=/var --libdir=/usr/lib64
make -j30
make install
yum install qemu\*
systemctl restart libvirtd.service
virsh version

显示如下内容则表示成功:

Compiled against library: libvirt 4.0.0
Using library: libvirt 4.0.0
Using API: QEMU 4.0.0
Running hypervisor: QEMU 2.0.0

 

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值