[英]How to run Google Bigquery query from dev machine (localhost)
How can I connect to Google BigQuery 'table' from Java app on my dev machine (localhost) and query the table in BigQuery? 如何通过开发机(本地主机)上的Java应用程序连接到Google BigQuery“表”并在BigQuery中查询表?
I am using the BigQuery java library https://cloud.google.com/bigquery/docs/reference/libraries 我正在使用BigQuery Java库https://cloud.google.com/bigquery/docs/reference/libraries
We want to deploy our java web application on-premise and send some data to BigQuery. 我们想在本地部署Java Web应用程序,然后将一些数据发送到BigQuery。
I see two possible ways: 我看到两种可能的方式:
Local development users - create users in the project for every developer, each will authenticate (gcloud auth ...) under their account and then the API client libs will just pick up the auth 本地开发用户 -为每个开发人员在项目中创建用户,每个用户都将在其帐户下进行身份验证(gcloud auth ...),然后API客户端库将仅获取身份验证
Service accounts - create a service account, download the JSON file and use it for authentication. 服务帐户 -创建服务帐户,下载JSON文件并将其用于身份验证。 For this there are 2 ways: 1 file for everybody (but it's risky - security wise... you should rotate the file often) or 1 file (thus 1 service account) for each developer... but this is harder to manage.
为此,有2种方法:每个人1个文件(但这很冒险-安全起见...您应该经常轮换文件)或每个开发人员1个文件(因此1个服务帐户)...但这很难管理。
As in the end the app will be on premise I would personally go for the service accounts approach. 最后,该应用程序将在内部部署,我个人将采用服务帐户方法。
See more at https://cloud.google.com/docs/authentication 详情请参阅https://cloud.google.com/docs/authentication
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.