自动迁移创建数据库名称 'undefined',在 loopback-connector-cassandra 中的 'undefined' 数据库中创建表

automigration create database name 'undefined', create tables within 'undefined' database in loopback-connector-cassandra

我正在尝试使用 loopback 3 框架和 cassandra 数据库从模型自动创建 table,但在将数据源与 cassandra 连接时遇到了一些问题 datasource.json

"cassandraConn": {
"host": "192.168.4.21",
"port": 9042,
"database": "emsv2_testing",
"password": "",
"name": "cassandraConn",
"user": "",
"connectTimeout": 30000,
"readTimeout": 30000,
"connector": "cassandra"
}

型号json 文件:-

{
"name": "data_rt_raw_t1",
"plural": "data_rt_raw_t1s",
"base": "PersistedModel",
"idInjection": true,
"options": {
"validateUpsert": true
},
"properties": {
"c_id": {
"type": "string",
"required": true,
"default": null
},
"slave_id": {
"type": "string",
"required": false,
"default": null
},
"dcu_id": {
"type": "string",
"required": false,
"default": null
},
"mfm_read_time": {
"type": "date",
"required": true,
"default": null
},
"data_store_time": {
"type": "date",
"required": false,
"default": null
},
"p1": {
"type": "number",
"required": false,
"default": null
},
"p2": {
"type": "number",
"required": false,
"default": null
},
"p3": {
"type": "number",
"required": false,
"default": null
},
"p4": {
"type": "number",
"required": false,
"default": null
},
"p5": {
"type": "number",
"required": false,
"default": null
}

},
"validations": [],
"relations": {},
"acls": [],
"methods": {}
}

自动迁移创建数据库名称 'undefined',在 'undefined' 数据库中创建 tables。尝试 post 数据出现以下错误,

{
"error": {
"statusCode": 500,
"name": "NoHostAvailableError",
"message": "Connecting after shutdown is not supported",
"info": "Represents an error when a query cannot be performed because no host is available or could be reached by the driver.",
"innerErrors": null,
"stack": "NoHostAvailableError: Connecting after shutdown is not supported\n at Client._connectCb (/home/rd/enms/node_modules/cassandra-driver/lib/client.js:397:21)\n at Client.promiseWrapper (/home/rd/enms/node_modules/cassandra-driver/lib/utils.js:410:13)\n at Client.connect (/home/rd/enms/node_modules/cassandra-driver/lib/client.js:384:31)\n at Array.utils.series.next (/home/rd/enms/node_modules/cassandra-driver/lib/client.js:854:18)\n at next

帮我解决这个问题,谢谢。

您发布的错误表明您的应用程序正在尝试 运行 在您关闭会话或与集群断开连接后进行查询。

如果您分享应用程序代码的一些相关部分,这里的贡献者将能够更好地帮助您。干杯!