gpt4 book ai didi

subscription - FIWARE QuantumLeap 健全性检查失败 : QuantumLeap can't get changed data from Orion

转载 作者:行者123 更新时间:2023-12-04 10:06:15 26 4
gpt4 key购买 nike

我在virtualMachine(带有Ubuntu的virtualBox)和生产服务器(CentOS)中检查了quantumLeap Sanity Check。使用相同的 docker-compose.yml,virtualManchine 的完整性检查成功,但在生产服务器上失败,这真的很奇怪,有人可以帮助我吗?非常感谢。 @杰森福克斯

健全性检查的步骤如下 https://quantumleap.readthedocs.io/en/latest/admin/check/ ,我贴在下面。

结果的差异仅在第 7 步。在虚拟机上 ,我可以从quantumLeap获取更新的数据:

{
"attrName": "precipitation",
"entityId": "air_quality_observer_be_001",
"index": [
"2020-05-03T11:18:14.000",
"2020-05-03T11:18:55.000"
],
"values": [
0.0,
100.0
]
}

但在生产服务器 ,结果是:
{
"description": "No records were found for such query.",
"error": "Not Found"
}

注:
  • 健全性检查步骤中的这些命令被复制到终端,因此不会有错别字。
  • 结果的差异仅在第 7 步。我删除了虚拟机和生产服务器上的旧镜像,以便拉取最新的镜像。
  • 有一个基于固件的系统(orion、mongoDB、IoTAgents、quantumLeap、CrateDB、Grafana)在生产服务器上运行,一切都很好。但是一周前,服务器上的硬盘已满,耗尽,所有容器都宕机了。我清理了一些巨大的日志文件并释放了一些空间,然后我打开了基于固件的系统,发现 Grafana 上没有显示数据。经过检查,我发现原因是QuantumLeap没有将数据存储到crateDB中,但我不确定根本原因是orion还是quantumLeap。所以我决定按照quantumLeap文件的建议进行健全性检查。这就是故事。
  • 顺便说一句,quantumLeap 的订阅可以从orion 获取,但是我无法从quantumLeap 获取更改后的数据。为什么最新变化的数据没有同步到quantumLeap?

  • 健全性检查步骤:

    1.检查猎户座版本
    curl -X GET http://0.0.0.0:1026/version -H 'Accept: application/json'

    2.检查QuantumLeap版本
    curl -X GET http://0.0.0.0:8668/version -H 'Accept: application/json'

    3.为“QuantumLeap”创建一个猎户座订阅
    curl -X POST \
    'http://0.0.0.0:8668/v2/subscribe?orionUrl=http://orion:1026/v2&quantumleapUrl=http://quantumleap:8668/v2&entityType=AirQualityObserved' \
    -H 'Accept: application/json'

    4.检查您的猫是否从 Orion 获得此类订阅
    curl -X GET http://0.0.0.0:1026/v2/subscriptions \
    -H 'Accept: application/json'

    5. 将 AirQualityObserved 的实体插入 Orion
    curl -X POST \
    'http://0.0.0.0:1026/v2/entities?options=keyValues' \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json' \
    -d '{
    "id": "air_quality_observer_be_001",
    "type": "AirQualityObserved",
    "address": {
    "streetAddress": "IJzerlaan",
    "postOfficeBoxNumber": "18",
    "addressLocality": "Antwerpen",
    "addressCountry": "BE"
    },
    "dateObserved": "2017-11-03T12:37:23.734827",
    "source": "http://testing.data.from.smartsdk",
    "precipitation": 0,
    "relativeHumidity": 0.54,
    "temperature": 12.2,
    "windDirection": 186,
    "windSpeed": 0.64,
    "airQualityLevel": "moderate",
    "airQualityIndex": 65,
    "reliability": 0.7,
    "CO": 500,
    "NO": 45,
    "NO2": 69,
    "NOx": 139,
    "SO2": 11,
    "CO_Level": "moderate",
    "refPointOfInterest": "null"
    }'

    6.更新Orion中同一实体的降水值。
    curl -X PATCH \
    http://0.0.0.0:1026/v2/entities/air_quality_observer_be_001/attrs \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json' \
    -d '{
    "precipitation": {
    "value": 100,
    "type": "Number"
    }
    }'

    7.从quantumLeap查询同一实体的降水变化记录。
    curl -X GET \
    'http://0.0.0.0:8668/v2/entities/air_quality_observer_be_001/attrs/precipitation?type=AirQualityObserved' \
    -H 'Accept: application/json'

    docker-compose.yml 的部分内容:
    orion:
    image: fiware/orion
    hostname: orion
    container_name: fiware-orion
    depends_on:
    - mongo-db
    expose:
    - "1026"
    ports:
    - "1026:1026"
    networks:
    - default
    command: -dbhost mongo-db -logLevel ERROR -corsOrigin __ALL
    mongo-db:
    image: mongo:3.6
    hostname: mongo-db
    container_name: db-mongo
    expose:
    - "27017"
    ports:
    - "27017:27017"
    networks:
    - default
    command: --bind_ip_all --smallfiles
    volumes:
    - mongo-db:/data
    cratedb:
    image: crate:3.1.2
    hostname: cratedb
    container_name: db-crate
    expose:
    - "4200"
    - "4300"
    - "5432"
    ports:
    - "4200:4200"
    - "4300:4300"
    - "5432:5432"
    networks:
    - default
    command: -Ccluster.name=democluster -Chttp.cors.enabled=true -Chttp.cors.allow-origin="*"
    volumes:
    - crate-db:/data
    quantumleap:
    image: smartsdk/quantumleap
    hostname: quantumleap
    container_name: fiware-quantumleap
    expose:
    - "8668"
    ports:
    - "8668:8668"
    depends_on:
    - cratedb
    environment:
    - CRATE_HOST=cratedb # host name of CrateDB

    没有解决,但有一点线索。

    我从quantumLeap 得到了一些日志。在quantumLeap中有一个crate客户端,还有 原因可能是quantumLeap 中的crate 客户端工作不正常。

    我把日志贴在这里:
    crate.client.exceptions.ProgrammingError: SQLActionException[ClusterBlockException: blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];]
    172.18.1.1 - - [04/May/2020 17:00:33] "POST /v2/notify HTTP/1.1" 500 -
    INFO:werkzeug:172.18.1.1 - - [04/May/2020 17:00:33] "POST /v2/notify HTTP/1.1" 500 -
    INFO:translators.factory:Backend selected for tenant 'iothouse' is: crate
    ERROR:app:Exception on /v2/notify [POST]
    Traceback (most recent call last):
    File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
    File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
    File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
    File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
    File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
    File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
    File "/usr/local/lib/python3.6/site-packages/connexion/decorators/decorator.py", line 48, in wrapper
    response = function(request)
    File "/usr/local/lib/python3.6/site-packages/connexion/decorators/uri_parsing.py", line 143, in wrapper
    response = function(request)
    File "/usr/local/lib/python3.6/site-packages/connexion/decorators/validation.py", line 172, in wrapper
    response = function(request)
    File "/usr/local/lib/python3.6/site-packages/connexion/decorators/validation.py", line 347, in wrapper
    return function(request)
    File "/usr/local/lib/python3.6/site-packages/connexion/decorators/parameter.py", line 126, in wrapper
    return function(**kwargs)
    File "/src/ngsi-timeseries-api/src/reporter/reporter.py", line 189, in notify
    trans.insert(payload, fiware_s, fiware_sp)
    File "/src/ngsi-timeseries-api/src/translators/crate.py", line 189, in insert
    fiware_servicepath)
    File "/src/ngsi-timeseries-api/src/translators/crate.py", line 297, in _insert_entities_of_type
    self.cursor.executemany(stmt, entries)
    File "/usr/local/lib/python3.6/site-packages/crate/client/cursor.py", line 67, in executemany
    self.execute(sql, bulk_parameters=seq_of_parameters)
    File "/usr/local/lib/python3.6/site-packages/crate/client/cursor.py", line 54, in execute
    bulk_parameters)
    File "/usr/local/lib/python3.6/site-packages/crate/client/http.py", line 328, in sql
    content = self._json_request('POST', self.path, data=data)
    File "/usr/local/lib/python3.6/site-packages/crate/client/http.py", line 448, in _json_request
    _raise_for_status(response)
    File "/usr/local/lib/python3.6/site-packages/crate/client/http.py", line 187, in _raise_for_status
    error_trace=error_trace)

    最佳答案

    解决了。根本原因在于 crateDB。当硬盘耗尽时,crateDB 关闭,每个表都设置为只读。即使在释放磁盘空间并且低于阈值后,只读块也不会自动从表中删除。

    在使用 crateDB 中的以下命令将 readonly 标志设置为 false 后,一切正常:

    SHOW CREATE TABLE <tableName>;
    ALTER TABLE <tableName> SET ("blocks.read_only_allow_delete" = FALSE);

    关于subscription - FIWARE QuantumLeap 健全性检查失败 : QuantumLeap can't get changed data from Orion,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61575239/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com