New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve is couchbase up checking method #448

Closed
yurem opened this Issue Jul 3, 2018 · 5 comments

Comments

Projects
None yet
2 participants
@yurem
Contributor

yurem commented Jul 3, 2018

Current method allows to check if Couchbase is up. But I suspect it not checking if all it services are up and ready.

Here is part from log:

19:32:17 07/03/18 Running: /sbin/service stop couchbase-server
19:32:17 07/03/18 Run: /sbin/service stop couchbase-server with result code: 1
19:32:17 07/03/18 Running: /sbin/service start couchbase-server
19:32:17 07/03/18 Run: /sbin/service start couchbase-server with result code: 1
19:32:17 07/03/18 Checking if couchbase was started. Try 1 ...
19:32:17 07/03/18 Couchbase was not started. Will retry after 5 seconds.
19:32:22 07/03/18 Checking if couchbase was started. Try 2 ...
19:32:22 07/03/18 Couchbase was not started. Will retry after 5 seconds.
19:32:27 07/03/18 Checking if couchbase was started. Try 3 ...
19:32:27 07/03/18 Running: /opt/couchbase/bin/couchbase-cli cluster-init --cluster localhost:28091 --cluster-username admin --cluster-password secret --services data,index,query,fts --cluster-ramsize 1024
19:32:28 07/03/18 SUCCESS: Cluster initialized
...
19:32:35 07/03/18 Running Couchbase query from file ./output/n1ql/index_gluu.n1ql
19:32:35 07/03/18 Running: /opt/couchbase/bin/cbq --user admin --password secret --engine localhost:28091 --file ./output/n1ql/index_gluu.n1ql
19:32:35 07/03/18 �[31m ERROR 100 : N1QL: No query service found on this cluster �[0m
...
Few imports errors
...
19:32:35 07/03/18 Importing ldif file ./output/attributes.ldif to Couchebase
19:32:35 07/03/18 Running Couchbase query from file ./output/n1ql/attributes.n1ql
19:32:35 07/03/18 Running: /opt/couchbase/bin/cbq --user admin --password secret --engine localhost:28091 --file ./output/n1ql/attributes.n1ql
19:32:37 07/03/18  Connected to : http://localhost:28091/. Type Ctrl-D or \QUIT to exit.

 Path to history file for the shell : /root/.cbq_history 
UPSERT INTO `gluu` (KEY, VALUE) VALUES ("attributes_@!4E71.8093.C25D.F8D5!0001!ECBB.7407!0005!29DA", {"dn": "inum=@!4E71.8093.C25D.F8D5!0001!ECBB.7407!0005!29DA,ou=attributes,o=@!4E71.8093.C25D.F8D5!0001!ECBB.7407,o=gluu", "gluuAttributeType": "string", "description": "XRI i-number, persistent non-reassignable identifier", "gluuStatus": "active", "gluuAttributeEditType": "admin", "urn": "urn:gluu:dir:attribute-def:inum", "oxAuthClaimName": "inum", "gluuAttributeOrigin": "gluuPerson", "objectClass": ["top", "gluuAttribute"], "gluuAttributeViewType": ["user", "admin"], "inum": "@!4E71.8093.C25D.F8D5!0001!ECBB.7407!0005!29DA", "displayName": "Inum", "gluuAttributeName": "inum"});
{
    "requestID": "b307bd1e-1af4-4f04-9f9f-11effb8e31e7",
    "signature": null,
    "results": [
    ],
    "status": "success",
    "metrics": {
        "elapsedTime": "83.721742ms",
        "executionTime": "83.699643ms",
        "resultCount": 0,
        "resultSize": 0,
        "mutationCount": 1
    }
}
...
successfully imported rest of files

@yurem yurem added this to the 4.0 milestone Jul 3, 2018

@mbaser

This comment has been minimized.

Collaborator

mbaser commented Jul 3, 2018

This function is added

def checkIfGluuBucketReady(self):

Please check if it works.

@yurem

This comment has been minimized.

Contributor

yurem commented Jul 4, 2018

I've successfully installed 4.0.0 beta1 under CentOS 6.7.
But installation under Ubuntu 14.04 is not successful. I've got same issue. Here is full setup log:
setup.log

@yurem

This comment has been minimized.

Contributor

yurem commented Jul 4, 2018

I both cases I used same virtual hardware 3.5 Gb mem + 2 CPU
The host was the same.
I'm not sure that it's specific OS issue. Probably it's happen randomly.
Also in Ubuntu we are suing 5.1.0 b ut in CentOS we are using 5.1.1. Maybe there is startup bug in 5.1.0 Couchbase server.

Interesting that your checking method is working well. One second delay will help with this issue. Here is part from log:

...
06:23:25 07/04/18 �[31m ERROR 100 : N1QL: No query service found on this cluster �[0m
...
06:23:25 07/04/18  Connected to : http://localhost:28091/. Type Ctrl-D or \QUIT to exit.
...

But we need to find out better approach.

@yurem

This comment has been minimized.

Contributor

yurem commented Jul 4, 2018

I offer to run in loop with delay during 1 minute:

/opt/couchbase/bin/cbq --user admin --password secret --engine localhost:28091 --file ./output/n1ql/test.n1ql

and check exit code. It should be 0 before we can load main N1QL scripts.
We can try to replace current checking method with this one.

Sample test.n1ql:

SELECT 1 FROM `gluu`
@mbaser

This comment has been minimized.

Collaborator

mbaser commented Jul 4, 2018

closed by commit 4ab7c1d

@mbaser mbaser closed this Jul 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment