kyototycoonをmemcachedモードで使う

kyototycoonをmemcachedモードで使ったときの不思議な現象が出たのでメモ

使用したバージョンはこれ

kyotocabinet-1.2.76

kyototycoon-0.9.56

MacOS10.8

  • まずはOKパターン
$ /usr/local/bin/ktserver -host 127.0.0.1 -th 2 -plsv /usr/local/libexec/ktplugservmemc.dylib -plex 'opts=f' ./ktserver.kch >> ./ktserver.log
$ telnet localhost 11211
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
stats
STAT pid 88068
STAT uptime 8
STAT time 1360107774
STAT version KyotoTycoon/0.9.56
STAT pointer_size 64
STAT curr_connections 1
STAT threads 16
STAT curr_items 9800
STAT bytes 6794776
STAT db_apow 3
STAT db_bnum 1048583
STAT db_chksum 188
STAT db_count 9800
STAT db_dfunit 0
STAT db_flags 1
STAT db_fmtver 5
STAT db_fpow 10
STAT db_frgcnt 0
STAT db_ktcapcnt -1
STAT db_ktcapsiz -1
STAT db_ktopts 0
STAT db_librev 13
STAT db_libver 16
STAT db_msiz 67108864
STAT db_opts 0
STAT db_path ./ktserver.kch
STAT db_realsize 6794776
STAT db_realtype 48
STAT db_recovered 0
STAT db_reorganized 0
STAT db_size 6794776
STAT db_trimmed 0
STAT db_type 48
STAT set_hits 0
STAT set_misses 0
STAT get_hits 0
STAT get_misses 0
STAT delete_hits 0
STAT delete_misses 0
STAT incr_hits 0
STAT incr_misses 0
STAT decr_hits 0
STAT decr_misses 0
STAT cmd_set 0
STAT cmd_get 0
STAT cmd_delete 0
STAT cmd_flush 0
END
  • NGパターン
$ /usr/local/bin/ktserver -host 127.0.0.1 -port 11211 -th 2 -plsv /usr/local/libexec/ktplugservmemc.dylib -plex opts=f ./ktserver.kch
$ telnet localhost 11211
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
stats
Connection closed by foreign host.

ポートを明示的に指定すると落ちてしまう