Skip to content

Instantly share code, notes, and snippets.

@K90j1
Last active January 3, 2017 18:26
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save K90j1/5180761 to your computer and use it in GitHub Desktop.
Save K90j1/5180761 to your computer and use it in GitHub Desktop.
Deploy redis redis-2.6.11 on CentOS i686
$ cat /etc/redhat-release
CentOS release 5.9 (Final)
$ arch
i686
$ cd /usr/local/src
$ sudo wget http://redis.googlecode.com/files/redis-2.6.11.tar.gz
$ sudo tar xzvf redis-2.6.11.tar.gz
$ cd redis-2.6.11
$ sudo make
zmalloc.o: In function `zmalloc_used_memory`:
/usr/local/src/redis-2.6.11/src/zmalloc.c:223: undefined reference to `__sync_add_and_fetch_4`
collect2: ld はステータス 1 で終了しました
make[1]: *** [redis-server] エラー 1
make[1]: ディレクトリ `/usr/local/src/redis-2.6.11/src` から出ます
make: *** [all] エラー 2
$ sudo make clean
$ sudo vi src/.make-settings
-OPT=-O2
+OPT=-O2 -march=i686
$ sudo make
redis-cli.c:1095: 警告: dereferencing type-punned pointer will break strict-aliasing rules
$ sudo make test
cd src && make test
make[1]: ディレクトリ `/usr/local/src/redis-2.6.11/src` に入ります
You need tcl 8.5 or newer in order to run the Redis test
make[1]: *** [test] エラー 1
make[1]: ディレクトリ `/usr/local/src/redis-2.6.11/src` から出ます
make: *** [test] エラー 2
$ yum list tcl
Loaded plugins: priorities
311 packages excluded due to repository priority protections
Available Packages
tcl.i386 8.4.13-6.el5 base
$ cd ../
$ sudo wget http://prdownloads.sourceforge.net/tcl/tcl8.6.0-src.tar.gz
$ sudo tar xzvf tcl8.6.0-src.tar.gz
$ cd tcl8.6.0/unix
$ sudo ./configure
$ sudo make
$ sudo make install
$ sudo ln -s /usr/local/bin/tclsh8.6 /usr/local/bin/tclsh
$ cd ../../redis-2.6.11
$ sudo make install
$ sudo cp -p redis-2.6.11/utils/redis_init_script /etc/init.d/redis
$ sudo mkdir /etc/redis
$ sudo cp -p redis.conf /etc/redis/6379.conf
$ sudo vi /etc/redis/6379.conf
@@ -14,11 +14,11 @@
# By default Redis does not run as a daemon. Use 'yes' if you need it.
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
-daemonize no
+daemonize yes
# When running daemonized, Redis writes a pid file in /var/run/redis.pid by
# default. You can specify a custom pid file location here.
-pidfile /var/run/redis.pid
+pidfile /var/run/redis_6379.pid
# Accept connections on the specified port, default is 6379.
# If port 0 is specified Redis will not listen on a TCP socket.
@@ -61,12 +61,12 @@
# verbose (many rarely useful info, but not a mess like the debug level)
# notice (moderately verbose, what you want in production probably)
# warning (only very important / critical messages are logged)
-loglevel notice
+loglevel debug
# Specify the log file name. Also 'stdout' can be used to force
# Redis to log on the standard output. Note that if you use standard
# output for logging but daemonize, logs will be sent to /dev/null
-logfile stdout
+logfile /var/log/redis.log
# To enable logging to the system logger, just set 'syslog-enabled' to yes,
# and optionally update the other syslog parameters to suit your needs.
@@ -150,7 +150,7 @@
# The Append Only File will also be created inside this directory.
#
# Note that you must specify a directory here, not a file name.
-dir ./
+dir /usr/local/redis/
$ sudo mkdir /usr/local/redis
$ sudo /etc/init.d/redis start
$ sudo vi /etc/init.d/redis
@@ -10,6 +10,10 @@
+# chkconfig: - 85 15
+# description: redis-server
+# processname: redis
$ sudo /sbin/chkconfig --add redis
$ sudo /sbin/chkconfig redis on
$ sudo /sbin/chkconfig --list | grep redis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment