Hello experts.
I’m trying to connect a remote couchbase server to N1QL and run interactive queries on it.
What are the steps I need to follow in order to start running queries?
What should I install and run on the server and what should I install and run on my local machine?
Also, should I create any view / index in order to start running queries?
The remote server couchbase server 3.0.1, on AWS ubuntu machine.
The local machines I’m using are OSX and windows.
Step 1: Expand the package archive.
Step 2: On the command line, navigate to your local N1QL directory.
Step 3: Run ./start_tutorial.sh (Unix)
./start_tutorial.bat (Windows)
Step 4: Open http://localhost:8093/tutorial in your browser
to use the tutorial on your local server.
To connect N1QL with your Couchbase Server:
./cbq-engine -couchbase http://[server_name]:8091/
To use the command-line interactive query tool:
./cbq-engine=http://[couchbase-query-engine-server-name]:8093/
Step 5: Before issuing queries against a Couchbase bucket,
run the following command from the query command line:
N1QL is a great technology to ease the creation of indexes and do more advanced searches than just single key lookups.
Just be aware that its indexing is buggy - in a 2 server setup the indexes are only used 50% of the time… making percieved speed a bit random.
Thanks @Lennartos.
I will keep that in mind.
For now, our need for N1QL is for our QA team that knows SQL but will find trouble in writing code or try to write views to do the tests.
For the programmer side that writes code, I don’t see the added value of N1QL upon the basic operations of views in couchbase.
I hope Couchbase team will consider the need to have a proper interactive query tool and invest in that direction
At the end I uninstalled the 3 nodes cluster of Couchbase server 3.0.3 version and installed the version 4.0 and now I am able to use N1QL from the query nodes.
cheers