找回密码
 注册
查看: 33|回复: 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
- s% p3 ]* l1 x2 f% m. F● zabbix-agent2.service - Zabbix Agent 2
9 P4 V7 s7 p4 `   Loaded: loaded (/usr/lib/systemd/system/zabbix-agent2.service; enabled; vendor preset: disabled)
% Z3 h- s& m4 u  j! w   Active: activating (auto-restart) (Result: exit-code) since Wed 2024-12-11 17:05:53 CST; 2s ago
2 L4 y+ R& E* p: i8 I$ ?+ X  Process: 2540 ExecStart=/usr/sbin/zabbix_agent2 -c $CONFFILE (code=exited, status=127)! x% Z- ~' v7 F( N. M* G
Main PID: 2540 (code=exited, status=127)
! y; ~# c; w$ _# g: U6 i9 A
& B" o' t6 ]5 j( G+ ADec 11 17:05:53 localhost.localdomain systemd[1]: zabbix-agent2.service: main process exited, code=exited, status=127/n/a
9 v* F$ S* r3 o8 |+ oDec 11 17:05:53 localhost.localdomain systemd[1]: Unit zabbix-agent2.service entered failed state.
6 U1 j/ O* J& t, [4 b; M. U' Z+ ADec 11 17:05:53 localhost.localdomain systemd[1]: zabbix-agent2.service failed.
& W3 L4 H; O+ [6 r7 }/ ?! j
0 Y- h+ ^6 |3 z/ i7 K6 K" R: b查看message日志发现:
( Y- c! ]+ H' D: _0 V4 ?3 A! E& X
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
) K0 D1 ~* G& H" o1 I) sDec 11 17:09:22 localhost systemd: zabbix-agent2.service: main process exited, code=exited, status=127/n/a
8 X6 R' e. X* n" aDec 11 17:09:22 localhost systemd: Unit zabbix-agent2.service entered failed state.
4 s! ^& S% W6 C- HDec 11 17:09:22 localhost systemd: zabbix-agent2.service failed.' }6 @$ U! y, z& \
Dec 11 17:09:33 localhost systemd: zabbix-agent2.service holdoff time over, scheduling restart.' `0 S3 R, B" z: u% w$ \3 h
Dec 11 17:09:33 localhost systemd: Stopped Zabbix Agent 2.
0 H4 {6 z/ T: E5 rDec 11 17:09:33 localhost systemd: Started Zabbix Agent 2." x7 i# A% g$ J5 @/ R- Y
Dec 11 17:09:33 localhost systemd: zabbix-agent2.service: main process exited, code=exited, status=127/n/a& }- M. z3 h! a- U
Dec 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
/ ~, B: @0 a) t( lDec 11 17:09:33 localhost systemd: Unit zabbix-agent2.service entered failed state.0 f* O5 M3 |  s5 l4 o5 E
Dec 11 17:09:33 localhost systemd: zabbix-agent2.service failed./ e+ Z  N; Y! d  _+ f/ @
8 o1 f" X3 f" b
; h. z5 z* f3 S. Y; ^0 t
[root@localhost ~]# vim /etc/zabbix/zabbix_agent2.conf
1 c3 h6 p$ V! ^( c1 u% D8 \1 j, U, q[root@localhost ~]# systemctl restart zabbix-agent2.service ) _0 V7 r) d' w- b2 S/ @7 q

% v# W2 F. _) F6 v8 l, ?原来是缺包:% N/ q) Q3 l( B+ x: d# |" w
[root@localhost ~]# yum provides libpcre2-8.so.0
3 [0 a+ W# n: d3 I* bLoaded plugins: fastestmirror/ K) ~- e* W3 V, }2 F3 [. T
Loading mirror speeds from cached hostfile
9 _' u! {5 _% R3 `/ X% c0 N* l * base: mirrors.aliyun.com3 O+ {0 M0 j, s( d& K
* extras: mirrors.aliyun.com
9 @4 i0 ~9 ]3 D' [( ]* K# d3 g * updates: mirrors.aliyun.com
0 S8 H$ v4 S6 `: k$ tpcre2-10.23-2.el7.i686 : Perl-compatible regular expression library
; m. J; c# {6 \Repo        : base
2 h) P6 z# r( ~9 a; mMatched from:
: \4 J1 [9 z1 u7 E( Y1 G/ @3 _: l  A7 iProvides    : libpcre2-8.so.0! [7 h  a! O1 _- u" j7 ^) v

* a3 b* M4 ?& ]- g/ g
3 y# R. N: _8 m* r; U8 p% b( b  g$ ~, I/ ]  n/ b# [
接下来安装包吧:" w7 t* Y- n# q* X$ D9 r* P* w$ A
# C; x; o3 z  i
[root@localhost ~]# yum install -y pcre2  o' b* F" C! ?5 w3 `" O( P  O" \
Loaded plugins: fastestmirror: o6 E& p7 J+ c+ a2 a
Loading mirror speeds from cached hostfile( n1 ~1 t3 t7 q0 n
* base: mirrors.aliyun.com5 ~6 E+ ?! b8 i! y
* extras: mirrors.aliyun.com* ?% q% ^% {+ R1 f
* updates: mirrors.aliyun.com
4 g+ d) a+ |! s1 q9 O7 @, E  t7 @Resolving Dependencies
8 y) `" @3 e+ }# Z--> Running transaction check
$ H$ U( b- a/ R/ Y% F0 c---> Package pcre2.x86_64 0:10.23-2.el7 will be installed2 B! P, T' o( I3 V6 l/ W3 g
--> Finished Dependency Resolution
1 V3 i: n) i7 c& @- Z8 G& ~* W# F5 m* w- N5 Z8 `" I
Dependencies Resolved: ?  h& X4 J: S) O) B( `
  |2 _+ v# z* M( C) M7 F1 r
==================================================================================================================================================================================================0 x. J; g+ p9 t* Q# h0 }1 n
Package                                      Arch                                          Version                                             Repository                                   Size/ N+ X" c3 a7 L; Q) d
==================================================================================================================================================================================================9 O- y; ]9 q$ V( g: f+ w9 u
Installing:4 f2 {. r9 V& d& V& }
pcre2                                        x86_64                                        10.23-2.el7                                         base                                        201 k; d; T# A) L/ a: _
; [$ ]7 o! r; Y; b) ]
Transaction Summary
8 E! s9 G0 B: Q% b0 J==================================================================================================================================================================================================
: F& c) m# e! F: ^Install  1 Package
! H1 s9 g( j$ G/ j! L" P3 z: r! k5 X+ n- h
Total download size: 201 k% S3 p. z; Q$ t2 V' C% a4 h* }' Z% f* k
Installed size: 556 k
$ G  ~' U4 v0 X0 fDownloading packages:3 B) a6 Q$ N; ~" N
pcre2-10.23-2.el7.x86_64.rpm                                                                                                                                               | 201 kB  00:00:00     
+ Q' Z! A6 Z+ Y, p0 rRunning transaction check2 I, a7 d; |( g+ F, a
Running transaction test
) C; @0 Q! d5 a* k* uTransaction test succeeded
' e5 P% ?7 H% Q* r; H: `Running transaction6 _3 `6 W* \% ^1 O$ q
Warning: RPMDB altered outside of yum.* i/ n4 _/ R- P! g8 I3 ?
** Found 1 pre-existing rpmdb problem(s), 'yum check' output follows:
/ }& W0 Q1 _$ S$ g# P- N  d% fzabbix-agent2-6.0.6-1.el7.x86_64 has missing requires of libpcre2-8.so.0()(64bit)
5 ^/ C  O& q5 _7 q5 H0 L. r  Installing : pcre2-10.23-2.el7.x86_64                                                                                                                                                       1/1
/ N& _& g$ J! X0 |# |  Verifying  : pcre2-10.23-2.el7.x86_64                                                                                                                                                       1/1 9 X4 Y$ P" l2 u0 r

/ q& d+ j) @! b) E0 j" BInstalled:3 q' ^7 h# Q6 ^4 e
  pcre2.x86_64 0:10.23-2.el7                                                                                                                                                                     
- S8 \( o) w" ~* ]! M3 T  x- c* Z/ _/ r. Q$ L5 \3 [& {2 h) _
Complete!7 s4 \! h8 M  d. M
[root@localhost ~]# systemctl status zabbix-agent2.service / a& {& W4 i+ }, y: M' f
● zabbix-agent2.service - Zabbix Agent 2
3 G; P. {& X7 b* V- w8 B2 o9 }   Loaded: loaded (/usr/lib/systemd/system/zabbix-agent2.service; enabled; vendor preset: disabled)6 {1 ^: s0 O' ^' S/ V1 j
   Active: active (running) since Wed 2024-12-11 17:09:43 CST; 13s ago
% M+ _8 c$ I8 C& n7 K1 Q4 A0 T% I Main PID: 2635 (zabbix_agent2)
" F, ]# Q2 N  K   CGroup: /system.slice/zabbix-agent2.service
; p% P/ s. _8 E           └─2635 /usr/sbin/zabbix_agent2 -c /etc/zabbix/zabbix_agent2.conf
3 Y0 \1 _! f: ~9 p- ~0 m$ U# ]
+ ^; K3 s1 y, X, iDec 11 17:09:43 localhost.localdomain systemd[1]: Started Zabbix Agent 2.
0 _2 C! Q8 }8 ^Dec 11 17:09:43 localhost.localdomain zabbix_agent2[2635]: Starting Zabbix Agent 2 (6.0.6)" h: F  q3 J2 H2 |6 ^6 m' N
Dec 11 17:09:43 localhost.localdomain zabbix_agent2[2635]: Zabbix Agent2 hostname: [192.168.8.112]
5 i# p( k3 y: `& l8 CDec 11 17:09:43 localhost.localdomain zabbix_agent2[2635]: Press Ctrl+C to exit.
3 w+ |6 t% a% r" P" u5 |( l[root@localhost ~]#
- h! g- u4 v/ F5 ~7 t9 f& b" }" j* U9 g5 E

5 P* k* q2 g$ C  |8 R7 O问题解决了。/ a9 [5 o$ |+ q
8 x- _& Z, V/ P

/ W, f+ O/ K& C* ?  _

1

主题

0

回帖

12

积分

管理员

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

本版积分规则

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

GMT+8, 2026-6-12 00:41 , Processed in 0.018322 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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