N1QL not working in the official Couchbase 4.0.0 CE AMI

How do I enable N1QL in the official 4.0.0 CE AMI?

[ec2-user@myec2hostname ~]$ /opt/couchbase/bin/cbq
Couchbase query shell connected to http://localhost:8093/ . Type Ctrl-D to exit.
cbq> SELECT * FROM travel-sample LIMIT 10;
ERROR 100 : Unable to connect to query service http://localhost:8093/
cbq>

Hey @Kitanotori,

Were you able to first make a primary index?
cbq> CREATE PRIMARY INDEX ON 'beer-sample' USING GSI;

When the bucket is indexed, you are then able to run queries for example,
cbq> SELECT DISTINCT type FROM 'beer-sample';

You can also find more information on running N1QL queries over in the Couchbase Developer Portal.

Hope that helps,
William

Same error:

$ /opt/couchbase/bin/cbq
Couchbase query shell connected to http://localhost:8093/ . Type Ctrl-D to exit.
cbq> CREATE PRIMARY INDEX ON 'travel-sample' USING GSI;
 ERROR 100 : Unable to connect to query service http://localhost:8093/ 
cbq>

I think I found the reason. In the admin console, only data service is listed whereas in my similar local setup data, index, and query services are listed.

Why are not index and query service activated even though they were selected in the initial setup of the AMI?

Was the server where it was not enabled an update or a fresh install? I think I saw similar in an upgrade scenario where only the data service was enabled post-install.

Fresh install, and all the three services (data, index, query) were ticked when performing setup via GUI. How do I enable the services post-install?

Hello, I’m interested in knowing how this issue was solved. I’m having the same answer from N1QL

I ended up reinstalling, but here’s a one possible way to fix without reinstalling: Is reinstall really the only way to fix hostname change?