Ubuntu:将 Memcached 作为守护进程运行
我已经在 Ubuntu 上安装了 memcached
。如何将它作为守护进程运行,以便它在后台运行并且我可以在我的 Rails 应用程序中使用它?
I have installed memcached
on Ubuntu. How can I run it as a daemon so that it runs in the background and I can use it in my rails application?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
memcached
默认配置为在启动时运行,至少在 10.10 上:在运行级别 2、3、4 和 5 中,memcached 将运行。
如果您不确定,可以使用
status
运行 initscript:memcached
is configured to run at boot by default, at least on 10.10:In runlevels 2, 3, 4, and 5, memcached will be running.
If you're not sure, you can run the initscript with
status
:以防万一其他人最终在这里寻找如何直接运行守护进程(例如在 docker 容器内)。您要查找的标志是
-d
。Just in case anyone else ends up here looking for how to run the daemon directly (like inside a docker container for example). The flag you're looking for is
-d
.在 ubuntu 上安装 memcached
apt-get install memcached
启动 memcached
/etc/init.d/memcached start
重新启动 memcached
/etc/init.d/memcached start
检查memcached的状态
/etc/init.d/memcached status
编辑memcached配置
sudo vi /etc/memcached.conf
默认情况下memcached将在
127.0.0.1:11211
上运行,并配置为默认在启动时运行To install memcached on ubuntu
apt-get install memcached
To start memcached
/etc/init.d/memcached start
To restart memcached
/etc/init.d/memcached start
To check the status of memcached
/etc/init.d/memcached status
To edit memcached config
sudo vi /etc/memcached.conf
By default memcached will run on
127.0.0.1:11211
and is configured to run at boot by default