Clean couchdb and restart

后端 未结 5 1997
没有蜡笔的小新
没有蜡笔的小新 2021-02-04 09:15

What is command to clean CouchDB please ? And if I want to disable and re-start my CouchDB what is command?

Thanks

相关标签:
5条回答
  • 2021-02-04 09:28

    on Windows, if you installed it as a service, open services.msc, find the Apache couchDB service, and restart.

    0 讨论(0)
  • 2021-02-04 09:29

    CouchDB can be started/stopped/restarted from the /etc/init.d/couchdb or /etc/rc.d/couchdb startup script.

    (This startup script file might be located somewhere else on your system.)

    You would do something like this:

    1. To stop: /etc/init.d/couchdb stop
    2. To restart: /etc/init.d/couchdb restart

    As far as cleaning goes, I think you mean compaction. This is easiest to do via Futon, which is located here by default: http://localhost:5984/_utils

    Login to Futon as an admin, navigate to your database, and there will be links to compact the database.

    0 讨论(0)
  • 2021-02-04 09:37

    On Windows, you don't need to run a GUI like services.msc ... Typing this is usually faster:

    c:\> net stop "Apache CouchDb"
    c:\> net start "Apache CouchDb"
    
    0 讨论(0)
  • 2021-02-04 09:44

    You can restart CouchDb as per the documentation here

    Example with curl:

    curl -X POST http://localhost:5984/_restart -H"Content-Type: application/json"
    
    0 讨论(0)
  • 2021-02-04 09:46

    This can be somewhat dependent on OS and its version. On Ubuntu 14.04, for example (which is transitioning away from sysvinit), /etc/init.d/couchdb commands don't work for me. I have to do:

    sudo service couchdb restart
    

    So use the curl method posted by user2744667 (with root/admin privileges), or use the standard method for restarting daemons/services for your OS.

    Finally, as a last resort, you could kill the process. This is not the recommended way to do it, and it is not "clean" as you indicated in the question. You will likely find that CouchDB is agressive about respawning itself. But if you are in a homicidal mood, all that kill-ing could be just the thing.

    0 讨论(0)
提交回复
热议问题