简体   繁体   English

运行pid1的kubernetes pod内的Java进程

[英]java process inside kubernetes pod running with pid1

I have a scala app running as a docker container inside kubernetes pod. 我在kubernetes pod内有一个作为docker容器运行的scala应用程序。 I use sbt native packager to build the app. 我使用sbt本机打包程序来构建应用程序。 Now when I go into my app pod kubectl exec it pod sh , and do ps -ef | 现在,当我进入我的应用程序pod kubectl exec时,执行pod sh,然后执行ps -ef | grep Java I see that Java is running with pid 1 . grep Java我看到Java在pid 1下运行。 I want to change this to run my Java process with any other pid than 1. Can anyone help me with this? 我想更改它以使用除1之外的任何其他pid运行我的Java进程。有人可以帮助我吗?

The first process in your container will start with PID 1, and there is no way to change this behaviour. 容器中的第一个过程将从PID 1开始,并且无法更改此行为。 However, it is possible to run your app with other PID by using init process or supervisor for your Java app. 但是,可以通过对Java应用程序使用init进程或管理程序来运行具有其他PID的应用程序。 You can find detailed information about this approach in here 您可以在此处找到有关此方法的详细信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM