尝试使用 DSE graphloader 加载数据时出现错误 - DSE Graph 未配置为处理查询
While trying to load data using DSE graphloader I am getting the error - DSE Graph not configured to process queries
我正在使用 DSE Graphloader 将数据从 CSV 文件加载到 DSE Graph。
我执行了以下步骤来加载数据 –
创建图表:
system.graph('followTopic').create()
设置别名:
:remote config alias g followTopic.g
创建以下架构:
schema.propertyKey("id").Text().single().create()
schema.propertyKey("follower").Text().single().create()
schema.propertyKey("name").Text().single().create()
schema.propertyKey("type").Text().single().create()
schema.propertyKey("followed").Text().single().create()
schema.propertyKey("timestamp").Timestamp().single().create()
schema.vertexLabel("record").partitionKey("id").create()
schema.vertexLabel("user").properties("name").create()`
映射文件:
// CONFIGURATION
// Configures the data loader to create the schema
config create_schema: false, load_new: true, load_threads: 3
// DATA INPUT
// Define the data input source (a file which can be specified via command line arguments)
// inputfiledir is the directory for the input files
inputfiledir = '/home/adminuser/data/'
followTopic = File.csv(inputfiledir + "follow.csv").delimiter(',')
//Specifies what data source to load using which mapper (as defined inline)
load(followTopic).asVertices {
label "record"
key "id"
}
我使用的CSV是:
id,follower,followed,type,timestamp
1,@20cburns,topic_/best-friend,topic,5/7/2016 11:03:42 PM +00:00
2,@68,topic_/tears-fall,topic,5/3/2016 2:20:01 AM +00:00
3,@abba,topic_/best-friend,topic,6/15/2016 4:08:24 PM +00:00
…
然后在 运行 graphloader 命令上我得到下面提到的错误 -
./graphloader ../followTopinMapping.groovy -filename ../follow.csv -graph followTopic -address localhost
异常错误信息:
2016-08-22 14:18:00 ERROR DataLoaderImpl:519 - Graph driver attempts exceeded for this operation, logging failure, but no records are present (may have been a schema operation)
com.datastax.dsegraphloader.exception.TemporaryException: com.datastax.driver.core.exceptions.InvalidQueryException: DSE Graph not configured to process queries
at com.datastax.dsegraphloader.impl.loader.driver.DseGraphDriverImpl.executeGraphQuery(DseGraphDriverImpl.java:71)
at com.datastax.dsegraphloader.impl.loader.driver.DseGraphDriverImpl.executeGraphQuery(DseGraphDriverImpl.java:87)
at com.datastax.dsegraphloader.impl.loader.driver.DseGraphDriverImpl.getSchema(DseGraphDriverImpl.java:128)
at com.datastax.dsegraphloader.impl.loader.driver.SafeGraphDriver.lambda$tryGetSchema(SafeGraphDriver.java:94)
at com.datastax.dsegraphloader.impl.loader.DataLoaderImpl.execute(DataLoaderImpl.java:194)
at com.datastax.dsegraphloader.impl.loader.DataLoaderBuilder.execute(DataLoaderBuilder.java:101)
at com.datastax.dsegraphloader.cli.Executable.execute(Executable.java:69)
at com.datastax.dsegraphloader.cli.Executable.main(Executable.java:163)
关于错误消息“DSE Graph not configured to process queries” 我需要为 DSE Graph loader 进行哪些配置才能将数据加载到DSE 图?
在这方面得到了 DataStax 人员的帮助以使其正常工作。
实际上集群上的一些设置搞砸了,所以我们刚刚创建了一个新集群,然后在 /etc/default/dse 文件中做了一个设置以在该集群的节点上启用 DSE Graph 服务-
GRAPH_ENABLED=1
之后将架构更新为 -
schema.propertyKey("id").Text().single().create()
schema.propertyKey("follower").Text().single().create()
schema.propertyKey("name").Text().single().create()
schema.propertyKey("type").Text().single().create()
schema.propertyKey("followed").Text().single().create()
schema.propertyKey("timestamp").Timestamp().single().create()
schema.vertexLabel("record").partitionKey("id").properties("follower", "name", "type", "followed", "timestamp").create()
另外关于 TimeStamp 应该是一个数字值,以便通过 DSE Graphloader 成功加载它。
进行这些更改后,我能够通过 DSE Graphloader 成功加载数据。
我正在使用 DSE Graphloader 将数据从 CSV 文件加载到 DSE Graph。
我执行了以下步骤来加载数据 –
创建图表:
system.graph('followTopic').create()
设置别名:
:remote config alias g followTopic.g
创建以下架构:
schema.propertyKey("id").Text().single().create()
schema.propertyKey("follower").Text().single().create()
schema.propertyKey("name").Text().single().create()
schema.propertyKey("type").Text().single().create()
schema.propertyKey("followed").Text().single().create()
schema.propertyKey("timestamp").Timestamp().single().create()
schema.vertexLabel("record").partitionKey("id").create()
schema.vertexLabel("user").properties("name").create()`
映射文件:
// CONFIGURATION
// Configures the data loader to create the schema
config create_schema: false, load_new: true, load_threads: 3
// DATA INPUT
// Define the data input source (a file which can be specified via command line arguments)
// inputfiledir is the directory for the input files
inputfiledir = '/home/adminuser/data/'
followTopic = File.csv(inputfiledir + "follow.csv").delimiter(',')
//Specifies what data source to load using which mapper (as defined inline)
load(followTopic).asVertices {
label "record"
key "id"
}
我使用的CSV是:
id,follower,followed,type,timestamp
1,@20cburns,topic_/best-friend,topic,5/7/2016 11:03:42 PM +00:00
2,@68,topic_/tears-fall,topic,5/3/2016 2:20:01 AM +00:00
3,@abba,topic_/best-friend,topic,6/15/2016 4:08:24 PM +00:00
…
然后在 运行 graphloader 命令上我得到下面提到的错误 -
./graphloader ../followTopinMapping.groovy -filename ../follow.csv -graph followTopic -address localhost
异常错误信息:
2016-08-22 14:18:00 ERROR DataLoaderImpl:519 - Graph driver attempts exceeded for this operation, logging failure, but no records are present (may have been a schema operation)
com.datastax.dsegraphloader.exception.TemporaryException: com.datastax.driver.core.exceptions.InvalidQueryException: DSE Graph not configured to process queries
at com.datastax.dsegraphloader.impl.loader.driver.DseGraphDriverImpl.executeGraphQuery(DseGraphDriverImpl.java:71)
at com.datastax.dsegraphloader.impl.loader.driver.DseGraphDriverImpl.executeGraphQuery(DseGraphDriverImpl.java:87)
at com.datastax.dsegraphloader.impl.loader.driver.DseGraphDriverImpl.getSchema(DseGraphDriverImpl.java:128)
at com.datastax.dsegraphloader.impl.loader.driver.SafeGraphDriver.lambda$tryGetSchema(SafeGraphDriver.java:94)
at com.datastax.dsegraphloader.impl.loader.DataLoaderImpl.execute(DataLoaderImpl.java:194)
at com.datastax.dsegraphloader.impl.loader.DataLoaderBuilder.execute(DataLoaderBuilder.java:101)
at com.datastax.dsegraphloader.cli.Executable.execute(Executable.java:69)
at com.datastax.dsegraphloader.cli.Executable.main(Executable.java:163)
关于错误消息“DSE Graph not configured to process queries” 我需要为 DSE Graph loader 进行哪些配置才能将数据加载到DSE 图?
在这方面得到了 DataStax 人员的帮助以使其正常工作。
实际上集群上的一些设置搞砸了,所以我们刚刚创建了一个新集群,然后在 /etc/default/dse 文件中做了一个设置以在该集群的节点上启用 DSE Graph 服务-
GRAPH_ENABLED=1
之后将架构更新为 -
schema.propertyKey("id").Text().single().create()
schema.propertyKey("follower").Text().single().create()
schema.propertyKey("name").Text().single().create()
schema.propertyKey("type").Text().single().create()
schema.propertyKey("followed").Text().single().create()
schema.propertyKey("timestamp").Timestamp().single().create()
schema.vertexLabel("record").partitionKey("id").properties("follower", "name", "type", "followed", "timestamp").create()
另外关于 TimeStamp 应该是一个数字值,以便通过 DSE Graphloader 成功加载它。
进行这些更改后,我能够通过 DSE Graphloader 成功加载数据。