javascript - ambari 无法添加指标小部件
问题描述
我为 ambari 和指标小部件编写了一个组件。但是我无法为该组件添加小部件。我想我需要一些帮助...
我的 ambari 版本是 2.5.2,我检查了网络问题。
当我打开这个组件页面的页面时,它显示为
app.js:66933 Uncaught TypeError: Cannot read property 'WidgetLayoutInfo' of undefined
at Class.createUserWidgetLayout (app.js:66933)
at Class.<anonymous> (app.js:66874)
at o (vendor.js:125)
at Object.fireWith [as resolveWith] (vendor.js:125)
at w (vendor.js:127)
at XMLHttpRequest.d (vendor.js:127)
当我尝试添加小部件时。它显示为
app.js:26574 Uncaught TypeError: activeLayout.get is not a function
at Class.addWidget (app.js:26574)
at handler (vendor.js:21227)
at HTMLButtonElement.<anonymous> (vendor.js:13019)
at HTMLDivElement.dispatch (vendor.js:126)
at HTMLDivElement.i (vendor.js:126)
最后我尝试创建一个小部件,控制台显示为
app.js:85210 Uncaught TypeError: Cannot read property 'mapProperty' of undefined
at Class.createServiceWidget (app.js:85210)
at Class.sendRecursively (vendor.js:17348)
at Class.sendRecursively (vendor.js:17352)
at Class.sendRecursively (vendor.js:17352)
at Class.sendRecursively (vendor.js:17352)
at Class.send (vendor.js:17333)
at Class.createWidget (app.js:26730)
at Class.createWidget (app.js:26849)
at handler (vendor.js:21227)
at HTMLButtonElement.<anonymous> (vendor.js:13019)
这是我的 metainfo.xml
<metainfo>
<schemaVersion>2.0</schemaVersion>
<services>
<service>
<name>REDISCLUSTER</name>
<displayName>Redis Cluster</displayName>
<comment>the component of redis cluster</comment>
<version>4.0.8</version>
<components>
<component>
<name>REDIS_SERVER</name>
<displayName>redis server</displayName>
<category>MASTER</category>
<cardinality>1+</cardinality>
<timelineAppid>rediscluster</timelineAppid>
<commandScript>
<script>scripts/server.py</script>
<scriptType>PYTHON</scriptType>
<timeout>600</timeout>
</commandScript>
</component>
</components>
<osSpecifics>
<osSpecific>
<osFamily>any</osFamily>
</osSpecific>
</osSpecifics>
</service>
</services>
</metainfo>
这是metrics.json
{
"REDIS_SERVER": {
"Component": [
{
"type": "ganglia",
"metrics": {
"default": {
"metrics/redis_cluster_used_memory": {
"metric": "redis_cluster_used_memory",
"pointInTime": true,
"temporal": true
},
"metrics/redis_cluster_maxmemory": {
"metric": "redis_cluster_maxmemory",
"pointInTime": true,
"temporal": true
},
"metrics/redis_cluster_used_memory_rss": {
"metric": "redis_cluster_used_memory_rss",
"pointInTime": true,
"temporal": true
},
"metrics/redis_cluster_used_memory_peak": {
"metric": "redis_cluster_used_memory_peak",
"pointInTime": true,
"temporal": true
},
"metrics/redis_cluster_mem_fragmentation_ratio": {
"metric": "redis_cluster_mem_fragmentation_ratio",
"pointInTime": true,
"temporal": true
},
"metrics/redis_cluster_instantaneous_input_kbps": {
"metric": "redis_cluster_instantaneous_input_kbps",
"pointInTime": true,
"temporal": true
},
"metrics/redis_cluster_instantaneous_output_kbps": {
"metric": "redis_cluster_instantaneous_output_kbps",
"pointInTime": true,
"temporal": true
},
"metrics/redis_cluster_rejected_connections": {
"metric": "redis_cluster_rejected_connections",
"pointInTime": true,
"temporal": true
},
"metrics/redis_cluster_keyspace_hits": {
"metric": "redis_cluster_keyspace_hits",
"pointInTime": true,
"temporal": true
},
"metrics/redis_cluster_keyspace_misses": {
"metric": "redis_cluster_keyspace_misses",
"pointInTime": true,
"temporal": true
},
"metrics/redis_cluster_used_cpu_sys": {
"metric": "redis_cluster_used_cpu_sys",
"pointInTime": true,
"temporal": true
}
}
}
}
]
}
}
这是widgets.json
{
"layouts": [
{
"layout_name": "default_redis_cluster_dashboard",
"display_name": "Standard Redis Cluster Dashboard",
"section_name": "REDISCLUSTER_SUMMARY",
"widgetLayoutInfo": [
{
"widget_name": "redis_cluster_used_memory",
"description": "Redis used memory widget",
"default_section_name": "REDISCLUSTER_SUMMARY",
"widget_type": "GRAPH",
"is_visible": true,
"metrics": [
{
"name": "redis_cluster_used_memory",
"metric_path": "metrics/redis_cluster_used_memory",
"service_name": "REDISCLUSTER",
"component_name": "REDIS_SERVER"
}
],
"values": [
{
"name": "redis_cluster_used_memory",
"value": "${redis_cluster_used_memory}"
}
],
"properties": {
"graph_type": "LINE",
"time_range": "1"
}
},
{
"widget_name": "redis_cluster_maxmemory",
"description": "Redis maxmemory widget",
"default_section_name": "REDISCLUSTER_SUMMARY",
"widget_type": "GRAPH",
"is_visible": true,
"metrics": [
{
"name": "redis_cluster_maxmemory",
"metric_path": "metrics/redis_cluster_maxmemory",
"service_name": "REDISCLUSTER",
"component_name": "REDIS_SERVER"
}
],
"values": [
{
"name": "redis_cluster_maxmemory",
"value": "${redis_cluster_maxmemory}"
}
],
"properties": {
"graph_type": "LINE",
"time_range": "1"
}
},
{
"widget_name": "redis_cluster_used_memory_rss",
"description": "Redis used_memory_rss widget",
"default_section_name": "REDISCLUSTER_SUMMARY",
"widget_type": "GRAPH",
"is_visible": true,
"metrics": [
{
"name": "redis_cluster_used_memory_rss",
"metric_path": "metrics/redis_cluster_used_memory_rss",
"service_name": "REDISCLUSTER",
"component_name": "REDIS_SERVER"
}
],
"values": [
{
"name": "redis_cluster_used_memory_rss",
"value": "${redis_cluster_used_memory_rss}"
}
],
"properties": {
"graph_type": "LINE",
"time_range": "1"
}
},
{
"widget_name": "redis_cluster_used_memory_peak",
"description": "Redis used_memory_peak widget",
"default_section_name": "REDISCLUSTER_SUMMARY",
"widget_type": "GRAPH",
"is_visible": true,
"metrics": [
{
"name": "redis_cluster_used_memory_peak",
"metric_path": "metrics/redis_cluster_used_memory_peak",
"service_name": "REDISCLUSTER",
"component_name": "REDIS_SERVER"
}
],
"values": [
{
"name": "redis_cluster_used_memory_peak",
"value": "${redis_cluster_used_memory_peak}"
}
],
"properties": {
"graph_type": "LINE",
"time_range": "1"
}
},
{
"widget_name": "redis_cluster_mem_fragmentation_ratio",
"description": "Redis mem_fragmentation_ratio widget",
"default_section_name": "REDISCLUSTER_SUMMARY",
"widget_type": "GRAPH",
"is_visible": true,
"metrics": [
{
"name": "redis_cluster_mem_fragmentation_ratio",
"metric_path": "metrics/redis_cluster_mem_fragmentation_ratio",
"service_name": "REDISCLUSTER",
"component_name": "REDIS_SERVER"
}
],
"values": [
{
"name": "redis_cluster_mem_fragmentation_ratio",
"value": "${redis_cluster_mem_fragmentation_ratio}"
}
],
"properties": {
"graph_type": "LINE",
"time_range": "1"
}
},
{
"widget_name": "redis_cluster_instantaneous_input_kbps",
"description": "Redis instantaneous_input_kbps widget",
"default_section_name": "REDISCLUSTER_SUMMARY",
"widget_type": "GRAPH",
"is_visible": true,
"metrics": [
{
"name": "redis_cluster_instantaneous_input_kbps",
"metric_path": "metrics/redis_cluster_instantaneous_input_kbps",
"service_name": "REDISCLUSTER",
"component_name": "REDIS_SERVER"
}
],
"values": [
{
"name": "redis_cluster_instantaneous_input_kbps",
"value": "${redis_cluster_instantaneous_input_kbps}"
}
],
"properties": {
"graph_type": "LINE",
"time_range": "1"
}
},
{
"widget_name": "redis_cluster_instantaneous_output_kbps",
"description": "Redis instantaneous_output_kbps widget",
"default_section_name": "REDISCLUSTER_SUMMARY",
"widget_type": "GRAPH",
"is_visible": true,
"metrics": [
{
"name": "redis_cluster_instantaneous_output_kbps",
"metric_path": "metrics/redis_cluster_instantaneous_output_kbps",
"service_name": "REDISCLUSTER",
"component_name": "REDIS_SERVER"
}
],
"values": [
{
"name": "redis_cluster_instantaneous_output_kbps",
"value": "${redis_cluster_instantaneous_output_kbps}"
}
],
"properties": {
"graph_type": "LINE",
"time_range": "1"
}
},
{
"widget_name": "redis_cluster_rejected_connections",
"description": "Redis rejected_connections widget",
"default_section_name": "REDISCLUSTER_SUMMARY",
"widget_type": "GRAPH",
"is_visible": true,
"metrics": [
{
"name": "redis_cluster_rejected_connections",
"metric_path": "metrics/redis_cluster_rejected_connections",
"service_name": "REDISCLUSTER",
"component_name": "REDIS_SERVER"
}
],
"values": [
{
"name": "redis_cluster_rejected_connections",
"value": "${redis_cluster_rejected_connections}"
}
],
"properties": {
"graph_type": "LINE",
"time_range": "1"
}
},
{
"widget_name": "redis_cluster_keyspace_hits",
"description": "Redis keyspace_hits widget",
"default_section_name": "REDISCLUSTER_SUMMARY",
"widget_type": "GRAPH",
"is_visible": true,
"metrics": [
{
"name": "redis_cluster_keyspace_hits",
"metric_path": "metrics/redis_cluster_keyspace_hits",
"service_name": "REDISCLUSTER",
"component_name": "REDIS_SERVER"
}
],
"values": [
{
"name": "redis_cluster_keyspace_hits",
"value": "${redis_cluster_keyspace_hits}"
}
],
"properties": {
"graph_type": "LINE",
"time_range": "1"
}
},
{
"widget_name": "redis_cluster_keyspace_misses",
"description": "Redis keyspace_misses widget",
"default_section_name": "REDISCLUSTER_SUMMARY",
"widget_type": "GRAPH",
"is_visible": true,
"metrics": [
{
"name": "redis_cluster_keyspace_misses",
"metric_path": "metrics/redis_cluster_keyspace_misses",
"service_name": "REDISCLUSTER",
"component_name": "REDIS_SERVER"
}
],
"values": [
{
"name": "redis_cluster_keyspace_misses",
"value": "${redis_cluster_keyspace_misses}"
}
],
"properties": {
"graph_type": "LINE",
"time_range": "1"
}
},
{
"widget_name": "redis_cluster_used_cpu_sys",
"description": "Redis used_cpu_sys widget",
"default_section_name": "REDISCLUSTER_SUMMARY",
"widget_type": "GRAPH",
"is_visible": true,
"metrics": [
{
"name": "redis_cluster_used_cpu_sys",
"metric_path": "metrics/redis_cluster_used_cpu_sys",
"service_name": "REDISCLUSTER",
"component_name": "REDIS_SERVER"
}
],
"values": [
{
"name": "redis_cluster_used_cpu_sys",
"value": "${redis_cluster_used_cpu_sys}"
}
],
"properties": {
"graph_type": "LINE",
"time_range": "1"
}
}
]
}
]
}
解决方案
推荐阅读
- javascript - 相反的枚举值 TypeScript
- apache-kafka - 如何通过jmx监控kafka中的消费者滞后?
- java - 如何为列表中的每个元素同时运行一个方法
- javascript - Typescript 返回“void”类型的参数不能分配给“TimerHandler”类型的参数?
- python - 为什么两个请求的 url 和 header 看起来一样,但状态码不同(分别为 404 和 200)?
- python - 是否可以为 npyscreen 文本字段中的输入键创建自定义处理程序?
- python-3.x - 我如何使用带有类名的 Selenium 从 Twitter 获取推文的日期时间
- json - 如何安全地检查用户是否是管理员并渲染所需的组件
- elasticsearch-5 - Elasticsearch 5 - 许多小型但非常不同的索引的设计方法?
- python-3.x - Pandas read_csv 向数据框添加一些非常小的值