首页 > 解决方案 > sstableloader 远程批量上传

问题描述

我试图弄清楚如何从快照上传数据以及为什么我在批量上传时收到此错误。本地计算机正在尝试连接到 cassandra.mydomain.com。cassandra.yaml 是来自远程服务器的 yaml。无论是否指定--conf-path,我都会遇到相同的错误

感谢您的任何建议。卡桑德拉版本 3.11.2

~/deploy/cassandra/bin/sstableloader -d cassandra.mydomain.com --conf-path /tmp/cassandra.yaml /local/.data/cassandra/data/test/timeserie_time_daily-dd247b092e883bffbfce8621eff3cc3e/snapshots/1634621703263
        
10:10:50.138 [main] DEBUG o.a.c.config.YamlConfigurationLoader - Loading settings from file:/tmp/cassandra.yaml    
Exception in thread "main" org.apache.cassandra.exceptions.ConfigurationException: Expecting URI in variable: [cassandra.config]. Found[cassandra.yaml]. Please prefix the file with [file:///] for local files and [file://<server>/] for remote file
            s. If you are executing this from an external tool, it needs to set Config.setClientMode(true) to avoid loading configuration.
                    at org.apache.cassandra.config.YamlConfigurationLoader.getStorageConfigURL(YamlConfigurationLoader.java:80)
                    at org.apache.cassandra.config.YamlConfigurationLoader.loadConfig(YamlConfigurationLoader.java:100)
                    at org.apache.cassandra.config.DatabaseDescriptor.loadConfig(DatabaseDescriptor.java:262)
                    at org.apache.cassandra.config.DatabaseDescriptor.toolInitialization(DatabaseDescriptor.java:180)
                    at org.apache.cassandra.config.DatabaseDescriptor.toolInitialization(DatabaseDescriptor.java:151)
                    at org.apache.cassandra.tools.BulkLoader.load(BulkLoader.java:53)
                    at o
    
    rg.apache.cassandra.tools.BulkLoader.main(BulkLoader.java:48)

标签: cassandradatastaxk8ssandra

解决方案


如例外所述,您需要提供正确的 URL 到cassandra.yaml.

如果您使用的是本地计算机上的 YAML,则需要在其前面加上file:///. 例如:

$ sstableloader -f file:///path/to/cassandra.yaml
    -d node1
    ks_name/table_name

如果您要指定远程计算机上的 YAML,则需要在其前面加上file://host/. 例如:

$ sstableloader -f file://hostname_or_ip/path/to/cassandra.yaml
    -d node1
    ks_name/table_name

推荐阅读