小编eri*_*cco的帖子

GitHub存储库未在Google搜索中列出

我用GitHub创建了我的第一个存储库但是当我尝试谷歌时,它没有列出 RoboSpice-Extn-Retrofit-Tutorial

编辑

我不知道需要多长时间.另一方面,任何人都可以获得谷歌网站管理员的帮助,这将在几分钟内解决您的问题:)

github listings

28
推荐指数
3
解决办法
2万
查看次数

无需选择器即可访问包装在服务中的外部数据库资源

我在 Google Cloud 中创建了一个托管 Postgres 数据库。该数据库获得了外部 IP 地址。第二步,我创建了一个 Kubernetes 集群。在 k8s 中,我想访问这个外部数据库。因此,我创建了一个没有标签选择器的服务,但有一个指向我的 Postgres 数据库的外部端点。

我必须允许 Postgres 数据库从(三个)集群节点访问。我在 Google Cloud Console (SQL) 中进行了配置。

我的第一个问题:这是集成外部数据库的正确方法吗?特别是这个IP访问配置?

为了测试我对数据库的连接,我的第一次尝试是从本地主机建立端口转发。我的想法是通过我的 Database-IDE(datagrip)访问这个数据库。但是,当尝试建立端口转发时,出现以下错误:

error: cannot attach to *v1.Service: invalid service 'postgres-bla-bla': Service is defined without a selector
Run Code Online (Sandbox Code Playgroud)

第二个问题:如何在本地访问该服务?

在第三步中,我使用 'partlab/ubuntu-postgresql' docker-image 创建了一个 pod。我做了一个 'kctrl exec -it ... ' 并且可以访问我的 Postgres 数据库

psql -h postgres-bla-bla ...
Run Code Online (Sandbox Code Playgroud)

所以基本上它有效。但我确信我的解决方案有一些缺陷。我可以做什么更好?如何解决问题 2 中的问题?

postgresql google-cloud-platform kubernetes

7
推荐指数
2
解决办法
2442
查看次数

如何将文件从互联网直接下载到 Google Cloud 存储桶

我想从互联网上直接下载一个超过20GB的文件到google云存储桶中。就像在本地命令行中执行以下操作一样:

wget http://some.url.com/some/file.tar 
Run Code Online (Sandbox Code Playgroud)

我拒绝将文件下载到我自己的计算机上,然后使用以下命令将文件复制到存储桶中:

gsutil cp file.tar gs://the-bucket/
Run Code Online (Sandbox Code Playgroud)

目前我正在尝试(就在此时)使用 datalab 下载文件,然后将文件从那里复制到存储桶。

google-cloud-platform

6
推荐指数
2
解决办法
4155
查看次数

Google Cloud Datastore过滤器数据,其中包含列表中的项目

在我们的Google Cloud Datastore中,我们有一个属性(companies属性),该属性存储字符串列表,并且在查询数据存储区时,我们希望将Java列表发送到数据存储区API并获取公司属性至少包含以下内容之一的数据:列表中的项目。我们当前的查询代码在下面,但是我们无法找到如何在此代码上设置列表过滤器。有人对此有想法吗?

public List<MAExchangeNews> getExchangeNews(IExchangeController controller,int count, String offsetVal, List<String> relatedCompanySymbols) {
    List<MAExchangeNews> result = null;
    if (controller != null) {
        EntityQuery.Builder builder = Query.newEntityQueryBuilder();
        builder.setKind(KIND_NAME);
        builder.setLimit(count);
        builder.setOrderBy(OrderBy.desc(FIELD_NEWS_TIME));
        if (offsetVal != null) {
            builder.setStartCursor(Cursor.fromUrlSafe(offsetVal));
        }
        if (relatedCompanySymbols != null) {

//This is the area we want to add our filtering code        //builder.setFilter(PropertyFilter.Operator.GREATER_THAN_OR_EQUAL_VALUE);
        }

        Query<Entity> query = builder.build();

        QueryResults<Entity> resultList = datastore.run(query);
        result = entitiesToNews(controller,resultList);         
        if (result != null) {
            this.nextOffset = resultList.getCursorAfter().toUrlSafe();
        }           
    }

    return result;
}
Run Code Online (Sandbox Code Playgroud)

我们想要实现的示例:

- …
Run Code Online (Sandbox Code Playgroud)

java datastore google-cloud-datastore

5
推荐指数
1
解决办法
188
查看次数

连接到 Google Compute Engine 实例以运行 Python 脚本

我对云计算很陌生,而且我不是来自软件工程背景,所以如果我说的有些话不正确,请见谅。

我习惯于在像 Spyder 这样的 IDE 上工作,我想保持这种方式。最近,在我的组织中,我们正在试验 Google Cloud,我尝试做的是在云上运行一个简单的脚本,而不是使用 Google Cloud 的 API 在我的计算机上运行。

假设我想通过 Spyder 在云上运行它:

x=3
y=2
print(f'your result is {x+y}') 
Run Code Online (Sandbox Code Playgroud)

我猜我可以做这样的事情:

from googleapiclient import discovery

compute = discovery.build('compute', 'v1')
request = compute.instances().start(project=project, zone=zone, instance=instance)
request.execute()
#Do something to connect to instance


x=3
y=2
print(f'your result is {x+y}') 
Run Code Online (Sandbox Code Playgroud)

有没有办法做到这一点?或者告诉 python 运行script.py?谢谢,如果我不清楚,请告诉我。

python google-compute-engine gcloud

1
推荐指数
1
解决办法
1737
查看次数

GCP Cloud Functions 使用私有 IP 连接到云 sql

我正在按照此示例建立从 Cloud Function 到 Postgres Cloud SQL 的连接:https : //cloud.google.com/functions/docs/sql

当我使用公共 IP 创建测试 Cloud SQL 实例并触发云函数时,它会连接到云 SQL 实例并返回一些内容。出于安全原因,我不能保留公共 IP,因此当我在云 SQL 实例上选择私有 IP 时,我得到:

Error: function crashed. Details:
could not connect to server: Connection refused
    Is the server running locally and accepting
    connections on Unix domain socket "/cloudsql/cloud-sql-test-250613:us-central1:myinstance-2/.s.PGSQL.5432"?
Run Code Online (Sandbox Code Playgroud)

我无法从文档中获得云函数和云 sql 实例之间的契约是什么。如果我们使用 unix 域套接字,我应该关心 IP 吗?它是公共的还是私人的,重要吗?如果确实重要,我是否必须完成设置私有 IP 基础设施的所有过程?我需要无服务器 VPC 吗?

google-cloud-sql google-cloud-platform google-cloud-functions google-vpc

1
推荐指数
1
解决办法
1691
查看次数