我有一个带有profobuf服务的project,它工作得很好:
jamie@machine:~/imp/lb$ lb delete imp && lb services restart
...
jamie@machine:~/imp/lb$ lb create imp && lb compile project ~/imp/lb/imp.project && lb addproject imp ~/imp/lb
created workspace 'imp'
jamie@machine:~/imp/lb$ echo '{}' | lb web-client call http://127.0.0.1:8080/ui
{}但是当我添加branch services from the docs时,protobuf服务停止工作:
jamie@machine:~/imp/lb$ lb web-server load --config ~/imp/lb/branch-services.config
loaded static workspace imp
jamie@machine:~/imp/lb$ echo '{}' | lb web-client call http://127.0.0.1:8080/ui
<3>2017-01-18 04:28:26,72400+00:00 ERROR BatchDriver - Server Error from service: http://127.0.0.1:8080/ui (HTTP Status 404)
error: stm {
simple {
call_proto {
service: "http://127.0.0.1:8080/ui"
encoding: JSON
gzip: true
input {
binary: "{}\n"
}
output_file: "-"
format: false
method: POST
}
}
status: ERROR
exception: "Server Error from service: http://127.0.0.1:8080/ui (HTTP Status 404)"
end_time: "2017-01-18 12:28:26,72500+08:00"
start_time: "2017-01-18 12:28:26,56300+08:00"
}我需要以某种方式组合这些配置吗?他们是否需要生活在不同的工作空间中?
发布于 2017-01-19 00:18:40
您可能正在使用相同的前缀声明多个服务(例如/ui)。当发生这种情况时,服务器将卸载所有这些文件。
您可以在$LB_DEPLOYMENT_HOME/logs/current/lb-web-server.log中检查服务器做了什么(如果已部署,也可以在systemd的日志中查看)。
您还可以使用以下命令列出当前正在运行的服务:
lb web-server list -s发布于 2017-01-19 01:56:00
对于部署protobuf服务的工作区和附加分支服务的静态工作区,使用相同的名称。将静态工作区重命名为其他名称应该可以解决您的问题。
或者,您可以在工作区中声明分支服务,在那里您使用logiQL而不是json为protobuf服务提供服务。类似于:
service_by_prefix_and_method[["/imp/get-branch-names", "POST"]=x,
protobuf_service(x) {
custom_handler[] = "lb:web:connectblox:get_branch_names",
protobuf_protocol[] = "bloxweb_connectblox",
protobuf_request_message[] = "GetBranchNames",
protobuf_response_message[] = "GetBranchNamesResponse",
group("lb:web:internal")
}.https://stackoverflow.com/questions/41711484
复制相似问题