gpt4 book ai didi

python - 从 Linux 终端运行 dev_appserver.py

转载 作者:太空宇宙 更新时间:2023-11-04 03:39:32 27 4
gpt4 key购买 nike

我最近在 Google Compute Engine 上启动了一个虚拟机,目的是在云中创建一个开发环境。

我有源代码并安装了 Google Cloud SDK 和 App-Engine SDK。但是,当我尝试运行 dev_appserver.py 时,即使确保创建了防火墙规则,我也会收到以下错误。

x@dev:~/code$ dev_appserver.py --host dev.cfcmelbourne.org --port=8080 cfc/
INFO 2015-05-20 12:54:22,744 sdk_update_checker.py:229] Checking for updates to the SDK.
INFO 2015-05-20 12:54:23,280 sdk_update_checker.py:273] This SDK release is newer than the advertised release.
INFO 2015-05-20 12:54:23,361 api_server.py:190] Starting API server at: http://localhost:38624
INFO 2015-05-20 12:54:23,441 api_server.py:615] Applying all pending transactions and saving the datastore
INFO 2015-05-20 12:54:23,441 api_server.py:618] Saving search indexes
Traceback (most recent call last):
File "/home/xxx/software/google_appengine/dev_appserver.py", line 83, in <module>
_run_file(__file__, globals())
File "/home/xxx/software/google_appengine/dev_appserver.py", line 79, in _run_file
execfile(_PATHS.script_file(script_name), globals_)
File "/home/xxx/software/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 1002, in <module>
main()
File "/home/xxx/software/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 995, in main
dev_server.start(options)
File "/home/xxx/software/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 798, in start
self._dispatcher.start(options.api_host, apis.port, request_data)
File "/home/xxx/software/google_appengine/google/appengine/tools/devappserver2/dispatcher.py", line 189, in start
_module.start()
File "/home/xxx/software/google_appengine/google/appengine/tools/devappserver2/module.py", line 1174, in start
self._balanced_module.start()
File "/home/xxx/software/google_appengine/google/appengine/tools/devappserver2/wsgi_server.py", line 315, in start
self._start_all_fixed_port(host_ports)
File "/home/xxx/software/google_appengine/google/appengine/tools/devappserver2/wsgi_server.py", line 352, in _start_all_fixed_port
raise BindError('Unable to bind %s:%s' % self.bind_addr)
google.appengine.tools.devappserver2.wsgi_server.BindError: Unable to bind dev.cfcmelbourne.org:8080
xxx@dev:~/code$

防火墙规则明确允许8080 TCP访问。

enter image description here

最佳答案

以 root 用户身份运行 netstat -tulpn 以查看其是否是在端口 8080 上运行的进程。键入 fusionr 8080/tcp 以获取在端口 8080 上运行的进程的 PID 并终止该端口,或者只需将参数 -k 与 fusionr 命令一起使用,即 fusione -k 8080/tcp 来终止该进程。它对我来说工作得很好。

关于python - 从 Linux 终端运行 dev_appserver.py,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30350560/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com