sstableloader 使用 v3.11.6 主机中的 sstablefiles 在 v4.1.3 主机上运行:
sstableloader -v --nodes oneofthehosts --username whatever --password whatever --truststore /etc/cassandra/conf/truststore.jks --truststore-password whatever --keystore /etc/cassandra/conf/keystore.jks --keystore-password whatever /tmp/keyspace/table
(稍微修剪过的)错误消息:
com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: oneofthehosts/someip:9042 (com.datastax.driver.core.exceptions.OperationTimedOutException: [oneofthehosts/someip:9042] Operation timed out))
java.lang.RuntimeException: Unable to initialise org.apache.cassandra.utils.NativeSSTableLoaderClient
at org.apache.cassandra.utils.NativeSSTableLoaderClient.init(NativeSSTableLoaderClient.java:102)
at org.apache.cassandra.io.sstable.SSTableLoader.stream(SSTableLoader.java:167)
at org.apache.cassandra.tools.BulkLoader.load(BulkLoader.java:91)
at org.apache.cassandra.tools.BulkLoader.main(BulkLoader.java:58)
Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: oneofthehosts/someip:9042 (com.datastax.driver.core.exceptions.OperationTimedOutException: oneofthehosts/someip:9042] Operation timed out))
at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:270)
at com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:109)
at com.datastax.driver.core.Cluster$Manager.negotiateProtocolVersionAndConnect(Cluster.java:1813)
at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1726)
at com.datastax.driver.core.Cluster.init(Cluster.java:214)
at com.datastax.driver.core.Cluster.connectAsync(Cluster.java:387)
at com.datastax.driver.core.Cluster.connectAsync(Cluster.java:366)
at com.datastax.driver.core.Cluster.connect(Cluster.java:311)
at org.apache.cassandra.utils.NativeSSTableLoaderClient.init(NativeSSTableLoaderClient.java:70)
... 3 more
Exception in thread "main" org.apache.cassandra.tools.BulkLoadException: java.lang.RuntimeException: Unable to initialise org.apache.cassandra.utils.NativeSSTableLoaderClient
at org.apache.cassandra.tools.BulkLoader.load(BulkLoader.java:104)
at org.apache.cassandra.tools.BulkLoader.main(BulkLoader.java:58)
在 logback-tools.xml 中设置 TRACE 级别后的一些选定消息:
DEBUG 13:29:19,765 [oneofthehosts/someip:9042] preparing to open 1 new connections, total = 1
DEBUG 13:29:19,915 Connection[oneofthehosts/someip:9042-1, inFlight=0, closed=false] Connection established, initializing transport
TRACE 13:29:19,920 Connection[oneofthehosts/someip:9042-1, inFlight=0, closed=false], stream 0, writing request STARTUP {CQL_VERSION=3.0.0, DRIVER_VERSION=3.11.0, DRIVER_NAME=DataStax Java Driver}
DEBUG 13:29:20,113 [id: 0xef0b330f, L:/someip:44896 - R:oneofthehosts/someip:9042] HANDSHAKEN: TLS_AES_256_GCM_SHA384
waiting for timeout
TRACE 13:29:32,027 Defuncting Connection[oneofthehosts/someip:9042-1, inFlight=0, closed=false]
com.datastax.driver.core.exceptions.OperationTimedOutException: [oneofthehosts/someip:9042] Operation timed out
DEBUG 13:29:32,028 [oneofthehosts/someip:9042] preventing new connections for the next 1000 ms
DEBUG 13:29:32,029 [oneofthehosts/someip:9042] Connection[oneofthehosts/someip:9042-1, inFlight=0, closed=false] failed, remaining = 0
DEBUG 13:29:32,029 Connection[oneofthehosts/someip:9042-1, inFlight=0, closed=true] closing connection
DEBUG 13:29:32,029 Not terminating Connection[oneofthehosts/someip:9042-1, inFlight=0, closed=true]: there are still pending requests
DEBUG 13:29:32,031 Connection[oneofthehosts/someip:9042-1, inFlight=0, closed=true], stream 0, Error writing request STARTUP {CQL_VERSION=3.0.0, DRIVER_VERSION=3.11.0, DRIVER_NAME=DataStax Java Driver}
DEBUG 13:29:32,035 [Control connection] error on oneofthehosts/someip:9042 connection, no more host to try
这看起来很熟悉吗?是否与 TLS 相关,或者我们是否超出了初始连接设置?