Optional
config: ConfigOptionsThe configuration for the client.
A Promise resolving to the connected client.
const Aerospike = require('aerospike')
// INSERT HOSTNAME AND PORT NUMBER OF AEROSPIKE SERVER NODE HERE!
var config = {
hosts: '192.168.33.10:3000',
}
Aerospike.connect(config, (err, client) => {
console.log("Connected. Closing now.")
client.close()
})
const Aerospike = require('aerospike')
// INSERT HOSTNAME AND PORT NUMBER OF AEROSPIKE SERVER NODE HERE!
var config = {
hosts: '192.168.33.10:3000',
}
const client = Aerospike.client(config)
client.connect((err) => {
console.log("Connected. Closing now.")
client.close()
})
const Aerospike = require('aerospike')
// INSERT HOSTNAME AND PORT NUMBER OF AEROSPIKE SERVER NODE HERE!
var config = {
hosts: '192.168.33.10:3000',
}
Aerospike.connect(config, (error, client) => {
if (error) {
console.error('Failed to connect to cluster: %s', error.message)
process.exit()
} else {
// client is ready to accept commands
console.log("Connected. Now closing connection.")
client.close()
}
})
const Aerospike = require('aerospike')
// INSERT HOSTNAME AND PORT NUMBER OF AEROSPIKE SERVER NODE HERE!
var config = {
hosts: '192.168.33.10:3000',
}
Aerospike.connect(config)
.then(client => {
// client is ready to accept commands
console.log("Connected. Now Closing Connection.")
client.close()
})
.catch(error => {
console.error('Failed to connect to cluster: %s', error.message)
})
The function to call, once the client is connected to the cluster successfully.
The configuration for the client.
The function to call, once the client is connected to the cluster successfully.
Creates a new Client instance and connects to the Aerospike cluster.