这次用odb demo部署,我换成odp连接方式,代码如下:
package main
import (
"github.com/oceanbase/obkv-table-client-go/client"
"github.com/oceanbase/obkv-table-client-go/config"
//"github.com/oceanbase/obkv-table-client-go/table"
)
func main() {
const (
odpIP = "192.168.124.18"
odpRpcPort = 2883
database = "test"
fullUserName = "root@sys#obcluster"
passWord = ""
)
cfg := config.NewDefaultClientConfig()
_, err := client.NewOdpClient(fullUserName, passWord, odpIP, odpRpcPort, database, cfg)
if err != nil {
panic(err)
}
println("ok")
}
然后返回如下报错:
{"level":"warn","ts":"2024-06-25T14:34:41.590+0800","caller":"log/logger.go:136","msg":"connection closed.","error":"connection decode header error: magic header flag not match","connection uniqueId":546688144538702}
{"level":"info","ts":"2024-06-25T14:34:41.591+0800","caller":"log/logger.go:132","msg":"close connection start, remote addr:192.168.124.18:2883"}
{"level":"info","ts":"2024-06-25T14:34:41.591+0800","caller":"log/logger.go:132","msg":"close connection success, remote addr:192.168.124.18:2883"}
{"level":"info","ts":"2024-06-25T14:34:41.591+0800","caller":"log/logger.go:132","msg":"close connection start, remote addr:192.168.124.18:2883"}
{"level":"info","ts":"2024-06-25T14:34:41.591+0800","caller":"log/logger.go:132","msg":"close connection success, remote addr:192.168.124.18:2883"}
panic: init client, client:obClient{config:ClientConfig{ConnPoolMaxConnSize:1, ConnConnectTimeOut:1s, ConnLoginTimeout:1s, OperationTimeOut:10s, LogLevel:1, TableEntryRefreshLockTimeout:4s, TableEntryRefreshTryTimes:3, TableEntryRefreshIntervalBase:100ms, TableEntryRefreshIntervalCeiling:1.6s, MetadataRefreshInterval:1m0s, MetadataRefreshLockTimeout:8s, RsListLocalFileLocation:, RsListHttpGetTimeout:1s, RsListHttpGetRetryTimes:3, RsListHttpGetRetryInterval:100ms, EnableRerouting:false, MaxConnectionAge:0s, EnableSLBLoadBalance:false}, configUrl:, fullUserName:root@sys#obcluster, userName:root, tenantName:sys, clusterName:obcluster, database:test, sysUA:nil}: init ob table, obTable:ObTable{ip:192.168.124.18, port:2883, tenantName:sys, userName:root@sys#obcluster, password:, database:test, isClosed:false}: new rpc client, opt:RpcClientOption{ip:192.168.124.18, port:2883, connPoolMaxConnSize:1, connectTimeout:1s, loginTimeout:1s, tenantName:sys, databaseName:test, userName:root@sys#obcluster, password:, maxConnectionAge:0s, enableSLPS D:\odb> go run .
{"level":"warn","ts":"2024-06-25T16:17:53.396+0800","caller":"log/logger.go:136","msg":"connection closed.","error":"connection decode header error: magic header flag not match","connection uniqueId":501994714856526}
{"level":"info","ts":"2024-06-25T16:17:53.396+0800","caller":"log/logger.go:132","msg":"close connection start, remote addr:192.168.124.18:2883"}
{"level":"info","ts":"2024-06-25T16:17:53.396+0800","caller":"log/logger.go:132","msg":"close connection success, remote addr:192.168.124.18:2883"}
{"level":"info","ts":"2024-06-25T16:17:53.396+0800","caller":"log/logger.go:132","msg":"close connection start, remote addr:192.168.124.18:2883"}
{"level":"info","ts":"2024-06-25T16:17:53.396+0800","caller":"log/logger.go:132","msg":"close connection success, remote addr:192.168.124.18:2883"}
panic: init client, client:obClient{config:ClientConfig{ConnPoolMaxConnSize:1, ConnConnectTimeOut:1s, ConnLoginTimeout:1s, OperationTimeOut:10s, LogLevel:1, TableEntryRefreshLockTimeout:4s, TableEntryRefreshTryTimes:3, TableEntryRefreshIntervalBase:100ms, TableEntryRefreshIntervalCeiling:1.6s, MetadataRefreshInterval:1m0s, MetadataRefreshLockTimeout:8s, RsListLocalFileLocation:, RsListHttpGetTimeout:1s, RsListHttpGetRetryTimes:3, RsListHttpGetRetryInterval:100ms, EnableRerouting:false, MaxConnectionAge:0s, EnableSLBLoadBalance:false}, configUrl:, fullUserName:root@sys#obcluster, userName:root, tenantName:sys, clusterName:obcluster, database:test, sysUA:nil}: init ob table, obTable:ObTable{ip:192.168.124.18, port:2883, tenantName:sys, userName:root@sys#obcluster, password:, database:test, isClosed:false}: new rpc client, opt:RpcClientOption{ip:192.168.124.18, port:2883, connPoolMaxConnSize:1, connectTimeout:1s, loginTimeout:1s, tenantName:sys, databaseName:test, userName:root@sys#obcluster, password:, maxConnectionAge:0s, enableSLBLoadBalance:false}: create connection pool: create connection: connection login: execute login, uniqueId: 501994714856526 remote addr: 192.168.124.18:2883 tenantname: sys databasename: test: receive packet, trace: Y1C88FC0A87C4E-0000000000000001: connection close
obd cluster display demo :
obproxy端口是2883,内网ip是:192.168.124.18
请问什么原因会导致:connection decode header error: magic header flag not match 错误?是版本不一致的原因吗?
断点调试发现是这里出现了问题:
ezheader.go 文件的Decode函数中,第70行
谢谢回复!