0

我正在尝试建立与集群的连接。这是代码

var client = aerospike.client({
  hosts: [ { addr: 'localhost', port: 3000 } ]
 }).connect(connect_callback(err){
 if (err.code != status.AEROSPIKE_OK) {
    console.log("Aerospike server connection Error: %j", err);
 } 
});

有谁知道发生了什么?谢谢

4

1 回答 1

2

它应该是

var client = aerospike.client({
  hosts: [ { addr: 'localhost', port: 3000 } ]
}).connect(function connect_callback(err){
if (err.code != status.AEROSPIKE_OK) {
  console.log("Aerospike server connection Error: %j", err);
} 
});

或者

function connect_callback(err)
{
  if (err.code != status.AEROSPIKE_OK) 
  {
       console.log("Aerospike server connection Error: %j", err);
  } 
}

其次是

var client = aerospike.client({
  hosts: [ { addr: 'localhost', port: 3000 } ]
}).connect(connect_callback);
于 2014-10-06T06:49:00.687 回答