database 清理 couchdb 并重新启动
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 
原文地址: http://stackoverflow.com/questions/13030551/
Warning: these are provided under cc-by-sa 4.0 license.  You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Clean couchdb and restart
提问by Mehdi
What is command to clean CouchDBplease ? And if I want to disableand re-startmy CouchDB what is command? 
请问清理命令是什么CouchDB?如果我想disable和re-start我的 CouchDB 什么是命令?
Thanks
谢谢
回答by Teddy
CouchDB can be started/stopped/restarted from the /etc/init.d/couchdbor /etc/rc.d/couchdbstartup script.
CouchDB 可以从/etc/init.d/couchdb或/etc/rc.d/couchdb启动脚本启动/停止/重新启动。
(This startup script file might be located somewhere else on your system.)
(此启动脚本文件可能位于系统上的其他位置。)
You would do something like this:
你会做这样的事情:
- To stop: /etc/init.d/couchdb stop
- To restart: /etc/init.d/couchdb restart
- 停止: /etc/init.d/couchdb stop
- 重启: /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
就清洁而言,我认为您的意思是压实。这是通过 Futon 最容易做到的,默认情况下它位于此处:http://localhost:5984/_utils
Login to Futon as an admin, navigate to your database, and there will be links to compact the database.
以管理员身份登录 Futon,导航到您的数据库,然后就会有压缩数据库的链接。
回答by jgskin
回答by labyrinth
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/couchdbcommands don't work for me. I have to do:
这可能在某种程度上取决于操作系统及其版本。例如,在 Ubuntu 14.04 上(正在从 sysvinit 过渡),/ etc/init.d/couchdb命令对我不起作用。我要做:
sudo service couchdb restart
So use the curl method posted by user2744667 (with root/admin privileges), oruse the standard method for restarting daemons/services for your OS.
因此,请使用 user2744667 发布的 curl 方法(具有 root/admin 权限),或使用标准方法为您的操作系统重新启动守护进程/服务。
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.
最后,作为最后的手段,您可以终止该进程。这不是推荐的方法,也不是您在问题中指出的“干净”。您可能会发现 CouchDB 对自我重生非常积极。但如果你有杀人的情绪,所有的杀戮都可能只是一回事。
回答by Tony O'Hagan
On Windows, you don't need to run a GUI like services.msc... Typing this is usually faster:
在 Windows 上,您不需要运行像services.msc...这样的 GUI输入通常更快:
c:\> net stop "Apache CouchDb"
c:\> net start "Apache CouchDb"
回答by tim
on Windows, if you installed it as a service, open services.msc, find the Apache couchDBservice, and restart.
在 Windows 上,如果您将其安装为服务,请打开services.msc,找到该Apache couchDB服务,然后重新启动。

