简体   繁体   English

DSBulk CSV 加载 DataStax Astra 失败 Cassandra 数据库,缺少文件 config.json

[英]DSBulk CSV Load Failure to DataStax Astra Cassandra Database, missing file config.json

I am trying to load a csv into a database in DataStax Astra using the DSBulk tool.我正在尝试使用 DSBulk 工具将 csv 加载到 DataStax Astra 中的数据库中。

Here is the command I ran minus the sensitive details:这是我运行的命令减去敏感细节:

dsbulk load -url D:\\App\\data.csv -k data -t data -b D:\\App\\secure-connect-myapp -u username -p password

Here is the error I get back:这是我返回的错误:

Operation LOAD_20221206-004421-512000 failed: Invalid bundle: missing file config.json.

Here is the full log:这是完整的日志:

2022-12-06 00:44:21 INFO  Username and password provided but auth provider not specified, inferring PlainTextAuthProvider
2022-12-06 00:44:21 INFO  A cloud secure connect bundle was provided: ignoring all explicit contact points.
2022-12-06 00:44:21 INFO  A cloud secure connect bundle was provided and selected operation performs writes: changing default consistency level to LOCAL_QUORUM.
2022-12-06 00:44:21 INFO  Operation directory: C:\Program Files\dsbulk-1.10.0\bin\logs\LOAD_20221206-004421-512000
2022-12-06 00:44:21 ERROR Operation LOAD_20221206-004421-512000 failed: Invalid bundle: missing file config.json.
java.lang.IllegalStateException: Invalid bundle: missing file config.json
    at com.datastax.oss.driver.internal.core.config.cloud.CloudConfigFactory.createCloudConfig(CloudConfigFactory.java:114)
    at com.datastax.oss.driver.api.core.session.SessionBuilder.buildDefaultSessionAsync(SessionBuilder.java:876)
    at com.datastax.oss.driver.api.core.session.SessionBuilder.buildAsync(SessionBuilder.java:817)
    at com.datastax.oss.driver.api.core.session.SessionBuilder.build(SessionBuilder.java:835)
    at com.datastax.oss.dsbulk.workflow.commons.settings.DriverSettings.newSession(DriverSettings.java:560)
    at com.datastax.oss.dsbulk.workflow.load.LoadWorkflow.init(LoadWorkflow.java:145)
    at com.datastax.oss.dsbulk.runner.WorkflowThread.run(WorkflowThread.java:52)

The error says that config.json is missing, but it isn't.该错误表明缺少 config.json,但事实并非如此。 So I'm stuck.所以我卡住了。 Unless it's looking somewhere other than in the bundle I specified, but the bundle definitely has the config.json file.除非它在我指定的包之外的其他地方寻找,但包肯定有 config.json 文件。

Thank you for your question @SteveMonroe!感谢@SteveMonroe 的提问!

In order for you to leverage DataStax Bulk Loader (aka DSBulk, in short), you would need to pass in the secure connect bundle (SCB) correctly.为了让您利用 DataStax Bulk Loader(简称 DSBulk),您需要正确传递安全连接包 (SCB)。 What I mean when I say is that you need either the fully qualified path or the relative path to the SCB file.我的意思是,您需要 SCB 文件的完全限定路径或相对路径。

The correct command in your case would look like:您的情况下正确的命令如下所示:

./dsbulk load -url 'D:\\App\\data.csv' -k data -t data -b 'D:\\App\\secure-connect-myapp.zip' -u username -p password

Note that -b option takes in the full SCB filename along with .zip file extension.请注意, -b选项采用完整的 SCB 文件名以及.zip文件扩展名。

Other Resources:其他资源:

This error:这个错误:

...
java.lang.IllegalStateException: Invalid bundle: missing file config.json
    at com.datastax.oss.driver.internal.core.config.cloud.CloudConfigFactory.createCloudConfig(CloudConfigFactory.java:114)
    ...

indicates that the Java driver bundled with DSBulk is unable to connect to your Astra DB because it couldn't get the configuration details from the secure connect bundle .表示与 DSBulk 捆绑在一起的 Java 驱动程序无法连接到您的Astra DB ,因为它无法从安全连接捆绑包中获取配置详细信息。

Please make sure that the valid secure bundle ZIP is accessible to DSBulk.请确保 DSBulk 可以访问有效的安全包 ZIP。 You need to provide the path to the ZIP file, not just the directory.您需要提供 ZIP 文件的路径,而不仅仅是目录。 For example:例如:

$ dsbulk ... -b /path/to/secure-connect-db.zip ...

Please check the path in your command then try again.请检查命令中的路径,然后重试。 Cheers!干杯!


Please support the Apache Cassandra community by hovering over the cassandra tag above and click on Watch tag .请支持 Apache Cassandra 社区,将鼠标悬停在上面的cassandra标签上,然后单击“观看标签”。 Thanks!谢谢!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM