0
votes

I am getting started with VoltDB. Running VoltDB community on a server in LAN. Server initialization completed as reported after server start

Build: 9.0 voltdb-9.0-0-g6aae38a-local Community Edition
Loaded node-specific settings from voltdbroot/config/path.properties
Connecting to VoltDB cluster as the leader...
Host id of this node is: 0
Restarting the database cluster from the command logs
WARN: User authentication is not enabled. The database is accessible and could be modified or shut down by anyone on the network.
Partition placement has been restored.
Initializing the database. This may take a moment...
WARN: This is not a highly available cluster. K-Safety is set to 0.
WARN: Durability is turned off. Command logging is off.
Restoring from path: /home/samtech/voltdb-db/voltdbroot/snapshots with nonce: SHUTDOWN_20190530T151422_my4epdwk9mv4
Duplicate rows will be output to: /home/samtech/voltdb-db/voltdbroot/snapshots nonce: SHUTDOWN_20190530T151422_my4epdwk9mv4
Finished restore of /home/samtech/voltdb-db/voltdbroot/snapshots with nonce: SHUTDOWN_20190530T151422_my4epdwk9mv4 in 0.09 seconds
Server Operational State is: NORMAL
Server completed initialization.

I am able to connect to server locally, either with

sqlcmd --servers=192.168.1.4

or by

sqlcmd

But when i tried to connect using voltdb-client-go in my go application, it is showing following error

No valid connections failed to connect to server 192.168.1.4

Here is my code that i am trying

package main

import (
    "database/sql"
    "log"

    _ "github.com/VoltDB/voltdb-client-go/voltdbclient"
)

func main() {
    InitVDb()
}

func InitVDb() {
    VDb, err := sql.Open("voltdb", "192.168.1.4")
    if err != nil {
        log.Fatalf("Voltdb Connection error %v\n", err)
    }

    err = VDb.Ping()
    if err != nil {
        VDb.Close()
        log.Fatalf("Ping failed: %v\n", err)
    }

    log.Println("Connection suceeded...")
}

I also tried with "192.168.1.4:21212" but getting same error. What is wrong in the code ?

There is no firewall (ipconfig) at database machine.

1

1 Answers

1
votes

In hello_word, it was using localhost:21212 as connection string, so i just followed and put 192.168.1.4:21212

But it should be

voltdb://192.168.1.4:21212

It fixed the connection issue.