找回密码
 注册
查看: 790|回复: 0

解决centos8stream libvirtd服务失败问题--listen parameter not permitted with systemd acti

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2022-5-8 08:58:36 | 显示全部楼层 |阅读模式
[root@compute01 ~]# vim /etc/sysconfig/libvirtd    修改文件:
$ z  j6 x. T  E1 q. v
0 d' S: j- l& R4 K[root@compute01 ~]# vim /etc/sysconfig/libvirtd8 H  C$ D5 q2 w1 c' R9 V0 K$ U4 x
LIBVIRTD_ARGS="--timeout 86400 "    #时间设置
* O0 A1 S3 H' O- n' QLIBVIRTD_CONFIG=/etc/libvirt/libvirtd.conf   #配置文件
. |6 [7 c! ^3 ^; W
9 @2 N# Z6 k3 e+ ^, Z
7 [" ~( ]3 ~: A6 b3 z  `* ][root@compute01 ~]# libvirtd -d
3 G9 p$ B  T  T# y2 T! t" Nlibvirtd: error: Unable to obtain pidfile. Check /var/log/messages or run without --daemon for more info.    说明已经启动了。) H& }5 [( L+ l

# N+ U: z4 d/ [2 s[root@compute01 ~]# ps -ef |grep libvirtd    查看进程:
+ a" H. h( y* H  b7 X1 Jroot        9051       1  0 08:47 ?        00:00:00 libvirtd -d  ^2 G+ z* E* r- i; ~
root        9171    2791  0 08:48 pts/1    00:00:00 grep --color=auto libvirtd& s' t' B' s" c

( L# \: l  t2 q' ~4 P  |" J# b6 K2 q* ^4 V5 e
停止程序:
6 R8 ]& Z' U" }8 _[root@compute01 ~]# kill -9 90511 k4 Q: d3 ]9 X, r3 |# S
  A8 r) M) A0 E/ s' z) _$ Z
[root@compute01 ~]# ps -ef |grep libvirt
3 a5 K6 M) M  e- R1 N1 sdnsmasq     9124       1  0 08:47 ?        00:00:00 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper8 z8 r% o0 D3 P" o: |. U
root        9125    9124  0 08:47 ?        00:00:00 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper
  [! n+ N+ G5 T' G5 W. m. }root        9173    2791  0 08:49 pts/1    00:00:00 grep --color=auto libvirt0 z6 Y- q$ u( Y9 o1 e/ S
[root@compute01 ~]# kill -9 9124 91254 x& e1 E& R/ a
: z- j3 }# d- D! }: h6 N/ s1 Z

) d/ J6 h% d9 c3 s# n[root@compute01 ~]# ps -ef |grep libvirt6 ?: @! V' M% {" m1 T' _
root        9183    2791  0 08:49 pts/1    00:00:00 grep --color=auto libvirt8 u; N: h3 q- j( {3 E
[root@compute01 ~]# ps -ef |grep libvirt! R$ `: k$ A' `0 h) }) e. o8 U
root        9185    2791  0 08:49 pts/1    00:00:00 grep --color=auto libvirt
1 V' W1 C4 w# M% o
) p2 k1 h% f- }0 \8 j
3 ]5 c/ U/ ^% C: s[root@compute01 ~]# virsh list
4 g# R# y# Q5 o1 `- u( F1 p% J/ Cerror: failed to connect to the hypervisor6 S% _6 R* d. }) g

& l8 m% d4 y: }* j" @error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Connection refused' ~! u4 r; t0 Q' T1 w

6 n: t1 i! Z% y' J1 f# T1 c3 u& S4 B( c
检查状态:
4 b/ O- j1 e2 q& c- r! Q* h1 p
+ b% m, Q: `* M) R$ L[root@compute01 ~]# systemctl status libvirtd.service
& g0 H; I! |, P4 F+ K* e: \● libvirtd.service - Virtualization daemon/ Q- Y- v) q8 ~/ y( x' O4 M( p
   Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; disabled; vendor preset: enabled): n/ D9 l' \2 x+ K) N+ ~* H0 D1 F
   Active: failed (Result: exit-code) since Sun 2022-05-08 08:47:37 CST; 2min 3s ago4 H* }# b: G) ^
     Docs: man:libvirtd(8)
7 ]- Z# X( D6 b) R  N, `           https://libvirt.org
6 `5 W" W* {, z3 D  Process: 9028 ExecStart=/usr/sbin/libvirtd $LIBVIRTD_ARGS (code=exited, status=6)
7 x/ Q) k: j! L  K3 @& t Main PID: 9028 (code=exited, status=6)
" {( {" w8 h( h2 d, f' S" IMay 08 08:47:37 compute01 systemd[1]: libvirtd.service: Service RestartSec=100ms expired, scheduling restart.% R; }0 W9 N5 l4 g: b! _* s5 `8 R0 g: Z
May 08 08:47:37 compute01 systemd[1]: libvirtd.service: Scheduled restart job, restart counter is at 5.
  P2 e  _6 z" h6 LMay 08 08:47:37 compute01 systemd[1]: Stopped Virtualization daemon.8 c8 m1 }3 \9 R! C2 M
May 08 08:47:37 compute01 systemd[1]: libvirtd.service: Start request repeated too quickly.) e6 U6 e0 e3 y+ o2 t
May 08 08:47:37 compute01 systemd[1]: libvirtd.service: Failed with result 'exit-code'.
0 T& i+ g6 T$ V) {4 a% m4 LMay 08 08:47:37 compute01 systemd[1]: Failed to start Virtualization daemon.
1 a* H2 `) @0 h2 M
* s/ s( z' o. c: Y* o+ \- h: H启动:
! f* x. W+ Z5 L' Y8 ~$ w/ b+ \8 _[root@compute01 ~]# systemctl start libvirtd.service
$ s) [) M7 ]5 H# A+ c3 ?4 k3 j; O( s

7 C  {2 q! D* F' k" w& Z0 L[root@compute01 ~]# systemctl status libvirtd.service
! G! y5 o0 V7 r* o- k● libvirtd.service - Virtualization daemon6 x  f  R1 d" V
   Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; disabled; vendor preset: enabled)
6 C% M- G) n$ @& w  m" `' `   Active: active (running) since Sun 2022-05-08 08:49:45 CST; 1s ago
+ l/ F: g1 W% F- X     Docs: man:libvirtd(8)% s/ F! T) g1 _, g9 q2 N5 h
           https://libvirt.org
5 u  o5 f% g% B' T Main PID: 9196 (libvirtd)
& d  K; M4 q: w- p3 D    Tasks: 21 (limit: 32768)
7 I- i8 {, n$ L7 f   Memory: 14.8M7 J: \& |: d& q+ G* X5 S3 J7 A
   CGroup: /system.slice/libvirtd.service- j9 X5 s) d* R1 S  ?" U
           ├─9196 /usr/sbin/libvirtd --timeout 86400
# e$ J1 b  K( H. G5 J% Q8 G           ├─9269 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-scr>
- J: b2 }# f: H  C) y" T           └─9270 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-scr>; b  N0 b! R- }' j
May 08 08:49:46 compute01 dnsmasq[9266]: listening on virbr0(#7): 192.168.124.1* X0 {# b4 T2 @: f
May 08 08:49:46 compute01 dnsmasq[9269]: started, version 2.79 cachesize 1508 D; y& H$ X) s& D
May 08 08:49:46 compute01 dnsmasq[9269]: compile time options: IPv6 GNU-getopt DBus no-i18n IDN2 DHCP DHCPv6 no>
& b, P; P4 l% N1 oMay 08 08:49:46 compute01 dnsmasq-dhcp[9269]: DHCP, IP range 192.168.124.2 -- 192.168.124.254, lease time 1h( X7 F* k$ ?0 c/ S3 i
May 08 08:49:46 compute01 dnsmasq-dhcp[9269]: DHCP, sockets bound exclusively to interface virbr0
- ~2 \  @' s' h' ?May 08 08:49:46 compute01 dnsmasq[9269]: reading /etc/resolv.conf' n2 k8 ]3 I7 S2 v* Q3 \
May 08 08:49:46 compute01 dnsmasq[9269]: using nameserver 202.106.0.20#53( ~0 M7 `' B9 S1 ^1 k0 x
May 08 08:49:46 compute01 dnsmasq[9269]: read /etc/hosts - 4 addresses
8 l# }' J5 i% WMay 08 08:49:46 compute01 dnsmasq[9269]: read /var/lib/libvirt/dnsmasq/default.addnhosts - 0 addresses
3 a( W* ^% }: DMay 08 08:49:46 compute01 dnsmasq-dhcp[9269]: read /var/lib/libvirt/dnsmasq/default.hostsfile
/ o, t: B0 ]9 ^+ V$ E9 _+ E; y+ ?) E: ?" l. E1 t4 ?( u( m
- s; J1 @' I4 k% d, D1 {+ P
[root@compute01 ~]# virsh list
0 v, l, u6 X" ]. f/ D! v7 j Id   Name   State3 j; r7 b2 X% P& y6 {
--------------------! z) g% G- n* Q2 E* p
' q6 T% ?( ^1 E; i7 Q

) ]$ N8 ^0 Y9 ?4 X7 |: w[root@compute01 ~]# ps -ef |grep libirt( x+ Z$ D/ V- l/ W6 N6 k& Z% L
root        9296    2791  0 08:50 pts/1    00:00:00 grep --color=auto libirt
6 b/ {' Q" y4 }9 k; }% p. o5 K# j[root@compute01 ~]# ps -ef |grep libvirt
/ L0 r1 E! j3 i; ?root        9196       1  1 08:49 ?        00:00:00 /usr/sbin/libvirtd --timeout 864006 q! G( k7 }8 A) M: W# j$ I- G0 Z( Y
dnsmasq     9269       1  0 08:49 ?        00:00:00 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper
4 S% S' n: R) p0 Y+ ]* a% Groot        9270    9269  0 08:49 ?        00:00:00 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper
/ b  x) A1 _4 w! l, s& {root        9300    2791  0 08:50 pts/1    00:00:00 grep --color=auto libvirt, ]; O; s9 t+ f

1 _% I7 D) _" w4 Z& W$ Z7 v8 J; [: m! _, P& G7 m7 D
[root@compute01 ~]# virsh list  & a2 e$ X3 M. K# {; z: u
Id   Name   State
4 B: j" P, r8 }# B( i5 k--------------------
: Q0 F& s4 A) E, ]1 l' t# @2 ?[root@compute01 ~]# virsh net-list
9 ^+ O# l% A; {1 c Name      State    Autostart   Persistent
, w" Q- `, w, o# m6 X: ?# q! y( P. q--------------------------------------------
4 O9 b3 ^# i& E- |: h0 r& Y default   active   yes         yes
. k$ |& a4 w# ]" p3 v' H* G7 @- B9 o3 n' t
kvm系统停止default网络:
5 ?" B) h" p) v4 T/ V[root@compute01 ~]# virsh net-destroy default
6 n0 `2 b5 v! [9 t/ l0 F; X0 cNetwork default destroyed
1 F2 ~& u1 l, p1 B2 s4 v6 I0 D
启动default网络:
, Q0 D$ e) P7 ]0 R+ e! m[root@compute01 ~]# virsh net-start --network default
% e6 r. q9 `8 z  q* [0 uNetwork default started& O8 D/ E; m( k( G, J8 \
. G! ^! d) W: y+ H- b
[root@compute01 ~]# virsh list  9 R$ ~8 ]: l. z! t5 n% O
Id   Name   State
- }0 ^5 V# F/ [$ y& c--------------------
7 N- o. R2 v5 L) A4 ?
/ X, h0 T; E) q) e6 {[root@compute01 ~]# virsh net-list
3 z* H9 M3 |  [7 b$ _ Name      State    Autostart   Persistent
" X. U" A0 A  A, T( x--------------------------------------------
( b6 |  A7 [1 N8 D default   active   yes         yes, X3 K+ X6 F" Z
6 v# {; E/ c5 C( s. k
视乎解决了。
# w0 ^6 [' R7 y/ Y& l观察下吧。- H" [8 B! d& @0 n+ \& E
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 01:48 , Processed in 0.016531 second(s), 23 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表