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

[ERROR FileContent--proc-sys-net-bridge-bridge-nf-call-iptables]: 问题解决

[复制链接]

70

主题

73

回帖

1201

积分

网站编辑

积分
1201
发表于 2024-9-15 10:34:17 | 显示全部楼层 |阅读模式
本帖最后由 1320503165 于 2024-9-15 10:51 编辑
( v: u* r; g' ?1 @. z0 g
0 T+ l1 e* A3 D  n0 |   [ERROR FileContent--proc-sys-net-bridge-bridge-nf-call-iptables]: /proc/sys/net/bridge/bridge-nf-call-iptables does not exist
* s3 S' A5 P- x' r    [ERROR FileContent--proc-sys-net-ipv4-ip_forward]: /proc/sys/net/ipv4/ip_forward contents are not set to 1
4 C+ i. J  M8 U9 _; {: E  x4 i( V# o! }) J6 {

- D5 E  n9 `- j. V. F# [9 g$ T# n$ C% j) u+ `

4 ~$ f/ H  S- x# v[root@kubernetes-master net]# vim /etc/sysctl.d/k8s.conf7 C! N. s: V& h1 \8 A
[root@kubernetes-master net]# modprobe br_netfilter4 Z# \- f! X' Q5 ^
[root@kubernetes-master net]# sysctl --system /etc/sysctl.d/k8s.conf 8 C2 |* a& y. p4 l: N3 S! j* L
* Applying /usr/lib/sysctl.d/00-system.conf ...  [+ a0 a2 i' o. x3 q& E2 _  C
net.bridge.bridge-nf-call-ip6tables = 0* E6 S8 p( _* V% M. W
net.bridge.bridge-nf-call-iptables = 0% A9 D  F# G$ [1 n! L
net.bridge.bridge-nf-call-arptables = 0
  D" o, \$ ]! d. M; o2 G9 W2 G( h9 d* Applying /usr/lib/sysctl.d/10-default-yama-scope.conf ...$ V8 I! G4 D9 w. J/ D8 }
kernel.yama.ptrace_scope = 0% V. b" t3 {: ]( q
* Applying /usr/lib/sysctl.d/50-default.conf ...
0 S6 d4 |$ ^/ ~kernel.sysrq = 16
; d) O6 b+ w3 d2 Z. R" `kernel.core_uses_pid = 1
" h6 c; B( J- v. g9 r0 m$ skernel.kptr_restrict = 1( d$ S# k5 a. o& z3 s* t
net.ipv4.conf.default.rp_filter = 19 y' o: T; j$ I! n
net.ipv4.conf.all.rp_filter = 1
# ^/ P9 K0 _* r' }: e$ W8 Snet.ipv4.conf.default.accept_source_route = 0. O: S/ {! B- o  `' Y  @$ m
net.ipv4.conf.all.accept_source_route = 0
6 I/ ?4 f5 ^# K0 I" L( M5 ^net.ipv4.conf.default.promote_secondaries = 1' z0 `2 a- Y( v9 f$ z. w
net.ipv4.conf.all.promote_secondaries = 1$ D0 p9 n& U7 d7 Q) K
fs.protected_hardlinks = 1- E3 T% Q% O% B- g: w
fs.protected_symlinks = 19 k+ _- }! s/ L2 H
* Applying /etc/sysctl.d/99-sysctl.conf ...! J# ^. e1 X$ l# M) k/ _$ F
kernel.pid_max = 316448
% v9 G/ A6 c; m/ N+ @; H/ {* Applying /etc/sysctl.d/k8s.conf ...2 n9 y) }. N* y6 r, L5 D- C+ C: G
net.bridge.bridge-nf-call-ip6tables = 1
7 J0 h$ g' o/ n. u1 i: `$ hnet.bridge.bridge-nf-call-iptables = 1* ]! J, \6 P8 T+ N
* Applying /etc/sysctl.conf ...
) n- j7 @( m6 J) Kkernel.pid_max = 316448/ m  Q, ]* j/ C4 I/ P
[root@kubernetes-master net]# kubeadm init --apiserver-advertise-address=192.168.8.190  --image-repository registry.aliyuncs.com/google_containers  --kubernetes-version v1.28.0 --service-cidr=10.177.100.0/12 --pod-network-cidr=10.233.0.0/16  --cri-socket=unix:///var/run/cri-dockerd.sock  # M8 z, D! v, x  s5 ]9 e7 i
[init] Using Kubernetes version: v1.28.0
$ F  R/ W/ D8 W1 u6 S5 ^[preflight] Running pre-flight checks$ x- a9 {6 G1 F
error execution phase preflight: [preflight] Some fatal errors occurred:
: Q6 n5 X7 l+ v" [4 S* H    [ERROR CRI]: container runtime is not running: output: E0915 10:46:46.870746    2864 remote_runtime.go:616] "Status from runtime service failed" err="rpc error: code = Unavailable desc = connection closed before server preface received"
" B. m9 o3 Q. btime="2024-09-15T10:46:46+08:00" level=fatal msg="getting status of runtime: rpc error: code = Unavailable desc = connection closed before server preface received"
+ F+ u/ I! [( P( y% L) o9 W3 Z: ^/ M, error: exit status 10 B6 z& `, l  o3 O0 T8 `# z9 A, V6 C
    [ERROR FileContent--proc-sys-net-ipv4-ip_forward]: /proc/sys/net/ipv4/ip_forward contents are not set to 1' a' ?% x% `# z: X! T
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`/ O: l3 ~( c2 f: A" A" o
To see the stack trace of this error execute with --v=5 or higher6 v0 W4 n/ q0 Q$ x/ R
[root@kubernetes-master net]# docker ps
: m7 G+ u- [6 v$ H2 y2 w5 D0 Y9 [) O: S# Q8 Z2 ^" s
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?& y2 l. u( w. }1 m5 M) m( S
[root@kubernetes-master net]# 2 Q7 R! e7 I" Y" {, ~" Z- s
[root@kubernetes-master net]# systemctl restart docker.service $ F% c3 ~2 e. o. r
[root@kubernetes-master net]# docker ps ( j: S4 y- J+ {- b1 E" y
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
( o" [+ B. Q, w* R& g' b, x' m6 b[root@kubernetes-master net]# systemctl enable docker.service 5 o8 x+ |) L! r7 L+ Z
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.$ B+ a$ H2 |4 L' p3 M
[root@kubernetes-master net]# systemctl status cri-docker.service
; K! V; C& Z1 G$ l; B* b1 e● cri-docker.service - CRI Interface for Docker Application Container Engine5 C" _) u6 M' I. U# d6 j2 _. x" P. t1 Y
   Loaded: loaded (/usr/lib/systemd/system/cri-docker.service; enabled; vendor preset: disabled)
: L  o/ ]$ Z8 x! p* ]   Active: failed (Result: start-limit) since Sun 2024-09-15 10:46:51 CST; 1min 37s ago
. X3 `: @  P- F( m8 M5 |% _, q# q     Docs: https://docs.mirantis.com  w0 v" m: j  v' ?; w
Main PID: 2909 (code=exited, status=1/FAILURE)
% f3 G+ q9 t! ^! d2 Y; X4 S% h) f8 ^* Q
Sep 15 10:46:49 kubernetes-master systemd[1]: Failed to start CRI Interface for Docker Application C...ne.' U4 d! y0 X  u9 d  c9 ~. ~5 b3 R
Sep 15 10:46:49 kubernetes-master systemd[1]: Unit cri-docker.service entered failed state.
; C$ m2 g( T) h& WSep 15 10:46:49 kubernetes-master systemd[1]: cri-docker.service failed.( M7 _, P3 c* g* P1 D( ?# h
Sep 15 10:46:51 kubernetes-master systemd[1]: cri-docker.service holdoff time over, scheduling restart.4 O3 ^9 u% E1 Z: h- |: g6 l
Sep 15 10:46:51 kubernetes-master systemd[1]: Stopped CRI Interface for Docker Application Container...ne.
) S% Q% i2 @9 N( L6 {/ I1 |Sep 15 10:46:51 kubernetes-master systemd[1]: start request repeated too quickly for cri-docker.service
) t7 }  C: o, B* n: c7 J& e3 hSep 15 10:46:51 kubernetes-master systemd[1]: Failed to start CRI Interface for Docker Application C...ne., J- L) W& u- {% r
Sep 15 10:46:51 kubernetes-master systemd[1]: Unit cri-docker.service entered failed state.( Q6 l; N* O* Y0 a- O
Sep 15 10:46:51 kubernetes-master systemd[1]: cri-docker.service failed.; B, m1 P% W7 X* h4 `
Hint: Some lines were ellipsized, use -l to show in full.
/ Y" M, N& L! t4 L: N[root@kubernetes-master net]# systemctl restart cri-docker.service # a7 R3 ?% I& }' Z6 Q& x
[root@kubernetes-master net]# systemctl status cri-docker.service
+ F$ w6 Q3 W+ k4 w( Y% \0 o● cri-docker.service - CRI Interface for Docker Application Container Engine7 Z, G& S4 U$ e' |" P8 K2 v6 C
   Loaded: loaded (/usr/lib/systemd/system/cri-docker.service; enabled; vendor preset: disabled); C* E# w6 `8 n2 `" C
   Active: active (running) since Sun 2024-09-15 10:48:38 CST; 1s ago
) R# G' S# x. m' l     Docs: https://docs.mirantis.com1 ~% E, ?& n1 j' h* W0 q
Main PID: 3339 (cri-dockerd)
* R  ^! d& C- ^    Tasks: 8
. _) |0 [: K' Q+ a4 N" U   Memory: 16.2M* h! ~8 j; `: P1 p- E# Y
   CGroup: /system.slice/cri-docker.service2 G' K* a6 H/ Y) \! L1 ^+ i
           └─3339 /usr/bin/cri-dockerd --container-runtime-endpoint fd:// --pod-infra-container-image=r...
- T) m8 \3 o: ?, s7 @* @# O
3 \+ ?$ l6 j! U0 F, U. l; fSep 15 10:48:38 kubernetes-master cri-dockerd[3339]: time="2024-09-15T10:48:38+08:00" level=info msg...0s"2 {# o, S2 g% d4 @3 v: _, O
Sep 15 10:48:38 kubernetes-master cri-dockerd[3339]: time="2024-09-15T10:48:38+08:00" level=info msg...ne"3 q4 O1 \% d2 _" U5 i2 C! G
Sep 15 10:48:38 kubernetes-master cri-dockerd[3339]: time="2024-09-15T10:48:38+08:00" level=info msg...ni"
- U& D/ i+ y( m) u0 WSep 15 10:48:38 kubernetes-master cri-dockerd[3339]: time="2024-09-15T10:48:38+08:00" level=info msg...ni"8 U7 k' |; {/ S. q6 {
Sep 15 10:48:38 kubernetes-master cri-dockerd[3339]: time="2024-09-15T10:48:38+08:00" level=info msg...ive1 a3 b. [% f. v
Sep 15 10:48:38 kubernetes-master cri-dockerd[3339]: time="2024-09-15T10:48:38+08:00" level=info msg...fs"
& _" O- [, i8 vSep 15 10:48:38 kubernetes-master systemd[1]: Started CRI Interface for Docker Application Container...ne.! Q; l+ R% ^+ n, g5 f! G
Sep 15 10:48:38 kubernetes-master cri-dockerd[3339]: time="2024-09-15T10:48:38+08:00" level=info msg...,}"% L% C" ^+ I: ?) N2 Q
Sep 15 10:48:38 kubernetes-master cri-dockerd[3339]: time="2024-09-15T10:48:38+08:00" level=info msg...e."
& @. E3 v5 Q: b( z% g6 SSep 15 10:48:38 kubernetes-master cri-dockerd[3339]: time="2024-09-15T10:48:38+08:00" level=info msg...nd"& D; T! e/ h, F3 L+ x/ u, ^4 P
Hint: Some lines were ellipsized, use -l to show in full.
. O% D5 m( O- S$ U% M
+ o; D5 e6 a% F% L7 i

70

主题

73

回帖

1201

积分

网站编辑

积分
1201
 楼主| 发表于 2024-9-15 10:52:11 | 显示全部楼层
[root@kubernetes-master net]# kubeadm init --apiserver-advertise-address=192.168.8.190  --image-repository registry.aliyuncs.com/google_containers  --kubernetes-version v1.28.0 --service-cidr=10.177.100.0/12 --pod-network-cidr=10.233.0.0/16  --cri-socket=unix:///var/run/cri-dockerd.sock  
- b6 o7 Z+ t* J2 L/ J[init] Using Kubernetes version: v1.28.02 \1 k$ h6 \) @1 A- ^* Z5 s
[preflight] Running pre-flight checks" Q6 a, [% m3 n5 M8 R' b7 y
[preflight] Pulling images required for setting up a Kubernetes cluster
8 v$ Z5 Z4 u# o+ P[preflight] This might take a minute or two, depending on the speed of your internet connection$ _6 j( ]6 F# c' ]8 m' J
[preflight] You can also perform this action in beforehand using 'kubeadm config images pull'
% d9 N  |7 R1 @' |/ V! Z: N8 K8 Y4 O  ]
) o/ _' @+ h; y  d, V  s% Z
也就是说docker未启动就会报错
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-12 00:28 , Processed in 0.017926 second(s), 21 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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