我正在使用剑圣推送服务器。如何在生产模式下启动 redis 和 juggernaut 原因我
juggernaut
或者
redis-server will keep on showing me log etc.
我在rails 3上使用ruby。
编辑
我按照这两个指南在生产服务器上设置juggernaut和redis
似乎两台服务器现在都运行顺利。但是我怎样才能访问
:8080/application.js for juggernaut.
我试过了
my_ip:8080/application.js but nothing.
对于托管,我使用的是 Linode。
编辑2
当我试图停止/启动 redis 服务器时,它会给我输出,即:
Starting/Stopping redis-server: redis-server.
但是当我为剑圣做同样的事情时,什么都没有。检查屏幕截图。
编辑
我看不到主宰的任何日志.. 有一个用于 redis 但没有用于主宰
编辑
/etc/init.d/juggernaut 文件的可执行文件权限 - 是
-rwxr-xr-x 1 fizzy fizzy 1310 Sep 19 11:06 juggernaut
PIDFILE=/var/run/juggernaut.pid' 已定义。那存在吗? - - 不
在“开始”部分,它运行“chown juggernaut:juggernaut”。用户 juggernaut 是否存在,它是 group juggernaut 的成员吗? - 是的是的
cat /etc/group redis:x:1002: juggernaut:x:113: groups juggernaut juggernaut : juggernaut
编辑
fizzy@li136-198:~$ sudo ls -l /usr/bin/juggernaut
ls: cannot access /usr/bin/juggernaut: No such file or directory
fizzy@li136-198:~$ sudo ls -l /usr/local/bin/juggernaut
lrwxrwxrwx 1 root root 40 Sep 20 02:48 /usr/local/bin/juggernaut -> ../lib/node_modules/juggernaut/server.js
我试着改变
DAEMON=/usr/bin/juggernaut
至
DAEMON=/usr/local/bin/juggernaut
之后我尝试使用重新启动主宰
sudo /etc/init.d/juggernaut start
服务器已启动,但未作为后台进程/服务。
编辑
在调试模式下运行脚本,即更改顶部的shebang行以添加-x,例如
#! /bin/bash -x
这是输出: -
+ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+ DAEMON=/usr/bin/juggernaut
+ NAME=Juggernaut2
+ DESC=Juggernaut2
+ PIDFILE=/var/run/juggernaut.pid
+ test -x /usr/bin/juggernaut
+ exit 0
编辑
改变我的主宰的路径,因为我的主宰似乎安装在其他地方。现在这是输出
fizzy@li136-198:~$ sudo /etc/init.d/juggernaut start
+ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+ DAEMON=/usr/local/bin/juggernaut
+ NAME=Juggernaut2
+ DESC=Juggernaut2
+ PIDFILE=/var/run/juggernaut.pid
+ test -x /usr/local/bin/juggernaut
+ set -e
+ case "$1" in
+ echo -n 'Starting Juggernaut2: '
Starting Juggernaut2: + touch /var/run/juggernaut.pid
+ chown juggernaut:juggernaut /var/run/juggernaut.pid
+ start-stop-daemon --start --quiet --umask 007 --pidfile /var/run/juggernaut.pid --chuid juggernaut:juggernaut --exec /usr/local/bin/juggernaut
20 Sep 06:41:16 - Your node instance does not have root privileges. This means that the flash XML policy file will be served inline instead of on port 843. This will slow down initial connections slightly.
20 Sep 06:41:16 - socket.io ready - accepting connections
node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: EADDRINUSE, Address already in use
at Server._doListen (net.js:1106:5)
at net.js:1077:14
at Object.lookup (dns.js:153:45)
at Server.listen (net.js:1071:20)
at Object.listen (/usr/local/lib/node_modules/juggernaut/lib/juggernaut/server.js:51:21)
at Object.listen (/usr/local/lib/node_modules/juggernaut/lib/juggernaut/index.js:9:10)
at Object.<anonymous> (/usr/local/lib/node_modules/juggernaut/server.js:21:12)
at Module._compile (module.js:402:26)
at Object..js (module.js:408:10)
at Module.load (module.js:334:31)
+ echo failed
failed
+ exit 0