Skip to content
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

Sync_gateway service installation result in two data directories when there is an inactive service #544

Closed
lichenyang2 opened this issue Dec 30, 2014 · 2 comments
Milestone

Comments

@lichenyang2
Copy link

I ran the script with --runbase=/root/temp, the data directory is created on /root/temp as well as /home/sync_gateway. This only happens when there is an old service created but it is in stop state. However, the old service is not active and its process is not running.

Steps:
0. Run install script to create a service with name sync_gateway2

  1. Clean up /home/sync_gateway and /root/temp directory to make sure there is no log and data directory, and config file. stop sync_gateway service and kill its processe.
  2. Run command: ./sync_gateway_service_install.sh --runbase="/root/temp"
  3. Checked that the service is created successfully
  4. Check /root/temp directory. Found data directory
  5. Check /home/sync_gateway directory. Found log and data directory and config file

See screen capture

[centos6 64:/opt/couchbase-sync-gateway/service ] $ initctl list | grep sync_gateway
sync_gateway2 stop/waiting
sync_gateway stop/waiting

[centos6 64:/opt/couchbase-sync-gateway/service ] $ stop sync_gateway
sync_gateway stop/waiting
[centos6 64:/opt/couchbase-sync-gateway/service ] $ killall sync_gateway
[centos6 64:/opt/couchbase-sync-gateway/service ] $  rm -rf /root/temp/*
[centos6 64:/opt/couchbase-sync-gateway/service ] $  rm -rf /home/sync_gateway/*
[centos6 64:/opt/couchbase-sync-gateway/service ] $  ls -ltr /root/temp
total 0
[centos6 64:/opt/couchbase-sync-gateway/service ] $  ls -ltr /home/sync_gateway
total 0
[centos6 64:/opt/couchbase-sync-gateway/service ] $  ps aux | grep sync_gateway
root     26142  0.0  0.0 103244   860 pts/0    S+   15:56   0:00 grep sync_gateway
[centos6 64:/opt/couchbase-sync-gateway/service ] $ ./sync_gateway_service_install.sh --runbase="/root/temp"
sync_gateway start/running, process 26174
[centos6 64:/opt/couchbase-sync-gateway/service ] $ ps aux | grep sync_gateway
root     26177  0.0  0.0  48572  1468 ?        S    15:56   0:00 su -c /opt/couchbase-sync-gateway/bin/sync_gateway /home/sync_gateway/sync_gateway.json >> /home/sync_gateway/logs/sync_gateway_access.log 2>> /home/sync_gateway/logs/sync_gateway_error.log sync_gateway
500      26181  0.0  0.0   9196  1204 ?        Ss   15:56   0:00 bash -c /opt/couchbase-sync-gateway/bin/sync_gateway /home/sync_gateway/sync_gateway.json >> /home/sync_gateway/logs/sync_gateway_access.log 2>> /home/sync_gateway/logs/sync_gateway_error.log
500      26183  0.3  0.1 359944  6068 ?        Sl   15:56   0:00 /opt/couchbase-sync-gateway/bin/sync_gateway /home/sync_gateway/sync_gateway.json
root     26362  0.0  0.0 103244   860 pts/0    S+   15:57   0:00 grep sync_gateway
[centos6 64:/opt/couchbase-sync-gateway/service ] $  ls -ltr /root/temp
total 4
drwxr-xr-x 2 sync_gateway sync_gateway 4096 Dec 30 15:56 data
[centos6 64:/opt/couchbase-sync-gateway/service ] $  ls -ltr /home/sync_gateway
total 12
-rw-r--r-- 1 root         root          158 Dec 30 15:56 sync_gateway.json
drwxr-xr-x 2 sync_gateway sync_gateway 4096 Dec 30 15:56 data
drwxr-xr-x 2 sync_gateway sync_gateway 4096 Dec 30 15:56 logs
[centos6 64:/opt/couchbase-sync-gateway/service ] $  cat  /home/sync_gateway/logs/sync_gateway_error.log 
15:56:52.913083 Enabling logging: [HTTP+]
15:56:52.913298 ==== Couchbase Sync Gateway/1.0.4(8;877a4b5) ====
15:56:52.913358 Configured Go to use all 4 CPUs; setenv GOMAXPROCS to override this
15:56:52.913449 Opening db /db as bucket "db", pool "default", server <walrus:>
15:56:52.913583 Opening Walrus database db on <walrus:>
15:56:52.916443 Using default sync function 'channel(doc.channels)' for database "db"
15:56:52.917116     Reset guest user to config
15:56:52.917168 Starting admin server on 127.0.0.1:4985
15:56:52.925806 Starting server on :4984 ...
[centos6 64:/opt/couchbase-sync-gateway/service ] $  initctl list | grep sync_gateway
sync_gateway2 stop/waiting
sync_gateway start/running, process 26174
@lichenyang2 lichenyang2 changed the title Sync_gateway service install script parameter -runbase created two data directories Sync_gateway service installation result in two data directories when there is an inactive service Dec 31, 2014
@ajres
Copy link

ajres commented Jan 8, 2015

Please retest, now when --runbase is passed, all other related paths are updated automatically

@lichenyang2
Copy link
Author

There is a design change not to allow more than one service instance created, and therefore this is no longer an issue.

@ajres ajres closed this as completed Feb 18, 2015
@ajres ajres removed the done label Feb 18, 2015
@zgramana zgramana modified the milestone: 1.1.0 Jun 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants