找回密码
 注册
查看: 791|回复: 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    修改文件:
0 D' }2 b) H8 ]% J* ~! \8 C' }  v3 m: m2 f- }
[root@compute01 ~]# vim /etc/sysconfig/libvirtd0 F& R# {  ^* w* e4 w" X4 R: z
LIBVIRTD_ARGS="--timeout 86400 "    #时间设置: i  T* `$ M' M3 u7 _
LIBVIRTD_CONFIG=/etc/libvirt/libvirtd.conf   #配置文件- A& h% W# S& j* d# W

: [4 u! P, w; e) m: u$ D( v4 w0 |# ^
1 n# a' \7 {7 z[root@compute01 ~]# libvirtd -d
5 i8 N$ i) t/ @; |. K- s1 tlibvirtd: error: Unable to obtain pidfile. Check /var/log/messages or run without --daemon for more info.    说明已经启动了。
/ G+ W& c) ^0 b0 r% L8 b9 i0 n) N4 V4 ?3 A- x, C, h
[root@compute01 ~]# ps -ef |grep libvirtd    查看进程:
' p. o8 U7 t8 c3 H; O" Croot        9051       1  0 08:47 ?        00:00:00 libvirtd -d
4 B4 Z: M# T) L4 Froot        9171    2791  0 08:48 pts/1    00:00:00 grep --color=auto libvirtd+ M  T! i  ^* t

6 M) N; C3 M5 x, Y, K$ v9 h0 D; n, ~0 F+ R4 o9 g9 g5 x2 \
停止程序:" N9 I6 G" _/ b
[root@compute01 ~]# kill -9 9051- p0 s" K0 v) C
- q( ^2 \* U6 q6 F, a8 h
[root@compute01 ~]# ps -ef |grep libvirt% W8 P3 Q# o2 t3 C' n* ]& w( Z
dnsmasq     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_leaseshelper' N, I, }7 ^' P' R  S8 A
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
1 @- R8 c- X' F9 F) \- `% F. [. broot        9173    2791  0 08:49 pts/1    00:00:00 grep --color=auto libvirt" v1 b, w9 e* s% A! D
[root@compute01 ~]# kill -9 9124 91255 }3 k4 V; x, l
  t' M' q. N" s- T3 L

/ V, e: F' L# N1 n4 p[root@compute01 ~]# ps -ef |grep libvirt: t. ?$ a5 R2 y3 G
root        9183    2791  0 08:49 pts/1    00:00:00 grep --color=auto libvirt
' I- N# z. M6 i* k8 j0 [[root@compute01 ~]# ps -ef |grep libvirt1 j+ k' F# L; s$ q' E" ?% H
root        9185    2791  0 08:49 pts/1    00:00:00 grep --color=auto libvirt8 W, j0 _0 K0 V# e

5 q$ T& M5 j( K) R- v7 D4 B, V( ?1 t, \; Q/ T7 i
[root@compute01 ~]# virsh list
$ k9 s8 I- Q0 aerror: failed to connect to the hypervisor
1 j- g/ v  d' g7 F+ z6 p# j& I; ~6 c8 v* y* e
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Connection refused( J) [, a# {4 s6 G
7 X$ V. [) H6 I: I* Z# h2 T
& b7 S" _7 A* X; T
检查状态:2 x6 ?8 m9 E1 K+ p9 v

/ n& X9 g( B1 C% X- M[root@compute01 ~]# systemctl status libvirtd.service * S2 }6 k9 ^7 H+ {* Q3 T! d) `
● libvirtd.service - Virtualization daemon; A3 \. q' P$ F
   Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; disabled; vendor preset: enabled)
: ?; p& f, a0 q  C   Active: failed (Result: exit-code) since Sun 2022-05-08 08:47:37 CST; 2min 3s ago/ b* k* h0 f! e! G
     Docs: man:libvirtd(8)7 T; ]  |: l6 w# A3 }
           https://libvirt.org7 S) N7 ^/ h+ L9 i% ^3 j) B
  Process: 9028 ExecStart=/usr/sbin/libvirtd $LIBVIRTD_ARGS (code=exited, status=6)6 U' a8 D; E3 Y
Main PID: 9028 (code=exited, status=6)  |( a1 h' t" e( W) m+ a
May 08 08:47:37 compute01 systemd[1]: libvirtd.service: Service RestartSec=100ms expired, scheduling restart.
, ^" O% z3 d: b  b' z: IMay 08 08:47:37 compute01 systemd[1]: libvirtd.service: Scheduled restart job, restart counter is at 5.; w! n3 |7 q( C
May 08 08:47:37 compute01 systemd[1]: Stopped Virtualization daemon., E0 V- C( `1 J# {( K
May 08 08:47:37 compute01 systemd[1]: libvirtd.service: Start request repeated too quickly.( o2 ?2 a1 k4 M& Y2 p3 L* Y
May 08 08:47:37 compute01 systemd[1]: libvirtd.service: Failed with result 'exit-code'." }/ z& `% `5 E- N; W; C# C
May 08 08:47:37 compute01 systemd[1]: Failed to start Virtualization daemon.1 J' z6 c* L0 k; R. t4 w

4 I& W; u, y7 U" {7 h启动:
3 S. ~6 `4 k$ d& n: }[root@compute01 ~]# systemctl start libvirtd.service / d5 o7 v' \& ?5 {

, c! w( y" Y7 D: R# X8 R% J! {
: z8 A3 N' P' s: E9 @# w" u[root@compute01 ~]# systemctl status libvirtd.service ; g# B7 }, {4 k1 h" ?# ?
● libvirtd.service - Virtualization daemon5 ]+ C1 I3 t! s4 b# K8 j" P7 u
   Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; disabled; vendor preset: enabled)
# N: e2 ~" A" a$ T9 ^5 a   Active: active (running) since Sun 2022-05-08 08:49:45 CST; 1s ago( ]8 L4 W+ _% x! r& u
     Docs: man:libvirtd(8)  d) }- D4 K( n/ i- w6 U
           https://libvirt.org
& P+ \( L. D8 L+ P Main PID: 9196 (libvirtd)2 L+ z* U5 F# s; H3 g
    Tasks: 21 (limit: 32768). h9 g' \2 X# Q& ^' ~
   Memory: 14.8M
; p% b* B  }1 {; x: S) c   CGroup: /system.slice/libvirtd.service. S3 j" }* A* H  E
           ├─9196 /usr/sbin/libvirtd --timeout 86400
9 T- f$ S3 O) \9 E2 G           ├─9269 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-scr>
8 p$ J6 T! e/ m" `7 X7 p           └─9270 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-scr>
) @3 _3 @' t( v2 p2 Q: BMay 08 08:49:46 compute01 dnsmasq[9266]: listening on virbr0(#7): 192.168.124.1, Z2 M/ G6 m" R* j3 d5 x
May 08 08:49:46 compute01 dnsmasq[9269]: started, version 2.79 cachesize 1503 i$ z4 |* i  l8 J& ]
May 08 08:49:46 compute01 dnsmasq[9269]: compile time options: IPv6 GNU-getopt DBus no-i18n IDN2 DHCP DHCPv6 no>& l( B, Y( e" V+ M5 m$ N2 P# R
May 08 08:49:46 compute01 dnsmasq-dhcp[9269]: DHCP, IP range 192.168.124.2 -- 192.168.124.254, lease time 1h
: J/ o* ?% D: ]% t5 D1 L; d  GMay 08 08:49:46 compute01 dnsmasq-dhcp[9269]: DHCP, sockets bound exclusively to interface virbr01 A& k; y4 p( Y
May 08 08:49:46 compute01 dnsmasq[9269]: reading /etc/resolv.conf( `' a9 q) ]3 [0 o! A2 F- e
May 08 08:49:46 compute01 dnsmasq[9269]: using nameserver 202.106.0.20#53$ ~2 P) g* ?# k
May 08 08:49:46 compute01 dnsmasq[9269]: read /etc/hosts - 4 addresses
7 @9 G1 A5 S. C$ ^May 08 08:49:46 compute01 dnsmasq[9269]: read /var/lib/libvirt/dnsmasq/default.addnhosts - 0 addresses* P" R% P2 Z3 M
May 08 08:49:46 compute01 dnsmasq-dhcp[9269]: read /var/lib/libvirt/dnsmasq/default.hostsfile
/ l: f. s1 g( C, j$ T
$ T8 T& }4 R, a7 o3 X, W9 X* Z8 k9 a2 w) _
[root@compute01 ~]# virsh list
( a! `: \( F2 v3 H$ D: s Id   Name   State) Z% f% Y1 p9 R9 E' {' n( @; X
--------------------- }/ g6 o- C% c) g; L: q& }2 A
4 D* n( Z. t# A" V% W! `$ [, |
" L! q4 l; g- O3 M9 X
[root@compute01 ~]# ps -ef |grep libirt
. R& C3 s0 T7 ?9 B* M5 `: k) yroot        9296    2791  0 08:50 pts/1    00:00:00 grep --color=auto libirt
$ x9 Z1 G5 V2 o; j7 t[root@compute01 ~]# ps -ef |grep libvirt9 J9 |8 s( Z+ z' H8 s  s
root        9196       1  1 08:49 ?        00:00:00 /usr/sbin/libvirtd --timeout 86400
" y8 [. [% T7 ]* F. u' rdnsmasq     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_leaseshelper3 w  x$ M2 ]( Q: x! u
root        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. l& _' e2 P7 p* |& x+ }- R# H
root        9300    2791  0 08:50 pts/1    00:00:00 grep --color=auto libvirt
( s$ p6 o& v# W" r2 T! o" W' d5 F, K; w  f3 @1 `7 g
+ H; F4 _- S8 E0 B+ A4 h% |6 f
[root@compute01 ~]# virsh list  9 E) t2 L& P3 U  ]
Id   Name   State+ M: u0 t+ d  A4 X6 B
--------------------0 o, c  z  `6 j( C
[root@compute01 ~]# virsh net-list % M! ^, Q4 y; L) T6 }' d' D
Name      State    Autostart   Persistent
3 H2 P  Y% c; M" z9 ]! d( G--------------------------------------------
/ z6 P- ~4 q7 a default   active   yes         yes
# ~( h, k+ B$ i; S  x
6 |" j/ P$ F; l+ X! h. ?kvm系统停止default网络:
) \" l( n$ |" d/ b/ [2 E& c2 d[root@compute01 ~]# virsh net-destroy default
! i- S. j/ R+ x- F' X* y( }Network default destroyed4 K& U1 [7 p" @8 c4 d
2 L6 E0 N9 k2 [! o
启动default网络:
% v# c1 p" m- M: g7 c; s2 Y* V[root@compute01 ~]# virsh net-start --network default ' M* b9 H/ f3 t1 [+ H, v
Network default started$ ^) S1 H) o! s+ t& v0 w
- D& h+ ~; ^1 p: I5 F" ]0 y
[root@compute01 ~]# virsh list  
( u' a# G7 B8 q! o1 B. k5 P# _ Id   Name   State2 J5 a# C# w; W0 Y) |9 i, n
--------------------* [5 A% i; Q  w7 c3 l

3 O3 o- n) d+ J6 _" \( H3 ?[root@compute01 ~]# virsh net-list 1 |& o0 Y3 L8 U* f; N! ]5 s4 ~- l
Name      State    Autostart   Persistent$ n3 ?! `- P# |( _, a# @
--------------------------------------------! I8 Y2 K! y  F+ B0 F# b0 ?* X
default   active   yes         yes  F' h$ Q8 Z. g- m8 O5 n' Y& n$ [% I
. W# C% R/ I8 [9 w1 g4 g
视乎解决了。
& X; R, a! v/ X观察下吧。- T- ^- Q7 H8 D7 |6 L  J2 z
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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