首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法通过网络连接到VoltDB

无法通过网络连接到VoltDB
EN

Stack Overflow用户
提问于 2019-05-30 18:20:37
回答 1查看 360关注 0票数 0

我开始使用VoltDB了。在局域网中的服务器上运行VoltDB社区。服务器启动后,报告服务器初始化已完成

代码语言:javascript
复制
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.

我可以在本地连接到服务器,或者使用

代码语言:javascript
复制
sqlcmd --servers=192.168.1.4

或通过

代码语言:javascript
复制
sqlcmd

但是,当我尝试在go应用程序中使用voltdb-client-go进行连接时,它显示以下错误

代码语言:javascript
复制
No valid connections failed to connect to server 192.168.1.4

下面是我正在尝试的代码

代码语言:javascript
复制
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...")
}

我也尝试了"192.168.1.4:21212“,但得到了同样的错误。代码中有什么错误?

在数据库机器上没有防火墙(ipconfig)。

EN

回答 1

Stack Overflow用户

发布于 2019-05-30 18:42:53

在hello_word中,它使用localhost:21212作为连接字符串,所以我只是跟随并将192.168.1.4:21212

但它应该是

代码语言:javascript
复制
voltdb://192.168.1.4:21212

它修复了连接问题。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56376308

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档