さくらVPS(Debian)にRedisを入れて起動させる
Debian:6
Redis:2.8.2
Redis公式Download
とりあえず、この感じで入れる。
$ wget http://download.redis.io/releases/redis-2.8.2.tar.gz $ tar xzf redis-2.8.2.tar.gz $ cd redis-2.8.2 $ make
この最後のmakeのところで、
Hint: To run 'make test' is a good idea ;)
make testした方がいいよ、てへ、ってきたので、
$ cd src $ sudo make test
すると、無事に
\o/ All tests passed without errors!
って出るので、いい感じ。
とりあえず、
$ cd src $ ./redis-server
して動かすと、変なゴミ箱みたいなのが出る。これで動いてる。別スレでredis-cliして確かめると良い。
起動スクリプトを設定するのに、install_server.shを使ってやる。
詳しくは、READMEに書いてる。
で、早速やってみる。
$ cd utils $ sudo ./install_server.sh
すると、色々聞かれてデフォルトで答えていくと、最後の
Please select the redis executable path []
Mmmmm... it seems like you don't have a redis executable. Did you run make install yet?
と言われる。。。
これで、
$ make install
やってみても状況変わらず。
何やら、install_server.sh自体が怪しい模様。
・さくらのVPSにredisをインストール(ほぼこれにならってできた)
・Redis2.6のインストール
・さくらVPS(CentOS6.3)へのredisインストールとchkconfigへの登録
他にも書き換えました報告ちらほら…(まぁ、バージョン違ったりもするけど)
utils/install_server.shを
# Interactive service installer for redis server # this generates a redis config file and an /etc/init.d script, and installs them # this scripts should be run as root # PATH=$PATH:/usr/local/bin
これと
-echo $REDIS_INIT_HEADER > $TMP_FILE && cat $INIT_TPL_FILE >> $TMP_FILE || die "Could not write init script to $TMP_FILE" +echo -e $REDIS_INIT_HEADER > $TMP_FILE && cat $INIT_TPL_FILE >> $TMP_FILE || die "Could not write init script to $TMP_FILE"
を追加・修正。(-eを入れる)
これでもう一度、$ sudo ./install_server.shでやるといける。
(executable path のところを/usr/local/bin/redis-serverで指定してしまってもいいかも)
Installation successful!なったら、OK!
デフォ設定なら、
$ sudo /etc/init.d/redis_6379 start $ sudo /etc/init.d/redis_6379 stop
で動かせる。
あとは、確認でデフォなら、
/var/log/redis_6379.logでログ確認。
/var/lib/redis/6379で、dump.rdbあるか確認。
/etc/redis/6379.confでconfigを確認。(install_server.shのやり方でやると本来/redis-2.8.2/redis.confをいじいじしないといけないところを色々よきに図らってくれているぽい。デーモンのとこyesにしたりとか)
エラーのコメントとか、変なゴミ箱とか、Redisはお茶目だわ。
どんな人が作ってんのかなと思って見に行ったら、すげー猛者っぽいおっさんでお茶フイタわ。
ってことで以上。