Redis [Snippet] Redis 32bit compiling problem on ubuntu 13.04

Redis logo

root@ubuntu-1303-amd64:/home/adminuser/redis-2.6.7# make 32bit
cd src && make 32bit
make[1]: Entering directory `/home/adminuser/redis-2.6.7/src’

WARNING: if it fails under Linux you probably need to install libc6-dev-i386

make CFLAGS=”-m32″ LDFLAGS=”-m32″
make[2]: Entering directory `/home/adminuser/redis-2.6.7/src’
rm -rf redis-server redis-sentinel redis-cli redis-benchmark redis-check-dump redis-check-aof *.o *.gcda *.gcno *.gcov redis.info lcov-html
(cd ../deps && make distclean)
make[3]: Entering directory `/home/adminuser/redis-2.6.7/deps’
(cd hiredis && make clean) > /dev/null || true
(cd linenoise && make clean) > /dev/null || true
(cd lua && make clean) > /dev/null || true
(cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true
(rm -f .make-*)
make[3]: Leaving directory `/home/adminuser/redis-2.6.7/deps’
(rm -f .make-*)
echo STD=-std=c99 -pedantic >> .make-settings
echo WARN=-Wall >> .make-settings
echo OPT=-O2 >> .make-settings
echo MALLOC=jemalloc >> .make-settings
echo CFLAGS=-m32 >> .make-settings
echo LDFLAGS=-m32 >> .make-settings
echo REDIS_CFLAGS= >> .make-settings
echo REDIS_LDFLAGS= >> .make-settings
echo PREV_FINAL_CFLAGS=-std=c99 -pedantic -Wall -O2 -g -rdynamic -ggdb -m32 -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src -DUSE_JEMALLOC -I../deps/jemalloc/include >> .make-settings
echo PREV_FINAL_LDFLAGS=-m32 -g -rdynamic -ggdb >> .make-settings
(cd ../deps && make hiredis linenoise lua jemalloc)
make[3]: Entering directory `/home/adminuser/redis-2.6.7/deps’
(cd hiredis && make clean) > /dev/null || true
(cd linenoise && make clean) > /dev/null || true
(cd lua && make clean) > /dev/null || true
(cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true
(rm -f .make-*)
(echo “-m32” > .make-ldflags)
(echo “-m32” > .make-cflags)
MAKE hiredis
cd hiredis && make static
make[4]: Entering directory `/home/adminuser/redis-2.6.7/deps/hiredis’
cc -std=c99 -pedantic -c -O3 -fPIC -m32 -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb net.c
net.c:34:23: fatal error: sys/types.h: No such file or directory
compilation terminated.
make[4]: *** [net.o] Error 1
make[4]: Leaving directory `/home/adminuser/redis-2.6.7/deps/hiredis’
make[3]: *** [hiredis] Error 2
make[3]: Leaving directory `/home/adminuser/redis-2.6.7/deps’
make[2]: [persist-settings] Error 2 (ignored)
CC adlist.o
In file included from /usr/include/features.h:341:0,
from /usr/include/stdlib.h:24,
from adlist.c:32:
/usr/include/stdc-predef.h:30:26: fatal error: bits/predefs.h: No such file or directory
compilation terminated.
make[2]: *** [adlist.o] Error 1
make[2]: Leaving directory `/home/adminuser/redis-2.6.7/src’
make[1]: *** [32bit] Error 2
make[1]: Leaving directory `/home/adminuser/redis-2.6.7/src’
make: *** [32bit] Error 2
root@ubuntu-1303-amd64:/home/adminuser/redis-2.6.7# make
cd src && make all
make[1]: Entering directory `/home/adminuser/redis-2.6.7/src’
CC adlist.o
In file included from /usr/include/features.h:341:0,
from /usr/include/stdlib.h:24,
from adlist.c:32:
/usr/include/stdc-predef.h:30:26: fatal error: bits/predefs.h: No such file or directory
compilation terminated.
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory `/home/adminuser/redis-2.6.7/src’
make: *** [all] Error 2

If got error like me, just type this command, apt-get install libc6-dev-i386 . And now redis ready to use.

Redis Persistence

Brijesh Mishra

Redis provides a different range of persistence options:

  • The RDB persistence performs point-in-time snapshots of your dataset at specified intervals.
  • the AOF persistence logs every write operation received by the server, that will be played again at server startup, reconstructing the original dataset. Commands are logged using the same format as the Redis protocol itself, in an append-only fashion. Redis is able to rewrite the log on background when it gets too big.
  • If you wish, you can disable persistence at all, if you want your data to just exist as long as the server is running.
  • It is possible to combine both AOF and RDB in the same instance. Notice that, in this case, when Redis restarts the AOF file will be used to reconstruct the original dataset since it is guaranteed to be the most complete.

The most important thing to understand is the different trade-offs between the…

View original post 2,681 more words

Redis [Snippet] Redis compiling problem on ubuntu 10.04 32bit

cd hiredis && make static
make[3]: Entering directory `/home/project/redis/redis-2.6.4/deps/hiredis’
gcc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb net.c
make[3]: gcc: Command not found
make[3]: *** [net.o] Error 127
make[3]: Leaving directory `/home/project/redis/redis-2.6.4/deps/hiredis’
make[2]: *** [hiredis] Error 2
make[2]: Leaving directory `/home/project/redis/redis-2.6.4/deps’
make[1]: [persist-settings] Error 2 (ignored)
CC adlist.o
/bin/sh: cc: not found
make[1]: *** [adlist.o] Error 127
make[1]: Leaving directory `/home/project/redis/redis-2.6.4/src’
make: *** [all] Error 2

That’s mean no gcc installed, so just type this command, apt-get install gcc

And then when I tried to make again, I’m encounter this problem.

root@vx-ubu:/home/project/redis/redis-2.6.4# make
cd src && make all
make[1]: Entering directory `/home/project/redis/redis-2.6.4/src’
CC adlist.o
In file included from adlist.c:34:
zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directory
zmalloc.h:55:2: error: #error “Newer version of jemalloc required
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory `/home/project/redis/redis-2.6.4/src’
make: *** [all] Error 2

All You have to do is type this command make distclean. And now, redis-2.6.4 is ready to use.