8
私はpycassa
,cassandra.cluster
とdse.cluster
の両方を接続せずに試してみました。DseAuthenticatorとDseAuthorizerを使ってPythonをcassandraに接続する
私は間違ったホストに接続しているように感じます。私はLinuxサーバーのホスト名を書いていて、cassandraに関する何も指定していません。
大学生は、Linuxマシン上でcqlsh
のインラインでサーバーに接続することしか知りませんでした。それはちょっと意外と聞こえます。私はpycassaでやっている何をcassandra.yaml
authenticator: com.datastax.bdp.cassandra.auth.DseAuthenticator
authorizer: com.datastax.bdp.cassandra.auth.DseAuthorizer
で
具体的構成:
import pycassa
URIPORTLIST = ['12345.mycompany.net:9420']
pool = pycassa.ConnectionPool('my_keyspace', server_list=URIPORTLIST,credentials={'USERNAME':'fancycar','PASSWORD':'becauseimbatman'}, prefill=False)
cf = pycassa.ColumnFamily(pool, 'my_table')
エラーメッセージ:
AllServersUnavailable: An attempt was made to connect to each of the servers twice, but none of the attempts succeeded. The last failure was TTransportException: Could not connect to 12345.mycompany.net:9420
dse.cluster
エラーメッセージ:代わりに、カサンドラ1のdse.authのPlainTextAuthProviderを用いて固定
NoHostAvailable: ('Unable to connect to any servers', {'11.111.11.1': AuthenticationFailed('Failed to authenticate to 11.111.11.2: Error from server: code=0100 [Bad credentials] message="Failed to login. Please re-try."',)})
はそれかどうかを確認するためにcqlshから同じホストおよび認証情報を使用してカサンドラに接続してみてください作品... 'cqlsh 12345.mycompany.net -u fancycar -p becauseimbatman' –
@undefined_variable 提案をありがとう。 エラー: '[[email protected] SYST:〜]#cqlsh 12345.mycompany.net -u fancycar -p becauseimbatman' '接続エラー:( 'どのサーバーにも接続できません' ('11 .111.11 '、9042)]に接続しようとしました。最終エラー:タイムアウト ")})' 「通常どおり」にログインすると、「 '[[email protected] SYST:〜]#cqlsh -u fancycar -p becauseimbatman' ' 12345_clusterに12345.mycompany.net:9042で接続しました。 [cqlsh 5.0.1 |カサンドラ3.0.11.1485 | DSE 5.0.5 | CQL仕様3.4.0 |ネイティブプロトコルv4] ' – MadsVJ
第2のコマンドは、最初にリモートサーバーに接続しているときにlocalhostに接続します.. 12345.mycompany.netはlocalhostと同じホストに解決しますか? –