问题标签 [gcloud]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
2897 浏览

cron - 需要在 Google 计算引擎 (gce) 上运行 cron 作业以使用服务帐户执行 gcloud 快照

如果我使用 gcloud auth 来使用我的个人帐户,我已经成功地创建和执行了快照脚本。但如果我让 cron 以 root 或选定用户身份运行,则在 cron 期间不会发生任何事情。

我使用了这个脚本https://gist.github.com/peihsinsu/73cb7e28780b137c2bcd并且效果很好,正如作者所说:“首先安装 gcloud 和 auth”是必需的。

我的问题是使用我的个人帐户而不是服务帐户。

当您执行 gcloud auth login 时,您会收到一条非常重要的消息

有权访问此虚拟机的其他人可能会看到您的凭据。您确定要使用您的个人帐户进行身份验证吗?

避免这种安全风险的任何想法或建议。

0 投票
3 回答
1347 浏览

git - gcloud init PROJECT 错误无法获取存储库 url

我在 gce 控制台上创建了一个名为 flint 的项目。

然后我尝试 在初始化项目和设置 push-to-deploy 部分中的 https://cloud.google.com/sdk/gcloud/之后在本地初始化 git repo 。

这导致了以下错误

$ gcloud init flint Initialized gcloud directory in [~/flint/.gcloud]. Unable to fetch repository URL. Guessing the URL, but if your project uses repo-sync then the cloned repository may be read-only. Cloning [https://source.developers.google.com/p/flint/r/default] into [default]. Cloning into '~/flint/default'... fatal: remote error: Repository not found. You may need to create a repository for this project using the Source Code tab at https://console.developers.google.com ERROR: Command '['git', 'clone', 'https://source.developers.google.com/p/flint/r/default', '~/flint/default', '--config', 'credential.helper=gcloud.sh']' returned non-zero exit status 128 ERROR: Unable to initialize project [flint], cleaning up [~/flint]. ERROR: (gcloud.init) Unable to initialize project [flint].

0 投票
1 回答
790 浏览

hadoop - 谷歌计算引擎为 hadoop 仪表板添加防火墙规则

我使用 bdutil 安装了 hadoop 集群(而不是单击部署)。我无法访问 locahost:50030/jobtracker.jsp 的作业跟踪器页面(https://cloud.google.com/hadoop/running-a-mapreduce-job

我在本地使用 lynx 而不是从我的客户端浏览器检查它(所以 localhost 而不是外部 ip)

我在 bdutil 的配置文件中的设置是

MASTER_UI_PORTS=('8088' '50070' '50030')

但是在我做防火墙规则列表时部署了hadoop集群后,我得到了关注

名称网络 SRC_RANGES 规则 SRC_TAGS TARGET_TAGS

default-allow-http 默认 0.0.0.0/0 tcp:80,tcp:8080 http-server

default-allow-https 默认 0.0.0.0/0 tcp:443 https-server

默认允许 icmp 默认 0.0.0.0/0 icmp

默认允许内部默认 10.240.0.0/16 tcp:1-65535,udp:1-65535,icmp

默认允许 rdp 默认 0.0.0.0/0 tcp:3389

默认允许 ssh 默认 0.0.0.0/0 tcp:22

现在我在规则列表中看不到端口 50030。为什么这样?

所以我运行一个命令来添加它们(手动)

gcloud compute firewall-rules create allow-http --description“允许传入的http”。--allow tcp:50030 --format json

现在它被添加了,我可以在 firewall-rules list 命令的输出中看到。

但是当我做 lynx locahost:50030/jobtracker.jsp 时,我仍然无法连接。然后,我运行了一个 hadoop 作业,以便查看一些输出,然后运行 ​​lynx 命令,但仍然看到无法连接。

有人能告诉我在这个完整的过程中哪里出错了吗?

0 投票
7 回答
30999 浏览

linux - `gcloud compute copy-files`:复制文件时权限被拒绝

我很难将文件复制到我的 Google Compute Engine。我在 Google Compute Engine 上使用 Ubuntu 服务器。

我正在我的 OS X 终端上执行此操作,并且我已经获得使用gcloud.

0 投票
1 回答
1689 浏览

rsync - 在 gcloud 上的 centOS 上设置 rsync - 错误 @ERROR: chdir failed

我在所有 gcloud 中都是一个完全的菜鸟 我试图设置一个 rsync 模块以让一个共享中心盒按设定的时间表进行备份,我能够在带有数字海洋的 ocentOS 上做到这一点,但不知何故我无法得到相同的结果在 gcloud 中的 centOS vm 实例上设置事物

这是我的设置以及我能够收集到的关于我遇到的问题的所有信息

===================

我的 /etc/rsyncd.conf

motd 文件 = /etc/rsyncd.motd

日志文件 = /var/log/rsyncd.log

pid 文件 = /var/run/rsyncd.pid

锁定文件 = /var/run/rsync.lock

[moodle]

路径 = /home/FranciscoCortes/backups

评论=路径中定义的moodle备份文件文件夹的备份模块

只读 = 没有

清单 = 是的

uid = 没有人

gid = 没有人

授权用户 = FranciscoCortes

机密文件 = /etc/rsyncd.secrets

使用 chroot = 否

主机允许 = *

===================

路径实际存在

[FranciscoCortes@centos6 备份] cd /home/FranciscoCortes/backups/ [FranciscoCortes@centos6 备份]

=================

模块存在

[FranciscoCortes@centos6 ~]$ rsync -var rsync://FranciscoCortes@localhost/

用于路径中定义的moodle备份文件文件夹的moodleic备份模块

=================

文件夹的权限似乎没问题

[FranciscoCortes@centos6 ~]$ ls -l

共 8 个

drwxrwxr-x。2 FranciscoCortes FranciscoCortes 4096 Jan 7 21:37 备份

=================

sudo netstat -tulpn

tcp 0 0 :::873 :::* LISTEN 17096/xinetd

=================

猫 /etc/服务 | grep 同步

rsync 873/tcp #rsync

rsync 873/udp #rsync

=================

但我得到的错误是这个

[FranciscoCortes@centos6 ~]$ rsync -var rsync://FranciscoCortes@localhost/moodleic/

密码:@ERROR:chdir failed rsync 错误:在 main.c(1503) [receiver=3.0.6] 启动客户端-服务器协议(代码 5)时出错

=================

rsync 错误日志显示了这一点

2015/01/09 01:21:20 [16987] 无法绑定端口 873 上的任何入站套接字

2015/01/09 01:21:20 [16987] rsync 错误:socket.c(541) [receiver=3.0.6] 处的套接字 IO(代码 10)错误

2015/01/09 01:25:37 [17118] 从本地主机连接 (::1)

2015/01/09 01:25:48 [17118] rsync: chdir /home/FranciscoCortes/备份失败

: 权限被拒绝 (13)

=================

我尝试将 uid 和 gid 设置为与在已是路径中文件夹的所有者的秘密文件上授权的用户相同,所以我不确定为什么我会拒绝权限。

我错过了什么??

任何帮助表示赞赏。

0 投票
1 回答
495 浏览

google-app-engine - 用于 Go 的 Google App Engine 托管虚拟机:AttributeError:“模块”对象没有属性“CleanableContainerName”

在 Mac OS X 上,尝试打开调试标志或运行 Go Managed VM 的 hello world 测试项目,我收到以下错误:AttributeError: 'module' object has no attribute 'CleanableContainerName'

有任何想法吗?

完整的错误日志:

Docker/Boot2docker 版本:

gcloud版本:

0 投票
0 回答
370 浏览

logging - 托管 VM 模块 --enable-mvm-logs 导致崩溃

我想在开发期间(部署之前)查看我在 Google Cloud Platform 中的一个托管 VM 模块的日志,我注意到这个命令应该允许它:

但是,将该开关添加到通常的运行命令会导致模块在加载期间崩溃:

如果没有开关,我的应用程序可以正常运行和部署,一旦部署,我正在记录的数据就可以在开发控制台中使用。

我确实找到了一种在开发期间在我启动开发服务器的终端中查看日志的方法,尽管它并不理想:

如果我使用 --verbosity debug 标志,我的输出会显示出来,但只有 loglevel debug 才会显示,即使我记录的内容被记录为错误。任何其他详细级别根本不显示输出。

顺便说一句,我正在使用 Go 运行时。

总而言之,我似乎可以使用托管 VM 的本地开发服务器环境查看日志的唯一方法是使用以下命令启动:

即使我使用 loglevel Error 登录,如果我设置 --verbosity 错误,输出也永远不会显示在终端或其他任何地方。

有没有人能够让 --enable-mvm-logs 开关工作,还是坏了?有关查看托管 VM 日志输出的更好方法的任何想法?

0 投票
6 回答
14425 浏览

awk - 如何获取 GCE 实例的内部 IP 地址列表

我有一堆在 GCE 中运行的实例。我想以编程方式获取它们的内部 IP 地址列表,而无需(本地)登录实例。

我知道我可以运行:

但是我可以传递任何标志来获取我想要的信息吗?例如

或类似的?还是我必须清理我的 sed/awk 大脑并解析输出?

我也知道我可以使用 --format=json 以 JSON 格式获取输出,但我正在尝试在 bash 脚本中执行此操作。

0 投票
2 回答
366 浏览

google-app-engine - 在哪里可以查看在 Google App Engine 上托管 Vms 上部署失败的日志?

当我尝试在托管 VM 上部署我的应用程序时,谷歌应用程序引擎上的部署失败。我怀疑这是因为 appengine 无法运行我的容器,因为它有一个错误。但是,由于容器无法运行,我无法检查 docker 日志。在本地它可以工作,因为它的配置与生产环境不同。我怀疑在生产中我的应用程序无法解析本地网络中的数据库服务器 ip,但我没有任何日志可供调查。

0 投票
1 回答
680 浏览

python - 数据存储区 AttributeError:“模块”对象没有属性“set_defaults”

从这里:http: //googlecloudplatform.github.io/gcloud-python/datastore-api.html

解决此错误:

似乎调用了错误版本的 gcloud.datastore。