Memcached protocol and Tarantool

269 views
Skip to first unread message

Pham Cong Dinh

unread,
Jul 29, 2013, 4:19:10 AM7/29/13
to tara...@googlegroups.com
I am testing Tarantool as a drop-in replacement to Memcached. I don't want to replace my NodeJS and Python code that establish connections to Memcached with Tarantool-specific drivers yet.

However, when I add the following line into etc/tarantool.cfg

# Expect that Tarantool listens on the port 11212
memcached_port = 11212

I see no effect at all. No such port is opened.

Am I missing something?

Konstantin Osipov

unread,
Jul 29, 2013, 4:29:53 AM7/29/13
to tara...@googlegroups.com
* Pham Cong Dinh <pcd...@gmail.com> [13/07/29 12:25]:
No, it should work. Did you restart the server?

Here is a configuration file that definitely works:

https://github.com/tarantool/tarantool/blob/master/test/memcached/cfg/master.cfg

--
http://tarantool.org - an efficient, extensible in-memory data store

Nihar Nayak

unread,
Oct 30, 2015, 5:33:36 AM10/30/15
to Tarantool discussion group (English)
Hi,
I am trying to establish connections between Memcached and tarantool.
Can you help me with this?

--Nihar

Roman Tsisyk

unread,
Oct 30, 2015, 11:27:15 AM10/30/15
to tara...@googlegroups.com
> Friday, October 30, 2015 2:33 AM -07:00 from Nihar Nayak <typet...@gmail.com>:

> Hi,
> I am trying to establish connections between Memcached and tarantool.
> The following link is not working  :   https://github.com/tarantool/ tarantool/blob/master/test/ memcached/cfg/master.cfg  
> Can you help me with this?

Try https://github.com/tarantool/memcached with Tarantool 1.6.x.

--
WBR,
Roman Tsisyk <ro...@tarantool.org>
http://tarantool.org/ - an efficient in-memory data store and a Lua application server

Nihar Nayak

unread,
Nov 2, 2015, 4:37:34 AM11/2/15
to Tarantool discussion group (English), ro...@tarantool.org
Hi,
I tried following step  to compile memcached[https://github.com/tarantool/memcached]  on  Ubutnu installed with [tarantool tarantool-dev]  tarantool: version 1.6.6-214-g239000e.
 
cmake is failing with following error :

................
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
CMake Error at CMakeLists.txt:32 (add_subdirectory):
  The source directory

    /root/tarantool-memcached/memcached/third_party/small

  does not contain a CMakeLists.txt file.


-- Configuring incomplete, errors occurred!.
............

Is it something i missed here?

Eugine Blikh

unread,
Nov 2, 2015, 6:42:05 AM11/2/15
to tara...@googlegroups.com, Roman Tsisyk
Nihar, have you tried 'git submodule update --init'? It seems like the submodule folder (third_party/small) is missing.

С наилучшими пожеланиями, Евгений.

--
You received this message because you are subscribed to the Google Groups "Tarantool discussion group (English)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tarantool+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nihar Nayak

unread,
Nov 2, 2015, 7:08:18 AM11/2/15
to tara...@googlegroups.com
Hi Eugine,
 I did "git submodule update --init". previous error[third_party/small] has gone now. But following  error is still exist As "-- Could NOT find TARANTOOL (missing:  TARANTOOL_INCLUDEDIR TARANTOOL_INSTALL_PREFIX)". i am not sure where exactly following path need to set.

But somehow compilation proceeded sometime and failed with following error.

Scanning dependencies of target libmemcached_make
  GEN      libmemcached/csl/scanner.cc
  CXX      clients/clients_memcapable-memcapable.o
  CXX      libmemcached/clients_memcapable-byteorder.o
  CXX      clients/utilities.lo
  CXXLD    clients/libutilities.la
  CXX      libmemcached/csl/libmemcached_libmemcached_la-context.lo
In file included from libmemcached/csl/context.cc:39:0:
./libmemcached/csl/context.h:41:37: fatal error: libmemcached/csl/parser.h: No such file or directory
 #include "libmemcached/csl/parser.h"
                                     ^
compilation terminated.
make[3]: *** [libmemcached/csl/libmemcached_libmemcached_la-context.lo] Error 1
make[2]: *** [CMakeFiles/libmemcached_make] Error 2
make[1]: *** [CMakeFiles/libmemcached_make.dir/all] Error 2
make: *** [all] Error 2



--
You received this message because you are subscribed to a topic in the Google Groups "Tarantool discussion group (English)" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tarantool/y1LE5t1qwbM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tarantool+...@googlegroups.com.

Veeral Shah

unread,
Nov 2, 2015, 8:13:25 AM11/2/15
to Tarantool discussion group (English), ro...@tarantool.org
Hi Eugene,
  I updated the submodule folder. Now I am getting below errors

.....
/home/veerals/External/memcached-protocol-wrapper/memcached/memcached/internal/memcached_network.c:98:17: error: ‘COIO_WRITE’ undeclared (first use in this function)
   coio_wait(fd, COIO_WRITE, TIMEOUT_INFINITY);
                 ^
/home/veerals/External/memcached-protocol-wrapper/memcached/memcached/internal/memcached_network.c:98:17: note: each undeclared identifier is reported only once for each function it appears in
/home/veerals/External/memcached-protocol-wrapper/memcached/memcached/internal/memcached_network.c: In function ‘mnet_write’:
/home/veerals/External/memcached-protocol-wrapper/memcached/memcached/internal/memcached_network.c:118:17: error: ‘COIO_WRITE’ undeclared (first use in this function)
   coio_wait(fd, COIO_WRITE, TIMEOUT_INFINITY);
                 ^
/home/veerals/External/memcached-protocol-wrapper/memcached/memcached/internal/memcached_network.c: In function ‘mnet_read_ahead’:
/home/veerals/External/memcached-protocol-wrapper/memcached/memcached/internal/memcached_network.c:142:17: error: ‘COIO_READ’ undeclared (first use in this function)
   coio_wait(fd, COIO_READ, TIMEOUT_INFINITY);
                 ^
memcached/CMakeFiles/internalso.dir/build.make:100: recipe for target 'memcached/CMakeFiles/internalso.dir/internal/memcached_network.c.o' failed
make[2]: *** [memcached/CMakeFiles/internalso.dir/internal/memcached_network.c.o] Error 1
CMakeFiles/Makefile2:882: recipe for target 'memcached/CMakeFiles/internalso.dir/all' failed
make[1]: *** [memcached/CMakeFiles/internalso.dir/all] Error 2
Makefile:117: recipe for target 'all' failed

make: *** [all] Error 2


Eugine Blikh

unread,
Nov 2, 2015, 3:44:45 PM11/2/15
to tara...@googlegroups.com
Nihar, its problems in automake scripts in libmemcached, try to build memcached (it's `make internalso`) only.
Currently i'm rewriting it for use of CMake and for skipping it build by default.

С наилучшими пожеланиями, Евгений.

Veeral Shah

unread,
Nov 2, 2015, 11:42:56 PM11/2/15
to Tarantool discussion group (English)
Thanks Eugine for the pointer. I already tried that earlier, but that too was failing. (Get the same build error).

root@localhost:/home/veerals/External/memcached-protocol-wrapper/memcached/memcached# make internalso
[ 61%] Built target small
[ 69%] Building C object memcached/CMakeFiles/internalso.dir/internal/memcached_constants.c.o
[ 76%] Building C object memcached/CMakeFiles/internalso.dir/internal/memcached_layer.c.o
/home/veerals/External/memcached-protocol-wrapper/memcached/memcached/internal/memcached_layer.c: In function ‘convert_exptime’:
/home/veerals/External/memcached-protocol-wrapper/memcached/memcached/internal/memcached_layer.c:74:3: warning: implicit declaration of function ‘fiber_time64’ [-Wimplicit-function-declaration]
   exptime = fiber_time64() + exptime * 1000000;
   ^
[ 84%] Building C object memcached/CMakeFiles/internalso.dir/internal/memcached_network.c.o
/home/veerals/External/memcached-protocol-wrapper/memcached/memcached/internal/memcached_network.c: In function ‘iobuf_mempool_create’:
/home/veerals/External/memcached-protocol-wrapper/memcached/memcached/internal/memcached_network.c:33:2: warning: implicit declaration of function ‘cord_slab_cache’ [-Wimplicit-function-declaration]
  mempool_create(&ibuf_pool, cord_slab_cache(), sizeof(struct ibuf));
  ^
/home/veerals/External/memcached-protocol-wrapper/memcached/memcached/internal/memcached_network.c:33:29: warning: passing argument 2 of ‘mempool_create’ makes pointer from integer without a cast
  mempool_create(&ibuf_pool, cord_slab_cache(), sizeof(struct ibuf));
                             ^
In file included from /home/veerals/External/memcached-protocol-wrapper/memcached/memcached/internal/memcached_network.c:12:0:
/home/veerals/External/memcached-protocol-wrapper/memcached/third_party/small/mempool.h:213:1: note: expected ‘struct slab_cache *’ but argument is of type ‘int’
 mempool_create(struct mempool *pool, struct slab_cache *cache,
 ^
/home/veerals/External/memcached-protocol-wrapper/memcached/memcached/internal/memcached_network.c:34:29: warning: passing argument 2 of ‘mempool_create’ makes pointer from integer without a cast
  mempool_create(&obuf_pool, cord_slab_cache(), sizeof(struct obuf));
                             ^
In file included from /home/veerals/External/memcached-protocol-wrapper/memcached/memcached/internal/memcached_network.c:12:0:
/home/veerals/External/memcached-protocol-wrapper/memcached/third_party/small/mempool.h:213:1: note: expected ‘struct slab_cache *’ but argument is of type ‘int’
 mempool_create(struct mempool *pool, struct slab_cache *cache,
 ^
/home/veerals/External/memcached-protocol-wrapper/memcached/memcached/internal/memcached_network.c: In function ‘ibuf_new’:
/home/veerals/External/memcached-protocol-wrapper/memcached/memcached/internal/memcached_network.c:50:35: warning: passing argument 2 of ‘ibuf_create’ makes pointer from integer without a cast
  ibuf_create((struct ibuf *)ibuf, cord_slab_cache(), iobuf_readahead);
                                   ^
In file included from /home/veerals/External/memcached-protocol-wrapper/memcached/memcached/internal/memcached_network.c:13:0:
/home/veerals/External/memcached-protocol-wrapper/memcached/third_party/small/ibuf.h:72:1: note: expected ‘struct slab_cache *’ but argument is of type ‘int’
 ibuf_create(struct ibuf *ibuf, struct slab_cache *slabc, size_t start_capacity);
 ^
/home/veerals/External/memcached-protocol-wrapper/memcached/memcached/internal/memcached_network.c: In function ‘obuf_new’:
/home/veerals/External/memcached-protocol-wrapper/memcached/memcached/internal/memcached_network.c:59:35: warning: passing argument 2 of ‘obuf_create’ makes pointer from integer without a cast
  obuf_create((struct obuf *)obuf, cord_slab_cache(), iobuf_readahead);
                                   ^
In file included from /home/veerals/External/memcached-protocol-wrapper/memcached/memcached/internal/memcached_network.c:14:0:
/home/veerals/External/memcached-protocol-wrapper/memcached/third_party/small/obuf.h:108:1: note: expected ‘struct slab_cache *’ but argument is of type ‘int’
 obuf_create(struct obuf *buf, struct slab_cache *slabc, size_t start_capacity);
 ^
/home/veerals/External/memcached-protocol-wrapper/memcached/memcached/internal/memcached_network.c: In function ‘mnet_writev’:
/home/veerals/External/memcached-protocol-wrapper/memcached/memcached/internal/memcached_network.c:98:3: warning: implicit declaration of function ‘coio_wait’ [-Wimplicit-function-declaration]

   coio_wait(fd, COIO_WRITE, TIMEOUT_INFINITY);
   ^
/home/veerals/External/memcached-protocol-wrapper/memcached/memcached/internal/memcached_network.c:98:17: error: ‘COIO_WRITE’ undeclared (first use in this function)
   coio_wait(fd, COIO_WRITE, TIMEOUT_INFINITY);
                 ^
/home/veerals/External/memcached-protocol-wrapper/memcached/memcached/internal/memcached_network.c:98:17: note: each undeclared identifier is reported only once for each function it appears in
/home/veerals/External/memcached-protocol-wrapper/memcached/memcached/internal/memcached_network.c: In function ‘mnet_write’:
/home/veerals/External/memcached-protocol-wrapper/memcached/memcached/internal/memcached_network.c:118:17: error: ‘COIO_WRITE’ undeclared (first use in this function)
   coio_wait(fd, COIO_WRITE, TIMEOUT_INFINITY);
                 ^
/home/veerals/External/memcached-protocol-wrapper/memcached/memcached/internal/memcached_network.c: In function ‘mnet_read_ahead’:
/home/veerals/External/memcached-protocol-wrapper/memcached/memcached/internal/memcached_network.c:142:17: error: ‘COIO_READ’ undeclared (first use in this function)
   coio_wait(fd, COIO_READ, TIMEOUT_INFINITY);
                 ^
memcached/CMakeFiles/internalso.dir/build.make:100: recipe for target 'memcached/CMakeFiles/internalso.dir/internal/memcached_network.c.o' failed
make[3]: *** [memcached/CMakeFiles/internalso.dir/internal/memcached_network.c.o] Error 1

CMakeFiles/Makefile2:882: recipe for target 'memcached/CMakeFiles/internalso.dir/all' failed
make[2]: *** [memcached/CMakeFiles/internalso.dir/all] Error 2
CMakeFiles/Makefile2:894: recipe for target 'memcached/CMakeFiles/internalso.dir/rule' failed
make[1]: *** [memcached/CMakeFiles/internalso.dir/rule] Error 2
Makefile:148: recipe for target 'memcached/CMakeFiles/internalso.dir/rule' failed
make: *** [memcached/CMakeFiles/internalso.dir/rule] Error 2


Thanks
veeral

Nihar Nayak

unread,
Nov 3, 2015, 2:46:48 AM11/3/15
to Tarantool discussion group (English)
Thanks Eugine, I am still facing to build memcache/internal. it is error out with below message. I have a request that please let me know about your Cmake fix checkin.
 
/root/memcached/memcached/memcached/internal/memcached_network.c: In function ‘mnet_writev’:
/root/memcached/memcached/memcached/internal/memcached_network.c:98:3: warning: implicit declaration of function ‘coio_wait’ [-Wimplicit-function-declaration]
   coio_wait(fd, COIO_WRITE, TIMEOUT_INFINITY);
   ^
/root/memcached/memcached/memcached/internal/memcached_network.c:98:17: error: ‘COIO_WRITE’ undeclared (first use in this function)
   coio_wait(fd, COIO_WRITE, TIMEOUT_INFINITY);
                 ^
/root/memcached/memcached/memcached/internal/memcached_network.c:98:17: note: each undeclared identifier is reported only once for each function it appears in
/root/memcached/memcached/memcached/internal/memcached_network.c: In function ‘mnet_write’:
/root/memcached/memcached/memcached/internal/memcached_network.c:118:17: error: ‘COIO_WRITE’ undeclared (first use in this function)
   coio_wait(fd, COIO_WRITE, TIMEOUT_INFINITY);
                 ^
/root/memcached/memcached/memcached/internal/memcached_network.c: In function ‘mnet_read_ahead’:
/root/memcached/memcached/memcached/internal/memcached_network.c:142:17: error: ‘COIO_READ’ undeclared (first use in this function)
   coio_wait(fd, COIO_READ, TIMEOUT_INFINITY);
                 ^
make[2]: *** [memcached/CMakeFiles/internalso.dir/internal/memcached_network.c.o] Error 1
make[1]: *** [memcached/CMakeFiles/internalso.dir/all] Error 2

Eugine Blikh

unread,
Nov 3, 2015, 7:33:38 AM11/3/15
to tara...@googlegroups.com
Veeral, Nihar: what OS are you trying to build on? how do you install tarantool?

С наилучшими пожеланиями, Евгений.

Nihar Nayak

unread,
Nov 3, 2015, 7:41:13 AM11/3/15
to tara...@googlegroups.com
Eugine, i am using ubuntu .  i have installed  by using  apt-get install tarantool  tarantool-dev.

following is  version :

Setting up tarantool (1.6.6.269.gfe1519e~trusty-1) ...
Setting up tarantool-dev (1.6.6.269.gfe1519e~trusty-1) ...

Veeral Shah

unread,
Nov 3, 2015, 8:07:14 AM11/3/15
to Tarantool discussion group (English)
Hi Eugine
  I am using Fedora 21. The Tarantool version is tarantool-1.6.6-257 deployed via yum.
bash# rpm -qa | grep tarantool
tarantool-common-1.6.6-257.noarch
tarantool-1.6.6-257.x86_64
tarantool-dev-1.6.6-257.x86_64

I also made following small change to have the build proceed
# ls -al /usr/include  | grep taran
lrwxrwxrwx.  1 root root     32 Oct 23 03:41 luaconf.h -> /usr/include/tarantool/luaconf.h
lrwxrwxrwx.  1 root root     28 Oct 23 03:40 lua.h -> /usr/include/tarantool/lua.h
lrwxrwxrwx.  1 root root     30 Oct 23 03:40 lua.hpp -> /usr/include/tarantool/lua.hpp
lrwxrwxrwx.  1 root root     31 Oct 23 03:41 luajit.h -> /usr/include/tarantool/luajit.h
lrwxrwxrwx.  1 root root     31 Oct 23 03:41 lualib.h -> /usr/include/tarantool/lualib.h
drwxr-xr-x.  2 root root   4096 Oct 23 15:31 tarantool
lrwxrwxrwx.  1 root root     34 Oct 23 03:30 tarantool.h -> /usr/include/tarantool/tarantool.h

Eugine Blikh

unread,
Nov 4, 2015, 4:54:14 AM11/4/15
to tara...@googlegroups.com, Roman Tsisyk
Hello Veeral, Nihal.

You need to install packages tarantool and tarantool-dev from tarantool 1.6 repository:
for ubuntu
```
```
(debian is similar, simply replacing ubuntu with debian) OR for fedora
```
[tarantool]
name=Fedora-$releasever - Tarantool
enabled=1
gpgcheck=0
```
(centos is similar, simply replacing fedora with centos)

Currently memcached module uses API that's not in master branch. I'll update documentation in memcached module today.
Thank you for your interest in this project!

С наилучшими пожеланиями, Евгений.

Nihar Nayak

unread,
Nov 4, 2015, 5:50:35 AM11/4/15
to Tarantool discussion group (English), ro...@tarantool.org
Hi Eugine,
Thanks!! i updated to tarantool 1.6. i could build the interenal.so. But still my [make, make install] is failing. which is trying to build libmemcached internally.
Any suggestion regarding how can i utilize this  interenal.so.  

Eugine Blikh

unread,
Nov 4, 2015, 7:49:12 AM11/4/15
to tara...@googlegroups.com, Roman Tsisyk
Nihar, i've deleted unnecessary building of libmemcached in it, now you can use make install, it must not fail. One remark: please, specify right install prefix in cmake:
`cmake . -DCMAKE_INSTALL_PREFIX=/usr` for Ubuntu.

С наилучшими пожеланиями, Евгений.

Eugine Blikh

unread,
Nov 4, 2015, 7:51:25 AM11/4/15
to tara...@googlegroups.com, Roman Tsisyk
Veeral, have you solved your problem? you have tarantool 1.6.6 installed, but you need to install tarantool 1.6.7+ from this repo:

С наилучшими пожеланиями, Евгений.
Reply all
Reply to author
Forward
0 new messages