gcloud数据存储模拟器:[Errno 8]提供nodename或servname,或者未知

时间:2018-04-27 12:21:53

标签: google-cloud-platform google-cloud-datastore

我刚刚在本地安装了Google云数据存储模拟器,用于测试我的应用程序。我在启动它时遇到了一个奇怪的错误。谷歌搜索没有返回任何结果。

我使用以下命令安装它:

gcloud components install cloud-datastore-emulator

安装似乎很成功。

这是以debug详细程度启动它的输出:

❯ gcloud beta emulators datastore start --verbosity debug
DEBUG: Running [gcloud.beta.emulators.datastore.start] with arguments: [--verbosity: "debug"]
DEBUG: (gcloud.beta.emulators.datastore.start) [Errno 8] nodename nor servname provided, or not known
This may be due to network connectivity issues. Please check your network settings, and the status of the service you are trying to reach.
Traceback (most recent call last):
  File "/usr/local/google-cloud-sdk/lib/googlecloudsdk/calliope/cli.py", line 787, in Execute
    resources = calliope_command.Run(cli=self, args=args)
  File "/usr/local/google-cloud-sdk/lib/googlecloudsdk/calliope/backend.py", line 759, in Run
    resources = command_instance.Run(args)
  File "/usr/local/google-cloud-sdk/lib/surface/emulators/datastore/start.py", line 69, in Run
    datastore_util.GetHostPort(), ipv6_enabled=socket.has_ipv6)
  File "/usr/local/google-cloud-sdk/lib/googlecloudsdk/command_lib/emulators/datastore_util.py", line 162, in GetHostPort
    return util.GetHostPort(DATASTORE)
  File "/usr/local/google-cloud-sdk/lib/googlecloudsdk/command_lib/emulators/util.py", line 222, in GetHostPort
    if sock.connect_ex((host, port)) != 0:
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 228, in meth
    return getattr(self._sock,name)(*args)
gaierror: [Errno 8] nodename nor servname provided, or not known
ERROR: (gcloud.beta.emulators.datastore.start) [Errno 8] nodename nor servname provided, or not known
This may be due to network connectivity issues. Please check your network settings, and the status of the service you are trying to reach.

欢迎任何有关正在发生的事情的想法。

1 个答案:

答案 0 :(得分:1)

我刚刚进行了快速测试并使用$ gcloud components install cloud-datastore-emulator安装了Cloud Datastore并运行$ gcloud beta emulators datastore start --verbosity debug而没有任何问题。

如果你运行没有标志的$ gcloud beta emulators datastore start,输出是什么? 看起来是一个连接问题。你试过强制主机和端口吗?尝试运行$ gcloud beta emulators datastore start --verbosity debug --host-port 127.0.0.1:8080