diff options
| author | eshujiushiwo <378013446@qq.com> | 2016-11-28 11:27:40 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-11-28 11:27:40 +0800 |
| commit | 5385bf9555f32adefe25457c025b2e895d94ac7c (patch) | |
| tree | f4c2aa537d016f5b1bcab54c370657a106fe61ba | |
| parent | dcaf1796fe0e41e39ac5c9602cb190cf150e7849 (diff) | |
| download | seaweedfs-5385bf9555f32adefe25457c025b2e895d94ac7c.tar.xz seaweedfs-5385bf9555f32adefe25457c025b2e895d94ac7c.zip | |
update cassandra connections
update cassandra connections
| -rw-r--r-- | weed/filer/cassandra_store/cassandra_store.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/weed/filer/cassandra_store/cassandra_store.go b/weed/filer/cassandra_store/cassandra_store.go index 50a792a65..e9e1d9222 100644 --- a/weed/filer/cassandra_store/cassandra_store.go +++ b/weed/filer/cassandra_store/cassandra_store.go @@ -32,7 +32,12 @@ type CassandraStore struct { func NewCassandraStore(keyspace string, hosts ...string) (c *CassandraStore, err error) { c = &CassandraStore{} - c.cluster = gocql.NewCluster(hosts...) + s := strings.Split(hosts, ",") + if len(s) == 1 { + c.cluster = gocql.NewCluster(hosts...) + } else if len(s) > 1 { + c.cluster = gocql.NewCluster(s[0], s[1]) + } c.cluster.Keyspace = keyspace c.cluster.Consistency = gocql.Quorum c.session, err = c.cluster.CreateSession() |
