在 GCP 中,f1-micro 实例(1 个共享vCPU)与 n1-standard-1(1 个 vCPU)之间有什么区别?具体来说,共享vCPU和vCPU有什么区别?
我正在 NodeJS 中开发后端服务。它通过请求临时链接并将此链接发送到第三方分析服务来处理来自 Google Cloud Storage 的图像。我还希望将图像添加到共享的 Google Drive 文件夹中。是否有任何可能的方法可以轻松做到这一点(例如,通过使用 Drive API 并将链接发布到文件,而不是下载文件并随后上传)。换句话说:Drive API 是否接受文件链接,而不是上传文件?或者有没有其他聪明的方法可以轻松地将 Google Cloud 共享到云端硬盘(因为它都是 Google 服务)。
谢谢
google-api google-cloud-storage google-drive-api google-cloud-platform
我按照有关如何设置 Node.JS 以与 Cloud SQL 一起使用的示例进行操作,并且通常可以使其正常工作,但有一些关于如何连接到 SQL 服务器的变通方法。我无法以正确的方式连接,将 传递INSTANCE_CONNECTION_NAME给方法socketPath的options变量选项createConnection()。相反,作为临时解决方法,我目前指定服务器的 IP 地址并将我的 VM IP 地址放入服务器的防火墙设置中以使其通过。
这一切都有效,但我现在正在尝试在发布到 AppEngine 之前将其正确组合在一起。
我怎样才能让它工作?
以下代码工作正常:
function getConnection ()
{
const options =
{
host: "111.11.11.11", //IP address of my Cloud SQL Server
user: 'root',
password: 'somePassword',
database: 'DatabaseName'
};
return mysql.createConnection(options);
}
Run Code Online (Sandbox Code Playgroud)
但是我从教程和教程中引用的Github 页面合并的以下代码给出了错误:
function getConnection ()
{
const options =
{
user: 'root',
password: 'somePassword',
database: 'DatabaseName',
socketPath: '/cloudsql/project-name-123456:europe-west1:sql-instance-name'
};
return …Run Code Online (Sandbox Code Playgroud) google-app-engine node.js google-cloud-sql google-cloud-platform
当我使用格式时
gcloud compute copy-files user@instance-1:/home/user/file \ /home/user/Desktop \ --zone europe-west1-b
Run Code Online (Sandbox Code Playgroud)
它给了我错误
没有桌面这样的文件或目录
我想通过 Android Studio 将 Firebase 添加到我的项目中,方法是转到“工具”>“Firebase”>“身份验证”>“电子邮件和密码身份验证”>“连接到 Firebase”。弹出一个对话框,我选择创建新的 Firebase 项目,但我收到以下错误,即使我有一个完全可用的互联网连接:
Firebase:连接到 Firebase 失败。请检查您的互联网连接,然后重试。如果错误仍然存在,您可以在https://console.firebase.google.com 上手动连接 已尝试创建项目,因此尽管出现此失败消息,但在线项目可能在线并注册到您的帐户。
以这种方式设置它比手动设置要容易得多,所以我想解决这个问题。
编辑:
问题原来是我已经达到了添加新项目的限制。要解决此问题,您必须删除一些应用,将新项目链接到现有项目,或者请求 Firebase 团队创建其他项目。
android firebase android-studio google-cloud-platform firebase-cloud-messaging
我已经使用node.js 标准环境在AppEngine上部署了一个 cron ,以便定期更新我的 Firestore 数据库。
在此文档之后,链接到此可用 npm 模块列表,我应该可以使用@google-cloud/firestore,但之后:
npm i --save @google-cloud/firestore
我收到以下错误:
Error: Cannot find module '@google-cloud/firestore'
在线:
var firestore = require('@google-cloud/firestore');
Run Code Online (Sandbox Code Playgroud)
我的 package.json 与 Hello World 示例相同:
{
"name": "appengine-hello-world",
"description": "Simple Hello World Node.js sample for Google App Engine Standard Environment.",
"version": "0.0.1",
"private": true,
"license": "Apache-2.0",
"author": "Google Inc.",
"repository": {
"type": "git",
"url": "https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git"
},
"engines": {
"node": "8.x.x"
},
"scripts": { …Run Code Online (Sandbox Code Playgroud) google-app-engine node.js firebase google-cloud-platform google-cloud-firestore
我已将 Golang 应用程序部署到 Google Cloud Platform 的 App Engine Standard 环境。
我的 app.yaml 包括以下几行:
automatic_scaling:
min_idle_instances: 0
max_idle_instances: 0
min_pending_latency: automatic
max_pending_latency: automatic
min_instances: 0
max_instances: 2
Run Code Online (Sandbox Code Playgroud)
我的意图是应用程序在空闲时应该缩减到 0 个实例,并生成最多 2 个实例来处理传入的请求。
调用该服务后,我注意到它永远不会缩减到 0 个实例。
我在web控制台打开服务配置,发现如下:
runtime: go
api_version: go1
env: standard
threadsafe: true
instance_class: F1
handlers:
- url: /penguin
script: _go_app
automatic_scaling:
min_idle_instances: automatic
max_idle_instances: automatic
min_pending_latency: automatic
max_pending_latency: automatic
max_instances: 2
Run Code Online (Sandbox Code Playgroud)
是否可以将 App Engine 标准服务缩减为 0 个实例?在 yaml 中应该是什么样子?
Google Cloud Run 允许我为给定容器设置并发性,即在启动新容器之前它将服务的并发请求数。
我如何实际检查在任何给定时间有多少容器正在运行?Web 界面提到了哪些服务正在运行,但没有提到有多少服务,当我这样做时也是如此gcloud beta run services (list|describe)。
尝试将映像部署到云运行时出现权限错误:
gcloud beta run deploy endpoints_proxy \
--image="gcr.io/endpoints-release/endpoints-runtime-serverless:1.30.0" \
--allow-unauthenticated
Run Code Online (Sandbox Code Playgroud)
这是错误:
ERROR: (gcloud.beta.run.deploy) User [email-goes-here] does not have permission to access namespace [project-id-goes-here] (or it may not exist): Cloud Run does not have permission to get access tokens for the default compute service account, 1088973916567-compute@developer.gserviceaccount.com. Please give Google Cloud Run Service Agent the permission iam.serviceAccounts.getAccessToken on the default compute service account.
Run Code Online (Sandbox Code Playgroud)
我的帐户具有所有者和编辑器权限,我什至尝试附加 Cloud Run Service Agent 角色。
我还尝试将这些角色添加到错误中列出的“默认计算服务帐户”中,但没有奏效。