LoginSignup
16
13

More than 5 years have passed since last update.

Redis使おうとしていろいろやったメモ

Posted at

環境:

  • Ubuntu server 12.04.2 on VirtualBox で、メモリ512MBの1コア。
  • OpenSSHをインストール時に選択。
  • 2013/2/15現在で最新の以下のパッケージをインストール済。それ以外はまっさら。
    • zsh
    • make
    • gcc
    • vim
    • tcl

tar玉取得からmake失敗まで。一部加工してます。

$ wget http://redis.googlecode.com/files/redis-2.6.10.tar.gz
$ tar zxvf redis-2.6.10.tar.gz
$ cd redis-2.6.10/
$ make
cd src && make all
make[1]: Entering directory `redis-2.6.10/src'
    CC adlist.o
In file included from adlist.c:34:0:
zmalloc.h:50:31: fatal error: jemalloc/jemalloc.h: No such file or directory
compilation terminated.
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory `redis-2.6.10/src'
make: *** [all] Error 2

なんでmake失敗したのかは知らないですけど、distcleanすれば直るそうなので、そうします。

$ make distclean
$ make
--- 省略 ---
Hint: To run 'make test' is a good idea ;)

make[1]: Leaving directory `redis-2.6.10/src'

結構時間かかったんですけど、まあ無事いけたっぽいです。
で、make testしてみろって言うんで、してみました。

$ make test
=== 省略 ===
!!! WARNING The following tests failed:

*** [err]: After CLIENT SETNAME, connection can still be closed in tests/unit/introspection.tcl
Expected '0' to equal or match '1'
Cleanup: may take some time... OK
make[1]: *** [test] Error 1
make[1]: Leaving directory `redis-2.6.10/src'
make: *** [test] Error 2

めちゃくちゃ時間かかった割りにテストこけてるしorz
これ調べてもぜんぜんヒットしないんで、環境的な何かですか?

まあ気を取り直して、とりあえず動くか確認。

$ cd src
$ ./redis-server

なんかアスキーアート出てきました。
別ターミナル立ち上げて

$ cd redis-2.6.10/src
$ ./redis-cli
> SET hoge:fuga "bazz"
"OK"
> GET hoge:fuga
"bazz"

うーん。他のは試してないんですけど(テストこけたわけですし)、なんとなく動いてる?っぽいような。

16
13
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
16
13