MCPcopy Create free account
hub / github.com/apache/iotdb-client-go / connectCluster

Function connectCluster

example/session_example.go:149–162  ·  view source on GitHub ↗

If your IotDB is a cluster version, you can use the following code for multi node connection

()

Source from the content-addressed store, hash-verified

147
148// If your IotDB is a cluster version, you can use the following code for multi node connection
149func connectCluster() {
150 config := &client.ClusterConfig{
151 NodeUrls: strings.Split("127.0.0.1:6667,127.0.0.1:6668,127.0.0.1:6669", ","),
152 UserName: "root",
153 Password: "root",
154 }
155 session, err := client.NewClusterSession(config)
156 if err != nil {
157 log.Fatal(err)
158 }
159 if err = session.OpenCluster(false); err != nil {
160 log.Fatal(err)
161 }
162}
163
164func printDevice1(sds *client.SessionDataSet) {
165 for _, columnName := range sds.GetColumnNames() {

Callers

nothing calls this directly

Calls 2

NewClusterSessionFunction · 0.92
OpenClusterMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…