Do we need to install Node JS in any one of the Couchbase Server Nodes?

n1ql

#1

Hi,

We are developing a rest API in NodeJS which is retrieved and insert the documents into the Couchbase Server.
Do we need to deploy NodeJS files into any of our nodes? I have two nodes for the couchbase server.

Or else Can I deploy my NodeJS API somewhere else other than couchbase installed server and point out to my couchbase server.?

Is it good practice? Shall we get any performance issues?


#2

You can deploy the application wherever you’d like. It just requires network access on the ports listed in the documentation. That’s probably the most common method of deployment for security separation (the cluster can have a more restrictive network isolation) and scalability/management (you can upgrade/scale the app tier independently), but it definitely depends on your app and your needs.


#3

Thank you for your response @ingenthr I deployed my NodeJS file into some other system, which is doesn’t have couchbase server and i point out to one of my node, which is installed couchbase server.

When i hit API i am getting following error.

Error: An unknown N1QL error occured. This is usually related to an out-of-memory condition.

What would be the reason?


#4

Are you getting that intermittently, or consistently? If consistently, you might want to check to be sure the port is properly open (try sdk-doctor as a simple way to verify).

If it’s consistent, I’d also probably turn the log level up to the max (see the docs) and just do a simple request. You can probably intuit what’s going wrong or post what you see to a gist or something like that and we can try to help.


#5

I just checked a little further and with @brett19’s help, it looks like you can look at responseBody on the errors for more info when this is returned. One of the other causes is that the query service sometimes returns errors in JSON format, and sometimes they’re unparseable. The current error handling code puts whatever info it has there, so you can probably get more info right now just by inspecting that.