Google Cloud Load Balancer --path-rules命令“找不到匹配项”

时间:2016-07-21 20:37:22

标签: cloud zsh google-cloud-platform gcloud

我目前正在关注谷歌的Content Based Load Balancing指南,目前我仍然坚持第4b步。该步骤要求我将路径匹配器添加到我的URL映射并定义我的请求路径映射。为此,我必须使用gcloud命令:

gcloud compute url-maps add-path-matcher web-map \
    --default-service web-map-backend-service --path-matcher-name pathmap \
    --path-rules=/video=video-service,/video/*=video-service,/static=static-service,/static/*=static-service

当我在终端客户端输入此内容时,出现错误:

  

zsh:找不到匹配项:   --path规则= /视频=视频业务,/视频/ =视频业务,/静态=静态服务,/静态/ =静态服务

以下是我提交内容的图片以及我收到的错误:gcloud path-rules error

1 个答案:

答案 0 :(得分:0)

可能zsh解释标志错了。这些指南最有可能用bash进行测试。

我认为zsh正试图在--path-rules参数中用*做一些特别的事情。

请使用引号作为参数,以确保zsh正确解释参数。这有用吗?

  gcloud compute url-maps add-path-matcher web-map \
    --default-service web-map-backend-service --path-matcher-name pathmap \
    --path-rules '/video=video-service,/video/*=video-service,/static=static-service,/static/*=static-service'