找回密码
 注册
查看: 38|回复: 1

解决zabbix_agent2: /usr/sbin/zabbix_agent2: error while loading shared libraries:

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2024-12-11 17:14:00 | 显示全部楼层 |阅读模式
[root@localhost ~]# systemctl status zabbix-agent2.service 4 Q4 d+ M. [* z% f5 n% h. R" R4 Z/ j
● zabbix-agent2.service - Zabbix Agent 2
2 }/ y0 \' v- A1 l   Loaded: loaded (/usr/lib/systemd/system/zabbix-agent2.service; enabled; vendor preset: disabled)# N- i( ~1 w2 z0 j% |, O
   Active: activating (auto-restart) (Result: exit-code) since Wed 2024-12-11 17:05:53 CST; 2s ago9 U, O3 h, H+ A5 X4 h
  Process: 2540 ExecStart=/usr/sbin/zabbix_agent2 -c $CONFFILE (code=exited, status=127)
% {# C; U0 T: L, N Main PID: 2540 (code=exited, status=127)
! E' U7 Y1 B* J. I# @' c+ G; M* M7 G# w  L) R
Dec 11 17:05:53 localhost.localdomain systemd[1]: zabbix-agent2.service: main process exited, code=exited, status=127/n/a
8 r2 h8 x9 g. Z% H. V" TDec 11 17:05:53 localhost.localdomain systemd[1]: Unit zabbix-agent2.service entered failed state.
  d: @7 p9 i; z( yDec 11 17:05:53 localhost.localdomain systemd[1]: zabbix-agent2.service failed.9 `$ X6 B0 T1 t" p

* K2 P: z  D* G查看message日志发现:$ W: Y, x' V7 G9 M/ b# O3 C, Y- J

2 G- K4 z* L5 Q9 U8 H# |Dec 11 17:09:22 localhost zabbix_agent2: /usr/sbin/zabbix_agent2: error while loading shared libraries: libpcre2-8.so.0: cannot open shared object file: No such file or directory" M$ o% h/ x2 f* I
Dec 11 17:09:22 localhost systemd: zabbix-agent2.service: main process exited, code=exited, status=127/n/a7 f1 [$ s6 m/ F
Dec 11 17:09:22 localhost systemd: Unit zabbix-agent2.service entered failed state.
& w  k% F9 i/ Z& h3 eDec 11 17:09:22 localhost systemd: zabbix-agent2.service failed.
4 B* L) M# `1 N5 o0 e4 I; rDec 11 17:09:33 localhost systemd: zabbix-agent2.service holdoff time over, scheduling restart.( }. H# M' Y/ P6 e, [: q4 A  H
Dec 11 17:09:33 localhost systemd: Stopped Zabbix Agent 2.
! l) l. T1 I5 E1 a" r, wDec 11 17:09:33 localhost systemd: Started Zabbix Agent 2.  N! b( s* b4 }; d( K& }
Dec 11 17:09:33 localhost systemd: zabbix-agent2.service: main process exited, code=exited, status=127/n/a
6 q) B- k) E1 V$ Q5 E1 C0 TDec 11 17:09:33 localhost zabbix_agent2: /usr/sbin/zabbix_agent2: error while loading shared libraries: libpcre2-8.so.0: cannot open shared object file: No such file or directory) M9 e% V  x2 L% t
Dec 11 17:09:33 localhost systemd: Unit zabbix-agent2.service entered failed state.; ~3 K: @. E0 Y. I' o3 a$ Z/ H
Dec 11 17:09:33 localhost systemd: zabbix-agent2.service failed.
. z6 [" i  y' E9 ^2 _" N" n1 j; j+ j$ K* B5 N0 }; M* t
9 p9 t+ _& H' N7 `0 c
[root@localhost ~]# vim /etc/zabbix/zabbix_agent2.conf 8 @" {- W2 E8 k" C
[root@localhost ~]# systemctl restart zabbix-agent2.service
' {  I3 P7 I  h9 k8 m2 ]3 Z2 D- N
5 W# F9 N6 f) m* t* v3 s3 V3 s原来是缺包:
1 i, e: G7 O0 {" A0 R. O[root@localhost ~]# yum provides libpcre2-8.so.0
( {  V. I6 A# O: fLoaded plugins: fastestmirror! t' K) A  a6 B8 F; d3 G
Loading mirror speeds from cached hostfile+ h- T% ?3 s$ {
* base: mirrors.aliyun.com
6 B  Q- V4 K* q$ v * extras: mirrors.aliyun.com/ O, t- D  r# v7 A
* updates: mirrors.aliyun.com! V( e( }9 U7 Q
pcre2-10.23-2.el7.i686 : Perl-compatible regular expression library& E0 \$ Y+ z/ ^- J/ ?- R/ ]
Repo        : base  ]# w  q. B5 R* y/ u1 z" U) F
Matched from:* C4 M+ e! c3 d" M/ d1 k
Provides    : libpcre2-8.so.0
5 n5 L3 c* O1 ~5 V3 t$ Y' }8 a% }7 m

& x) l" @0 h; ?$ ?8 J
! P& F% I4 a' g' \3 o6 W' S7 q  Q接下来安装包吧:
& o/ V; Q4 y3 {# \- d/ z* `4 q6 `6 K6 t9 n5 {
[root@localhost ~]# yum install -y pcre28 D: A# e# W- i/ `5 Y
Loaded plugins: fastestmirror  d# H( H7 a" s& X. V
Loading mirror speeds from cached hostfile
) ?+ Y# _$ {- @9 U: T" p7 R * base: mirrors.aliyun.com- _& X2 j& p; `6 v. i; h. V
* extras: mirrors.aliyun.com% @3 C- ~) Y9 q$ Z* h1 b
* updates: mirrors.aliyun.com
/ a% m' u! B; Q; b" v/ Q0 HResolving Dependencies' d* p! w1 C8 K9 s
--> Running transaction check
# o4 h% L, R8 Y---> Package pcre2.x86_64 0:10.23-2.el7 will be installed- q! i6 s( m; d2 t, h' K2 l
--> Finished Dependency Resolution* N# e; ]) I1 I/ y' U% S

- @8 ]: b4 {1 q  M( j1 o( T% oDependencies Resolved" I- B) m- V$ H6 G; C
- f: ?% W" A) p% X2 B) e
==================================================================================================================================================================================================
5 ?$ ?$ j" M9 j4 E' }9 a5 x$ z7 @ Package                                      Arch                                          Version                                             Repository                                   Size2 ]4 Y" i% J5 I
==================================================================================================================================================================================================3 R# \; t4 F3 X! c/ m/ X
Installing:
1 n, m7 t0 g. V* n9 @* k pcre2                                        x86_64                                        10.23-2.el7                                         base                                        201 k/ s8 j. Y+ I* m3 E

' N7 ~/ I* H- o2 MTransaction Summary
( T! y- T" i$ \5 Q& U+ P; F: z, J==================================================================================================================================================================================================' i* c3 i% l0 T1 R5 {; y
Install  1 Package( ?' }* o. K$ k* v" [! d

1 j+ e: D# J* P( VTotal download size: 201 k# Z1 O+ ?; W" w1 Y$ R8 Q
Installed size: 556 k
4 r/ ~) q( r1 j7 uDownloading packages:
7 _5 @" \6 u" F/ G7 ]% ipcre2-10.23-2.el7.x86_64.rpm                                                                                                                                               | 201 kB  00:00:00     
6 K+ g& w  g' }& X( iRunning transaction check
1 T) r  {7 Q0 l% K* k( u5 d- pRunning transaction test
! a* f' l& I* A$ J, Q, VTransaction test succeeded
1 o. e! h6 R( \: c7 iRunning transaction& ~$ z# |8 x; C/ T2 H
Warning: RPMDB altered outside of yum., I% I+ K9 F' K' N5 u
** Found 1 pre-existing rpmdb problem(s), 'yum check' output follows:; T$ s4 w' A- @/ u
zabbix-agent2-6.0.6-1.el7.x86_64 has missing requires of libpcre2-8.so.0()(64bit)2 a3 |' V3 b- I4 D
  Installing : pcre2-10.23-2.el7.x86_64                                                                                                                                                       1/1 / `, M* b  L  K6 K( n, @
  Verifying  : pcre2-10.23-2.el7.x86_64                                                                                                                                                       1/1
& a2 _; K9 a6 q
/ h5 `, S6 t# _/ q: q. nInstalled:& }: Z. ?0 \5 @) g! g6 E
  pcre2.x86_64 0:10.23-2.el7                                                                                                                                                                      & Y' x( e0 }- X$ ^

* G* G  d3 r: ?* X3 Z+ FComplete!
: \9 u4 G/ I* U5 s7 [% ?$ L9 s[root@localhost ~]# systemctl status zabbix-agent2.service 7 x. _% u6 z6 ]: W7 k2 Q9 z: l
● zabbix-agent2.service - Zabbix Agent 2
$ r9 I* ^8 O8 h9 {2 V' g   Loaded: loaded (/usr/lib/systemd/system/zabbix-agent2.service; enabled; vendor preset: disabled)! Y9 y! s/ }# Q6 |
   Active: active (running) since Wed 2024-12-11 17:09:43 CST; 13s ago4 X- D3 ?4 Z' `* g  V2 x9 F
Main PID: 2635 (zabbix_agent2)2 F  }  Z' H* n5 F2 v
   CGroup: /system.slice/zabbix-agent2.service4 A5 `' u* M' A  h* {; O
           └─2635 /usr/sbin/zabbix_agent2 -c /etc/zabbix/zabbix_agent2.conf. J: J9 B% z  q' {

7 @" k& E7 L/ ~- m# XDec 11 17:09:43 localhost.localdomain systemd[1]: Started Zabbix Agent 2.
7 [1 A6 s+ l; n0 n( FDec 11 17:09:43 localhost.localdomain zabbix_agent2[2635]: Starting Zabbix Agent 2 (6.0.6)" |3 n0 [) A. d! k; w
Dec 11 17:09:43 localhost.localdomain zabbix_agent2[2635]: Zabbix Agent2 hostname: [192.168.8.112]3 f" I' U4 t5 B5 C
Dec 11 17:09:43 localhost.localdomain zabbix_agent2[2635]: Press Ctrl+C to exit.: K; g8 [) d( n& G) f  d& z6 R9 u
[root@localhost ~]# ; d4 @  H% C; F  u. ^( F$ T: H0 |9 k

4 {, r, x  [3 x' L! y
' j8 C. G3 Q; m% x问题解决了。# D6 g' r0 P8 T8 V2 r) _: K& R

" F8 B2 R3 y) t/ p$ E% l1 e
! y0 f' P( `& @5 B" w

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2024-12-11 17:15:23 | 显示全部楼层
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-12 03:05 , Processed in 0.015061 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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