If your IotDB is a cluster version, you can use the following code for multi node connection
()
| 147 | |
| 148 | // If your IotDB is a cluster version, you can use the following code for multi node connection |
| 149 | func 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 | |
| 164 | func printDevice1(sds *client.SessionDataSet) { |
| 165 | for _, columnName := range sds.GetColumnNames() { |
nothing calls this directly
no test coverage detected
searching dependent graphs…