| 1 |
Following are simple steps to get everything started: |
| 2 |
|
| 3 |
1) Build MySQL server. Please note libevent 1.4.12 is linked statically into daemon memcached. |
| 4 |
|
| 5 |
2) Start MySQL server. (make sure libmemcached.so and innodb_engine.so are copied to MySQL plugin directory). |
| 6 |
|
| 7 |
3) Create the configure table and a demo table by running innodb_memcached_config.sql |
| 8 |
|
| 9 |
mysql < scripts/innodb_memcached_config.sql |
| 10 |
|
| 11 |
4) Install the memcached daemon plugin: |
| 12 |
|
| 13 |
mysql> install plugin daemon_memcached soname "libmemcached.so"; |
| 14 |
|
| 15 |
5) Test it out |
| 16 |
telnet 127.0.0.1 11211 |
| 17 |
|
| 18 |
set a11 0 0 9 |
| 19 |
123456789 |
| 20 |
STORED |
| 21 |
get a11 |
| 22 |
VALUE a11 0 9 |
| 23 |
123456789 |
| 24 |
END |
| 25 |
|
| 26 |
6) Run memcapable |
| 27 |
Memcapable is part of libmemcached package, it is available at "https://code.launchpad.net/~libmemcached-developers/libmemcached/trunk". If you did not install libevent by yourself, you might need to set LD_LIBRARY_PATH to point libevent.so in the libevent directory. |
| 28 |
|
| 29 |
jy@jy-laptop:~/work2/mysql-5.6-labs-innodb-memcached/bld/mysql-test$ memcapable -v |
| 30 |
ascii quit [pass] |
| 31 |
ascii version [pass] |
| 32 |
ascii verbosity [pass] |
| 33 |
ascii set [pass] |
| 34 |
ascii set noreply [pass] |
| 35 |
ascii get [pass] |
| 36 |
ascii gets [pass] |
| 37 |
ascii mget [pass] |
| 38 |
ascii flush [pass] |
| 39 |
ascii flush noreply [pass] |
| 40 |
ascii add [pass] |
| 41 |
ascii add noreply [pass] |
| 42 |
ascii replace [pass] |
| 43 |
ascii replace noreply [pass] |
| 44 |
ascii cas [pass] |
| 45 |
ascii cas noreply [pass] |
| 46 |
ascii delete [pass] |
| 47 |
ascii delete noreply [pass] |
| 48 |
ascii incr [pass] |
| 49 |
ascii incr noreply [pass] |
| 50 |
ascii decr [pass] |
| 51 |
ascii decr noreply [pass] |
| 52 |
ascii append [pass] |
| 53 |
ascii append noreply [pass] |
| 54 |
ascii prepend [pass] |
| 55 |
ascii prepend noreply [pass] |
| 56 |
ascii stat [pass] |
| 57 |
binary noop [pass] |
| 58 |
binary quit [pass] |
| 59 |
binary quitq [pass] |
| 60 |
binary set [pass] |
| 61 |
binary setq [pass] |
| 62 |
binary flush [pass] |
| 63 |
binary flushq [pass] |
| 64 |
binary add [pass] |
| 65 |
binary addq [pass] |
| 66 |
binary replace [pass] |
| 67 |
binary replaceq [pass] |
| 68 |
binary delete [pass] |
| 69 |
binary deleteq [pass] |
| 70 |
binary get [pass] |
| 71 |
binary getq [pass] |
| 72 |
binary getk [pass] |
| 73 |
binary getkq [pass] |
| 74 |
binary incr [pass] |
| 75 |
binary incrq [pass] |
| 76 |
binary decr [pass] |
| 77 |
binary decrq [pass] |
| 78 |
binary version [pass] |
| 79 |
binary append [pass] |
| 80 |
binary appendq [pass] |
| 81 |
binary prepend [pass] |
| 82 |
binary prependq [pass] |
| 83 |
binary stat [pass] |
| 84 |
All tests passed |
| 85 |
|
| 86 |
7) memcached command line options now can be set by specifying MySQL configure variable "daemon_memcached-option" |
| 87 |
|
| 88 |
8) You can also configure the commit batch size by specifying boot time system variable "daemon_memcached-w_batch_size" and "daemon_memcached-r_batch_size" (--loose-daemon_memcached-w_batch_size=100). |
| 89 |
|
| 90 |
9) To enable binlog, please turn on server configure variable |
| 91 |
"innodb_direct_access_enable_binlog" along with "log-bin" at server boot time: |
| 92 |
msqld ... --log-bin --innodb_direct_access_enable_binlog=1 |