弹簧云船长在启动后立即出现了本地microk8s

发布于 2025-01-20 21:03:03 字数 7775 浏览 3 评论 0原文

我正在尝试将整个弹簧云数据流平台部署到在我们的服务器之一上运行的Microk8s群集,即带有Ubuntu 20.04的VM。在开始在目标服务器上执行操作之前,我尝试将其部署在本地计算机(同一操作系统)上,甚至成功并创建/运行了一个流。尽管如此,我目前在本地计算机和VM上都遇到错误,我无法确定根本原因。

我目前的情况:

我正在关注官方指南 kubectl,唯一的区别是我使用的是v2.9.4,最新的写作时,而不是v2.9.1。我还跳过了监视框架的配置,因此如文档中建议的那样,评论了SCDF服务器的配置中的相关行。 KAFKA消息经纪和MySQL数据库将无问题部署。

但是,在执行Kubectl命令为船长创建配置映射,服务和部署之后,我可以看到Skipper Pod处于状态“ CrashloopBackoff”。检查POD的日志,我唯一看到的是该应用程序似乎启动后立即终止:

[...]
2022-04-11 15:00:11.713  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 7577 (http) with context path ''
2022-04-11 15:00:11.907  INFO 1 --- [           main] o.s.c.s.s.app.SkipperServerApplication   : Started SkipperServerApplication in 78.901 seconds (JVM running for 82.435)
2022-04-11 15:00:12.531  INFO 1 --- [ionShutdownHook] o.s.s.s.DefaultStateMachineService       : Entering stop sequence, stopping all managed machines
2022-04-11 15:00:12.617  INFO 1 --- [ionShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2022-04-11 15:00:12.703  INFO 1 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
2022-04-11 15:00:12.799  INFO 1 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.

Native Memory Tracking:

Total: reserved=961864767, committed=325411903
-                 Java Heap (reserved=356515840, committed=138334208)
                            (mmap: reserved=356515840, committed=138334208) 
 
-                     Class (reserved=269444100, committed=94409732)
                            (classes #17623)
                            (  instance classes #16455, array classes #1168)
                            (malloc=3355652 #45645) 
                            (mmap: reserved=266088448, committed=91054080) 
                            (  Metadata:   )
                            (    reserved=79691776, committed=78340096)
                            (    used=76414680)
                            (    free=1925416)
                            (    waste=0 =0.00%)
                            (  Class space:)
                            (    reserved=186396672, committed=12713984)
                            (    used=11544696)
                            (    free=1169288)
                            (    waste=0 =0.00%)
 
-                    Thread (reserved=14794856, committed=1323112)
                            (thread #14)
                            (stack: reserved=14729216, committed=1257472)
                            (malloc=51792 #86) 
                            (arena=13848 #25)
 
-                      Code (reserved=255686068, committed=26629556)
                            (malloc=2053556 #8654) 
                            (mmap: reserved=253632512, committed=24576000) 
 
-                        GC (reserved=1728178, committed=1019570)
                            (malloc=560818 #2163) 
                            (mmap: reserved=1167360, committed=458752) 
 
-                  Compiler (reserved=35543622, committed=35543622)
                            (malloc=71174 #1162) 
                            (arena=35472448 #19)
 
-                  Internal (reserved=432627, committed=432627)
                            (malloc=399859 #1104) 
                            (mmap: reserved=32768, committed=32768) 
 
-                     Other (reserved=10248, committed=10248)
                            (malloc=10248 #3) 
 
-                    Symbol (reserved=22101496, committed=22101496)
                            (malloc=19867360 #240000) 
                            (arena=2234136 #1)
 
-    Native Memory Tracking (reserved=4899928, committed=4899928)
                            (malloc=9656 #122) 
                            (tracking overhead=4890272)
 
-               Arena Chunk (reserved=81808, committed=81808)
                            (malloc=81808) 
 
-                   Tracing (reserved=1, committed=1)
                            (malloc=1 #1) 
 
-                   Logging (reserved=4572, committed=4572)
                            (malloc=4572 #192) 
 
-                 Arguments (reserved=19063, committed=19063)
                            (malloc=19063 #495) 
 
-                    Module (reserved=310496, committed=310496)
                            (malloc=310496 #2710) 
 
-              Synchronizer (reserved=283672, committed=283672)
                            (malloc=283672 #2348) 
 
-                 Safepoint (reserved=8192, committed=8192)
                            (mmap: reserved=8192, committed=8192)

无论启动了多少次POD,它始终在此阶段退出。这是kubectl的输出获取所有

NAME                            READY   STATUS             RESTARTS       AGE
pod/kafka-zk-6b6f4976cf-9hjzn   1/1     Running            0              69m
pod/kafka-broker-0              1/1     Running            0              58m
pod/mysql-7c57b4cfdf-njb97      1/1     Running            0              39m
pod/skipper-b46bfd5fd-wrnqv     0/1     CrashLoopBackOff   13 (57s ago)   38m

NAME                   TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)                      AGE
service/kubernetes     ClusterIP      10.152.183.1     <none>        443/TCP                      148m
service/kafka-zk       ClusterIP      10.152.183.62    <none>        2181/TCP,2888/TCP,3888/TCP   69m
service/kafka-broker   ClusterIP      None             <none>        9092/TCP                     69m
service/mysql          ClusterIP      10.152.183.139   <none>        3306/TCP                     40m
service/skipper        LoadBalancer   10.152.183.250   <pending>     80:31955/TCP                 38m

NAME                       READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/kafka-zk   1/1     1            1           69m
deployment.apps/mysql      1/1     1            1           39m
deployment.apps/skipper    0/1     1            0           38m

NAME                                  DESIRED   CURRENT   READY   AGE
replicaset.apps/kafka-zk-6b6f4976cf   1         1         1       69m
replicaset.apps/mysql-7c57b4cfdf      1         1         1       39m
replicaset.apps/skipper-b46bfd5fd     1         1         0       38m

NAME                            READY   AGE
statefulset.apps/kafka-broker   1/1     69m

我尝试的内容:

  • 将船长服务类型从loadbalancer更改为nodeport(我尚未启用metallb,因此未提供负载平衡),但没有起作用;
  • 更改容器暴露的端口,在默认配置中是端口80,我将其更改为7577(也在服务配置中),但是错误仍然发生。
  • 降级到船长的版本2.8.2,在上面的文档中相同,行为完全相同。

通过设置logging.level.org.springframework提高日志记录级Google:

[...]
2022-04-11 15:22:38.818 DEBUG 1 --- [           main] o.s.c.c.CompositeCompatibilityVerifier   : All conditions are passing
2022-04-11 15:22:39.098 DEBUG 1 --- [           main] ocalVariableTableParameterNameDiscoverer : Cannot find '.class' file for class [class org.springframework.statemachine.boot.autoconfigure.StateMachineAutoConfiguration$StateMachineMonitoringConfiguration$$EnhancerBySpringCGLIB$$b266f314] - unable to determine constructor/method parameter names
2022-04-11 15:22:39.925  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 7577 (http) with context path ''
2022-04-11 15:22:40.244  INFO 1 --- [           main] o.s.c.s.s.app.SkipperServerApplication   : Started SkipperServerApplication in 76.267 seconds (JVM running for 79.716)
[...]

有人可以建议我下一步要做什么,还是给我一些进一步诊断此问题的方法?

I'm trying to deploy the entire Spring Cloud Data Flow platform to a MicroK8s cluster running on one of our server, a VM with Ubuntu 20.04. Before starting performing actions on the target server, I tried to deploy it on my local computer (same OS) and I even succeeded and created/run one stream. Nevertheless, I am currently experiencing an error both on my local computer and on the VM, and I can't manage to pinpoint the root cause.

My current situation:

I'm following the official guide for deploying SCDF using kubectl, only difference being that I'm using tag v2.9.4, latest at the time of writing, instead of v2.9.1. I also skipped the configuration of monitoring frameworks, and hence commented the relevant lines in the configuration of SCDF server, as suggested in the docs. Kafka message broker and MySQL database are deployed without issues.

But, after executing kubectl commands to create config map, service and deployment for Skipper, I can see that Skipper pod goes in status "CrashLoopBackOff". Checking the logs of the pod, the only thing I see is that the application is terminated right after it seems to have started:

[...]
2022-04-11 15:00:11.713  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 7577 (http) with context path ''
2022-04-11 15:00:11.907  INFO 1 --- [           main] o.s.c.s.s.app.SkipperServerApplication   : Started SkipperServerApplication in 78.901 seconds (JVM running for 82.435)
2022-04-11 15:00:12.531  INFO 1 --- [ionShutdownHook] o.s.s.s.DefaultStateMachineService       : Entering stop sequence, stopping all managed machines
2022-04-11 15:00:12.617  INFO 1 --- [ionShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2022-04-11 15:00:12.703  INFO 1 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
2022-04-11 15:00:12.799  INFO 1 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.

Native Memory Tracking:

Total: reserved=961864767, committed=325411903
-                 Java Heap (reserved=356515840, committed=138334208)
                            (mmap: reserved=356515840, committed=138334208) 
 
-                     Class (reserved=269444100, committed=94409732)
                            (classes #17623)
                            (  instance classes #16455, array classes #1168)
                            (malloc=3355652 #45645) 
                            (mmap: reserved=266088448, committed=91054080) 
                            (  Metadata:   )
                            (    reserved=79691776, committed=78340096)
                            (    used=76414680)
                            (    free=1925416)
                            (    waste=0 =0.00%)
                            (  Class space:)
                            (    reserved=186396672, committed=12713984)
                            (    used=11544696)
                            (    free=1169288)
                            (    waste=0 =0.00%)
 
-                    Thread (reserved=14794856, committed=1323112)
                            (thread #14)
                            (stack: reserved=14729216, committed=1257472)
                            (malloc=51792 #86) 
                            (arena=13848 #25)
 
-                      Code (reserved=255686068, committed=26629556)
                            (malloc=2053556 #8654) 
                            (mmap: reserved=253632512, committed=24576000) 
 
-                        GC (reserved=1728178, committed=1019570)
                            (malloc=560818 #2163) 
                            (mmap: reserved=1167360, committed=458752) 
 
-                  Compiler (reserved=35543622, committed=35543622)
                            (malloc=71174 #1162) 
                            (arena=35472448 #19)
 
-                  Internal (reserved=432627, committed=432627)
                            (malloc=399859 #1104) 
                            (mmap: reserved=32768, committed=32768) 
 
-                     Other (reserved=10248, committed=10248)
                            (malloc=10248 #3) 
 
-                    Symbol (reserved=22101496, committed=22101496)
                            (malloc=19867360 #240000) 
                            (arena=2234136 #1)
 
-    Native Memory Tracking (reserved=4899928, committed=4899928)
                            (malloc=9656 #122) 
                            (tracking overhead=4890272)
 
-               Arena Chunk (reserved=81808, committed=81808)
                            (malloc=81808) 
 
-                   Tracing (reserved=1, committed=1)
                            (malloc=1 #1) 
 
-                   Logging (reserved=4572, committed=4572)
                            (malloc=4572 #192) 
 
-                 Arguments (reserved=19063, committed=19063)
                            (malloc=19063 #495) 
 
-                    Module (reserved=310496, committed=310496)
                            (malloc=310496 #2710) 
 
-              Synchronizer (reserved=283672, committed=283672)
                            (malloc=283672 #2348) 
 
-                 Safepoint (reserved=8192, committed=8192)
                            (mmap: reserved=8192, committed=8192)

No matter how many times the pod is restarted, it always exits at this phase. This is the output of kubectl get all

NAME                            READY   STATUS             RESTARTS       AGE
pod/kafka-zk-6b6f4976cf-9hjzn   1/1     Running            0              69m
pod/kafka-broker-0              1/1     Running            0              58m
pod/mysql-7c57b4cfdf-njb97      1/1     Running            0              39m
pod/skipper-b46bfd5fd-wrnqv     0/1     CrashLoopBackOff   13 (57s ago)   38m

NAME                   TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)                      AGE
service/kubernetes     ClusterIP      10.152.183.1     <none>        443/TCP                      148m
service/kafka-zk       ClusterIP      10.152.183.62    <none>        2181/TCP,2888/TCP,3888/TCP   69m
service/kafka-broker   ClusterIP      None             <none>        9092/TCP                     69m
service/mysql          ClusterIP      10.152.183.139   <none>        3306/TCP                     40m
service/skipper        LoadBalancer   10.152.183.250   <pending>     80:31955/TCP                 38m

NAME                       READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/kafka-zk   1/1     1            1           69m
deployment.apps/mysql      1/1     1            1           39m
deployment.apps/skipper    0/1     1            0           38m

NAME                                  DESIRED   CURRENT   READY   AGE
replicaset.apps/kafka-zk-6b6f4976cf   1         1         1       69m
replicaset.apps/mysql-7c57b4cfdf      1         1         1       39m
replicaset.apps/skipper-b46bfd5fd     1         1         0       38m

NAME                            READY   AGE
statefulset.apps/kafka-broker   1/1     69m

What I tried:

  • Changing the Skipper service type from LoadBalancer to NodePort (I have not enabled metallb so load balancing is not provided), but didn't work;
  • Changing the port exposed by the container, in the default configuration is port 80, I changed it to 7577 (also in the service configuration), but the error still occurs;
  • Downgraded to the version 2.8.2 of skipper, the same in the documentation above, the behaviour was exactly the same.

Increasing the logging level by setting logging.level.org.springframework to DEBUG and then to TRACE didn't result in anything useful showing up in the logs, except a cryptic line which I did not found anywhere on google:

[...]
2022-04-11 15:22:38.818 DEBUG 1 --- [           main] o.s.c.c.CompositeCompatibilityVerifier   : All conditions are passing
2022-04-11 15:22:39.098 DEBUG 1 --- [           main] ocalVariableTableParameterNameDiscoverer : Cannot find '.class' file for class [class org.springframework.statemachine.boot.autoconfigure.StateMachineAutoConfiguration$StateMachineMonitoringConfiguration$EnhancerBySpringCGLIB$b266f314] - unable to determine constructor/method parameter names
2022-04-11 15:22:39.925  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 7577 (http) with context path ''
2022-04-11 15:22:40.244  INFO 1 --- [           main] o.s.c.s.s.app.SkipperServerApplication   : Started SkipperServerApplication in 76.267 seconds (JVM running for 79.716)
[...]

Can anyone suggest me what to try next, or give me some way to further diagnosticate this issue?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文