【问题标题】:Getting errors on Hello-Wordpress Sample在 Hello-Wordpress 示例上出现错误
【发布时间】:2014-12-04 19:01:56
【问题描述】:

按照https://cloud.google.com/container-engine/docs/hello-wordpress的步骤进行

在我进入“gcloud 计算实例列表”之前一切正常,我收到以下错误:

[ec2-user@ip-10-00-00-000~]$ gcloud compute instances list NAME ZONE MACHINE_TYPE INTERNAL_IP EXTERNAL_IP STATUS Traceback (most recent call last): File "/home/ec2-user/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 175, in <module> main() File "/home/ec2-user/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 171, in main _cli.Execute() File "/home/ec2-user/google-cloud-sdk/./lib/googlecloudsdk/calliope/cli.py", line 385, in Execute post_run_hooks=self.__post_run_hooks, kwargs=kwargs) File "/home/ec2-user/google-cloud-sdk/./lib/googlecloudsdk/calliope/frontend.py", line 274, in _Execute pre_run_hooks=pre_run_hooks, post_run_hooks=post_run_hooks) File "/home/ec2-user/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 930, in Run output_formatter(result) File "/home/ec2-user/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 916, in OutputFormatter command_instance.Display(args, obj) File "/home/ec2-user/google-cloud-sdk/./lib/googlecloudsdk/compute/lib/base_classes.py", line 304, in Display PrintTable(resources, self._resource_spec.table_cols) File "/home/ec2-user/google-cloud-sdk/./lib/googlecloudsdk/compute/lib/base_classes.py", line 46, in PrintTable for resource in resources: File "/home/ec2-user/google-cloud-sdk/./lib/googlecloudsdk/compute/lib/base_classes.py", line 289, in Run for item in items: File "/home/ec2-user/google-cloud-sdk/./lib/googlecloudsdk/compute/lib/lister.py", line 29, in ProcessResults yield field_selector.Apply(resource) File "/home/ec2-user/google-cloud-sdk/./lib/googlecloudsdk/compute/lib/property_selector.py", line 355, in Apply res = _DictToOrderedDict(obj) File "/home/ec2-user/google-cloud-sdk/./lib/googlecloudsdk/compute/lib/property_selector.py", line 177, in _DictToOrderedDict new_obj = collections.OrderedDict(sorted(obj.items())) AttributeError: 'module' object has no attribute 'OrderedDict'

由于这适用于我的 windows 框,我忽略并转到下一步并收到以下错误:

    [ec2-user@ip-10-00-00-000~]$ gcloud preview container pods create wordpress --cluster-name
    hello-world  --image=tutum/wordpress --port=80
    Usage: gcloud preview container pods create [optional flags]

    Create a pod running in a cluster.

    optional flags:
      --cluster-name CLUSTER_NAME, -n CLUSTER_NAME
                             The name of this cluster.
      --config-file CONFIG_FILE
                             Path to the pod config
      --format FORMAT        Format for printed output.
      --help                 Display detailed help.
      --image IMAGE          The Docker image to use
      --name NAME            The name of the pod
      --port PORT            A port to expose
      --project PROJECT_ID   Google Cloud Platform project ID to use for this
                             invocation.
      --purge-config-cache   Clear cached config data for the cluster. If set, will
                             call 'container clusters describe' directly to get
                             cluster data before executing kubernetes client
                             command.
      --quiet, -q            Disable all interactive prompts.
      --zone ZONE, -z ZONE   The compute zone (e.g. us-central1-a) for the cluster
      -h                     Print a summary help and exit.

    ERROR: (gcloud.preview.container.pods.create) unrecognized arguments: wordpress

尝试重新排序参数,但仍然得到与上述相同的错误。有什么想法吗?

【问题讨论】:

    标签: google-kubernetes-engine


    【解决方案1】:

    从列表实例输出看来,您的 cloud-sdk 安装可能已损坏。尝试按照此处的说明重新安装云 sdk:https://cloud.google.com/sdk/

    【讨论】:

    • 谢谢,做了几次。无法让它工作。必须是亚马逊 linux 的东西,切换到 ubuntu 并且一切正常
    • 安装 cloud sdk 时是否选择了将其添加到路径的选项?
    • 另外,您能否粘贴 python --version 的输出以显示您的 EC2 虚拟机上安装的 python 版本?
    • 它将自己添加到路径中,只需要重新启动shell。在非工作服务器上,python 版本是 Python 2.6.9,在工作 ubuntu 上是 2.7.6。我会尝试更新并发布结果
    【解决方案2】:

    试试:

    gcloud preview container pods create --name wordpress --cluster-name hello-world --image=tutum/wordpress --port=80
    

    pod 的名称现在被指定为参数,如使用输出中所示:

    "--name NAME Pod 的名称"

    【讨论】:

    • 谢谢,试过了,但我不确定这些 python 错误是否有效:gcloud preview container pods create --name wordpress --cluster-name hello-world --image=tutum/wordpress --port=80 Traceback (most recent call last):... File "/home/ec2-user/google-cloud-sdk/./lib/googlecloudsdk/container/lib/util.py", line 286, in WhichKubectl return subprocess.check_output(['which', 'kubectl']) AttributeError: 'module' object has no attribute 'check_output'
    • 调用gcloud preview container pods describe wordpress返回类似错误
    • 切换到 ubuntu 并且 python 错误消失了,建议有效。谢谢!
    猜你喜欢
    • 1970-01-01
    • 2017-11-06
    • 1970-01-01
    • 1970-01-01
    • 2020-02-28
    • 1970-01-01
    • 2015-05-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多