Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从java代码连接cassandra群集时出错_Cassandra_Google Cloud Platform_Datastax_Datastax Enterprise - Fatal编程技术网

从java代码连接cassandra群集时出错

从java代码连接cassandra群集时出错,cassandra,google-cloud-platform,datastax,datastax-enterprise,Cassandra,Google Cloud Platform,Datastax,Datastax Enterprise,我在谷歌云中部署了datastax cassandra集群,能够从cqlsh加载数据和查询,但无法从JAVA代码连接。正在获取以下错误消息 卡桑德拉版本 3.0.7 错误消息 <searchResultResponse><error><errorCode>200</errorCode><errorMessage>All host(s) tried for query failed (tried: /104.155.229.139:90

我在谷歌云中部署了datastax cassandra集群,能够从cqlsh加载数据和查询,但无法从JAVA代码连接。正在获取以下错误消息

卡桑德拉版本

3.0.7
错误消息

<searchResultResponse><error><errorCode>200</errorCode><errorMessage>All host(s) tried for query failed (tried: /104.155.229.139:9042 (com.datastax.driver.core.exceptions.InvalidQueryException: unconfigured table schema_keyspaces))</errorMessage></error></searchResultResponse>
cluster_name: 'Test Cluster'

num_tokens: 64



hinted_handoff_enabled: true
max_hint_window_in_ms: 10800000 # 3 hours

hinted_handoff_throttle_in_kb: 1024

max_hints_delivery_threads: 2

hints_directory: /var/lib/cassandra/hints

hints_flush_period_in_ms: 10000

max_hints_file_size_in_mb: 128


batchlog_replay_throttle_in_kb: 1024

authenticator: AllowAllAuthenticator

authorizer: AllowAllAuthorizer

role_manager: com.datastax.bdp.cassandra.auth.DseRoleManager

roles_validity_in_ms: 2000


permissions_validity_in_ms: 2000


partitioner: org.apache.cassandra.dht.Murmur3Partitioner

data_file_directories:
     - /mnt/data

commitlog_directory: /mnt/commitlog

disk_failure_policy: stop

commit_failure_policy: stop

key_cache_size_in_mb:

key_cache_save_period: 14400

row_cache_size_in_mb: 0

row_cache_save_period: 0


counter_cache_size_in_mb:

counter_cache_save_period: 7200


saved_caches_directory: /mnt/saved_caches

commitlog_sync: periodic
commitlog_sync_period_in_ms: 10000

commitlog_segment_size_in_mb: 32


seed_provider:
    # Addresses of hosts that are deemed contact points. 
    # Cassandra nodes use this list of hosts to find each other and learn
    # the topology of the ring.  You must change this if you are running
    # multiple nodes!
    - class_name: org.apache.cassandra.locator.SimpleSeedProvider
      parameters:
          # seeds is actually a comma-delimited list of addresses.
          # Ex: "<ip1>,<ip2>,<ip3>"
          - seeds: "10.142.0.4"

concurrent_reads: 32
concurrent_writes: 32
concurrent_counter_writes: 32

concurrent_materialized_view_writes: 32







memtable_allocation_type: heap_buffers



index_summary_capacity_in_mb:

index_summary_resize_interval_in_minutes: 60

trickle_fsync: true

trickle_fsync_interval_in_kb: 10240

storage_port: 7000

ssl_storage_port: 7001

listen_address: 10.140.0.2

broadcast_address: 10.140.0.2



start_native_transport: true
native_transport_port: 9042



start_rpc: true

rpc_address: 0.0.0.0

rpc_port: 9160

broadcast_rpc_address: 10.140.0.2

rpc_keepalive: true

rpc_server_type: sync




thrift_framed_transport_size_in_mb: 15

incremental_backups: false

snapshot_before_compaction: false

auto_snapshot: true

tombstone_warn_threshold: 1000
tombstone_failure_threshold: 100000

column_index_size_in_kb: 64


batch_size_warn_threshold_in_kb: 64

batch_size_fail_threshold_in_kb: 640

unlogged_batch_across_partitions_warn_threshold: 10


compaction_throughput_mb_per_sec: 16

compaction_large_partition_warning_threshold_mb: 100

sstable_preemptive_open_interval_in_mb: 50



read_request_timeout_in_ms: 5000
range_request_timeout_in_ms: 10000
write_request_timeout_in_ms: 2000
counter_write_request_timeout_in_ms: 5000
cas_contention_timeout_in_ms: 1000
truncate_request_timeout_in_ms: 60000
request_timeout_in_ms: 10000

cross_node_timeout: false


phi_convict_threshold: 12

endpoint_snitch: GossipingPropertyFileSnitch

dynamic_snitch_update_interval_in_ms: 100 
dynamic_snitch_reset_interval_in_ms: 600000
dynamic_snitch_badness_threshold: 0.1

request_scheduler: org.apache.cassandra.scheduler.NoScheduler



server_encryption_options:
    internode_encryption: none
    keystore: resources/dse/conf/.keystore
    keystore_password: cassandra
    truststore: resources/dse/conf/.truststore
    truststore_password: cassandra
    # More advanced defaults below:
    # protocol: TLS
    # algorithm: SunX509
    # store_type: JKS
    # cipher_suites: [TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA,TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_
AES_256_CBC_SHA]
    # require_client_auth: false

client_encryption_options:
    enabled: false
    # If enabled and optional is set to true encrypted and unencrypted connections are handled.
    optional: false
    keystore: resources/dse/conf/.keystore
    keystore_password: cassandra
    # require_client_auth: false
    # Set trustore and truststore_password if require_client_auth is true
    # truststore: resources/dse/conf/.truststore
    # truststore_password: cassandra
    # More advanced defaults below:
    # protocol: TLS
    # algorithm: SunX509
    # store_type: JKS
    # cipher_suites: [TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA,TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_
AES_256_CBC_SHA]

internode_compression: dc

inter_dc_tcp_nodelay: false

tracetype_query_ttl: 86400
tracetype_repair_ttl: 604800

gc_warn_threshold_in_ms: 1000

enable_user_defined_functions: false

enable_scripted_user_defined_functions: false

windows_timer_interval: 1

auto_bootstrap: false
来自其中一个节点的Cassandray.yaml

<searchResultResponse><error><errorCode>200</errorCode><errorMessage>All host(s) tried for query failed (tried: /104.155.229.139:9042 (com.datastax.driver.core.exceptions.InvalidQueryException: unconfigured table schema_keyspaces))</errorMessage></error></searchResultResponse>
cluster_name: 'Test Cluster'

num_tokens: 64



hinted_handoff_enabled: true
max_hint_window_in_ms: 10800000 # 3 hours

hinted_handoff_throttle_in_kb: 1024

max_hints_delivery_threads: 2

hints_directory: /var/lib/cassandra/hints

hints_flush_period_in_ms: 10000

max_hints_file_size_in_mb: 128


batchlog_replay_throttle_in_kb: 1024

authenticator: AllowAllAuthenticator

authorizer: AllowAllAuthorizer

role_manager: com.datastax.bdp.cassandra.auth.DseRoleManager

roles_validity_in_ms: 2000


permissions_validity_in_ms: 2000


partitioner: org.apache.cassandra.dht.Murmur3Partitioner

data_file_directories:
     - /mnt/data

commitlog_directory: /mnt/commitlog

disk_failure_policy: stop

commit_failure_policy: stop

key_cache_size_in_mb:

key_cache_save_period: 14400

row_cache_size_in_mb: 0

row_cache_save_period: 0


counter_cache_size_in_mb:

counter_cache_save_period: 7200


saved_caches_directory: /mnt/saved_caches

commitlog_sync: periodic
commitlog_sync_period_in_ms: 10000

commitlog_segment_size_in_mb: 32


seed_provider:
    # Addresses of hosts that are deemed contact points. 
    # Cassandra nodes use this list of hosts to find each other and learn
    # the topology of the ring.  You must change this if you are running
    # multiple nodes!
    - class_name: org.apache.cassandra.locator.SimpleSeedProvider
      parameters:
          # seeds is actually a comma-delimited list of addresses.
          # Ex: "<ip1>,<ip2>,<ip3>"
          - seeds: "10.142.0.4"

concurrent_reads: 32
concurrent_writes: 32
concurrent_counter_writes: 32

concurrent_materialized_view_writes: 32







memtable_allocation_type: heap_buffers



index_summary_capacity_in_mb:

index_summary_resize_interval_in_minutes: 60

trickle_fsync: true

trickle_fsync_interval_in_kb: 10240

storage_port: 7000

ssl_storage_port: 7001

listen_address: 10.140.0.2

broadcast_address: 10.140.0.2



start_native_transport: true
native_transport_port: 9042



start_rpc: true

rpc_address: 0.0.0.0

rpc_port: 9160

broadcast_rpc_address: 10.140.0.2

rpc_keepalive: true

rpc_server_type: sync




thrift_framed_transport_size_in_mb: 15

incremental_backups: false

snapshot_before_compaction: false

auto_snapshot: true

tombstone_warn_threshold: 1000
tombstone_failure_threshold: 100000

column_index_size_in_kb: 64


batch_size_warn_threshold_in_kb: 64

batch_size_fail_threshold_in_kb: 640

unlogged_batch_across_partitions_warn_threshold: 10


compaction_throughput_mb_per_sec: 16

compaction_large_partition_warning_threshold_mb: 100

sstable_preemptive_open_interval_in_mb: 50



read_request_timeout_in_ms: 5000
range_request_timeout_in_ms: 10000
write_request_timeout_in_ms: 2000
counter_write_request_timeout_in_ms: 5000
cas_contention_timeout_in_ms: 1000
truncate_request_timeout_in_ms: 60000
request_timeout_in_ms: 10000

cross_node_timeout: false


phi_convict_threshold: 12

endpoint_snitch: GossipingPropertyFileSnitch

dynamic_snitch_update_interval_in_ms: 100 
dynamic_snitch_reset_interval_in_ms: 600000
dynamic_snitch_badness_threshold: 0.1

request_scheduler: org.apache.cassandra.scheduler.NoScheduler



server_encryption_options:
    internode_encryption: none
    keystore: resources/dse/conf/.keystore
    keystore_password: cassandra
    truststore: resources/dse/conf/.truststore
    truststore_password: cassandra
    # More advanced defaults below:
    # protocol: TLS
    # algorithm: SunX509
    # store_type: JKS
    # cipher_suites: [TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA,TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_
AES_256_CBC_SHA]
    # require_client_auth: false

client_encryption_options:
    enabled: false
    # If enabled and optional is set to true encrypted and unencrypted connections are handled.
    optional: false
    keystore: resources/dse/conf/.keystore
    keystore_password: cassandra
    # require_client_auth: false
    # Set trustore and truststore_password if require_client_auth is true
    # truststore: resources/dse/conf/.truststore
    # truststore_password: cassandra
    # More advanced defaults below:
    # protocol: TLS
    # algorithm: SunX509
    # store_type: JKS
    # cipher_suites: [TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA,TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_
AES_256_CBC_SHA]

internode_compression: dc

inter_dc_tcp_nodelay: false

tracetype_query_ttl: 86400
tracetype_repair_ttl: 604800

gc_warn_threshold_in_ms: 1000

enable_user_defined_functions: false

enable_scripted_user_defined_functions: false

windows_timer_interval: 1

auto_bootstrap: false
cluster\u名称:“测试集群”
令牌数:64
提示切换已启用:true
最大提示窗口时间:10800000 3小时
暗示的\u切换\u限制\u(单位:1024 kb)
最大提示线程数:2
提示\目录:/var/lib/cassandra/hints
提示\u刷新\u周期\u单位:10000
最大提示文件大小(mb):128
batchlog\u replay\u throttle\u(单位:kb):1024
验证者:AllowAllAuthenticator
授权人:授权人
角色_经理:com.datastax.bdp.cassandra.auth.DseRoleManager
2000年在学校中的角色
权限\u有效性\u在\u ms中:2000
分区者:org.apache.cassandra.dht.3分区者
数据文件目录:
-/mnt/data
commitlog\u目录:/mnt/commitlog
磁盘\u故障\u策略:停止
提交失败策略:停止
密钥缓存大小(单位:mb):
密钥缓存保存周期:14400
行缓存大小(单位:mb):0
行缓存保存周期:0
计数器缓存大小(单位:mb):
计数器缓存保存周期:7200
保存的\u缓存\u目录:/mnt/saved\u缓存
commitlog_同步:定期
提交日志同步周期(毫秒):10000
提交日志\段\大小\单位:32
种子提供程序:
#被视为联系人的主机地址。
#Cassandra节点使用此主机列表来相互查找和学习
#环的拓扑结构。如果正在运行,则必须更改此选项
#多个节点!
-类名:org.apache.cassandra.locator.SimpleSeedProvider
参数:
#种子实际上是一个以逗号分隔的地址列表。
#例:“,”
-种子:“10.142.0.4”
并发读数:32
并发写入:32
并发计数器写入:32
并发物化视图写入:32
memtable_分配_类型:堆_缓冲区
索引\u摘要\u容量\u(单位:mb):
索引\u摘要\u调整大小\u间隔\u分钟:60
涓流同步:正确
涓流同步间隔(单位:kb):10240
存储端口:7000
ssl_存储_端口:7001
收听地址:10.140.0.2
广播地址:10.140.0.2
启动\u本地\u传输:true
本地\u传输\u端口:9042
start_rpc:true
rpc_地址:0.0.0.0
rpc_端口:9160
广播地址:10.140.0.2
rpc_keepalive:正确
rpc_服务器_类型:同步
节约型框架运输型尺寸单位:15
增量备份:false
压缩前的快照:false
自动快照:true
墓碑警告阈值:1000
墓碑\u故障\u阈值:100000
列索引大小(kb):64
批量大小警告阈值大小(kb):64
批量大小失败阈值大小(kb):640
未标记的\u批\u跨\u分区\u警告\u阈值:10
每秒压缩量:16
压缩\u大分区\u警告\u阈值\u mb:100
sstable_抢占式_打开_间隔(单位:mb):50
读取请求超时时间单位:5000
范围\u请求\u超时\u(毫秒):10000
写入请求超时时间(单位:2000)
计数器写入请求超时时间单位:5000
cas\U争用\U超时\U毫秒:1000
截断请求超时时间(单位:60000)
请求超时(单位:10000)
交叉节点超时:false
phi_囚犯门槛:12
端点_告密者:八卦属性文件告密者
动态\u飞贼\u更新\u间隔\u毫秒:100
动态飞贼重置间隔时间:600000毫秒
动态窃贼不良阈值:0.1
请求调度程序:org.apache.cassandra.scheduler.NoScheduler
服务器加密选项:
节间加密:无
keystore:resources/dse/conf/.keystore
密钥库密码:cassandra
信任库:resources/dse/conf/.truststore
信任库密码:cassandra
#更高级的默认设置如下:
#协议:TLS
#算法:SunX509
#门店类型:JKS
#密码套件:[TLS_RSA_与AES_128_CBC_SHA,TLS_RSA_与AES_256_CBC_SHA,TLS_DHE_RSA_与AES_128_CBC_SHA,TLS_DHE_RSA_与AES_256_CBC_SHA,TLS_ECDHE_RSA_与AES_128_CBC_SHA,TLS_ECDHE_与RSA__
AES_256_CBC_SHA]
#需要\u客户端\u身份验证:false
客户端加密选项:
已启用:false
#如果enabled and optional设置为true,则会处理加密连接和未加密连接。
可选:false
keystore:resources/dse/conf/.keystore
密钥库密码:cassandra
#需要\u客户端\u身份验证:false
#如果require\u client\u auth为true,则设置trustore和truststore\u密码
#信任库:resources/dse/conf/.truststore
#信任库密码:cassandra
#更高级的默认设置如下:
#协议:TLS
#算法:SunX509
#门店类型:JKS
#密码套件:[TLS_RSA_与AES_128_CBC_SHA,TLS_RSA_与AES_256_CBC_SHA,TLS_DHE_RSA_与AES_128_CBC_SHA,TLS_DHE_RSA_与AES_256_CBC_SHA,TLS_ECDHE_RSA_与AES_128_CBC_SHA,TLS_ECDHE_与RSA__
AES_256_CBC_SHA]
节间压缩:dc
inter_dc_tcp_节点延迟:false
tracetype\u查询\u ttl:86400
tracetype\u repair\u ttl:604800
gc\u警告\u阈值\u毫秒:1000
启用用户定义的函数:false
启用\脚本\用户\定义的\函数:false
windows\u计时器\u间隔:1
自动引导:错误

谢谢,

根据它试图解析的表名,您可能正在使用的datastax java驱动程序版本早于3.0。Cassandra 3.0更改了模式表的解析方式,因此您需要java驱动程序3.0或更高版本(3.1.1是最新版本)。

解决此问题需要您编写的java代码。请把密码寄出去。yaml文件很可能不是问题。谢谢。通过指向正确版本的驱动程序,问题得以解决。