发现无效内容,以元素“ target-cpu-utilization”开头

时间:2018-07-17 17:56:13

标签: java google-app-engine

我正在运行三个应用引擎服务,这是我从一项服务中获得的appening-web.xml

<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
  <!-- <application>sandbox-10fb8</application> -->
  <application>XXX-184914</application> 
  <version>1</version>
  <threadsafe>true</threadsafe>
   <runtime>java8</runtime>
  <use-google-connector-j>true</use-google-connector-j>
  <service>XXX</service>

</appengine-web-app>

这就是我在云应用引擎控制台中看到的内容

automatic_scaling:
  min_idle_instances: automatic
  max_idle_instances: automatic
  min_pending_latency: automatic
  max_pending_latency: automatic

当我使用mvn appengin:update时,效果很好。所以我想添加缩放配置。这就是我所做的

<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
  <!-- <application>sandbox-10fb8</application> -->
  <application>XXX-184914</application> 
  <version>1</version>
  <threadsafe>true</threadsafe>
  <automatic-scaling>
    <target-cpu-utilization>0.95</target-cpu-utilization>
    <min-idle-instances>1</min-idle-instances>
    <min-instances>1</min-instances>
    <max-instances>2</max-instances>
    <max-concurrent-requests>50</max-concurrent-requests>
  </automatic-scaling>
   <runtime>java8</runtime>
  <use-google-connector-j>true</use-google-connector-j>
  <service>XXX</service>
</appengine-web-app>

现在,当我执行相同的mvn命令时,出现以下错误

 against C:\Users\mc7101\.m2\repository\com\google\appengine\appengine-java-sdk\1.9.51\appengine-java-sdk\appengine-java-sdk-1.9.51\docs\appengine-web.xsd
  Caused by: cvc-complex-type.2.4.a: Invalid content was found starting with element 'target-cpu-utilization'. One of '{"http://appengine.google.com/ns/1.0":min-pending-latency, "http://appengine.google.com/ns/1.0":max-pending-latency, "http://appengine.google.com/ns/1.0":min-idle-instances, "http://appengine.google.com/ns/1.0":max-idle-instances, "http://appengine.google.com/ns/1.0":max-concurrent-requests, "http://appengine.google.com/ns/1.0":min-num-instances, "http://appengine.google.com/ns/1.0":max-num-instances, "http://appengine.google.com/ns/1.0":cool-down-period-sec, "http://appengine.google.com/ns/1.0":cpu-utilization, "http://appengine.google.com/ns/1.0":target-network-sent-bytes-per-sec, "http://appengine.google.com/ns/1.0":target-network-sent-packets-per-sec, "http://appengine.google.com/ns/1.0":target-network-received-bytes-per-sec, "http://appengine.google.com/ns/1.0":target-network-received-packets-per-sec, "http://appengine.google.com/ns/1.0":target-disk-write-bytes-per-sec, "http://appengine.google.com/ns/1.0":target-disk-write-ops-per-sec, "http://appengine.google.com/ns/1.0":target-disk-read-bytes-per-sec, "http://appengine.google.com/ns/1.0":target-disk-read-ops-per-sec, "http://appengine.google.com/ns/1.0":target-request-count-per-sec, "http://appengine.google.com/ns/1.0":target-concurrent-requests}' is expected.
Please see the logs [C:\Users\XXX\AppData\Local\Temp\appcfg5084302388655645727.log] for further information.

如果我清楚地理解了错误消息,则说明我如何键入这些标签,这是找不到的,但我是从Google doc复制而来的。我真的在这里做错了什么?

1 个答案:

答案 0 :(得分:1)

mvn appengin:update命令似乎正在使用GAE Java SDK中的appcfg命令(请注意错误消息中提到的appcfg日志文件名中的appcfg5084302388655645727.log (您知道),但该功能(目前)还不支持某些最近添加的缩放配置参数,包括target-cpu-utilization。在您提到的文档中:

  

重要:如果您使用App Engine SDK for Java中的 appcfg 命令进行部署,则无法在您的    appengine-web.xml 。而是按照Setting Autoscaling Parameters in the API Explorer中所述设置参数,或使用   App Engine Admin API