I'm trying to establish a connection to a GridDB database using Node.js and the griddb-node package. However, I keep encountering a 'Connection refused' error.
const griddb = require('griddb-node');
try {
const factory = griddb.StoreFactory.getInstance();
const store = factory.getStore({
host: 'localhost',
port: 31810,
clusterName: 'defaultCluster',
username: 'admin',
password: 'admin'
});
// Perform database operations here
store.close();
} catch (error) {
console.error('Connection refused error:', error);
}
I have already verified that the host, port, cluster name, username, and password are correct. What could be causing this error, and how can I handle it?