2024-10-03 21:27:31 发布
网友
我正试图使用ThreadedTCPServer部署用python编写的tcp服务器。在
ThreadedTCPServer
tcp
是否可以在beanstalk中运行此TCP服务器?
我不想使用或更改WSGI服务器。在
WSGI
我实现的一个临时解决方案是创建一个安装了tcp服务器的映像,当它启动时,它会自动启动服务器。我的beanstalk使用自定义的ami来创建新实例。在
ami
但是,这样做,我不能使用beanstalk(log,gitaws.push等)的好处
aws.push
您可以使用container_command来启动服务器进程。在
container_command
我已经在我的WSGI服务器旁边运行了一些后端进程,但是我不明白为什么没有WSGI服务器就不能这样做。在
这是我的电子分机/应用程序名.config文件:
container_commands: 01_kill_old_server: command: "pid=`ps -aefw | grep 'myserver.py' | grep -v ' grep ' | awk '{print $2}'`; kill -9 $pid > /dev/null 2>&1 " ignoreErrors: true 02_start_server: command: "nohup python ./myserver.py > foo.out 2> foo.err < /dev/null &"
每次使用git aws.push进行部署时,它都会终止旧进程并从新代码启动新进程。在
git aws.push
以下是container_commands文档:http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html#customize-containers-format-container_commands
container_commands
您可以使用
container_command
来启动服务器进程。在我已经在我的
WSGI
服务器旁边运行了一些后端进程,但是我不明白为什么没有WSGI服务器就不能这样做。在这是我的电子分机/应用程序名.config文件:
每次使用
git aws.push
进行部署时,它都会终止旧进程并从新代码启动新进程。在以下是
container_commands
文档:http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html#customize-containers-format-container_commands相关问题 更多 >
编程相关推荐