'Redis'에 해당되는 글 1건

  1. 2013.07.15 [NoSQL] Redis - Linux 설치 및 서비스 등록
2013.07.15 13:35

####################

# 방화벽 포트 등록 #

####################

$ vi /etc/sysconfig/iptables

-A INPUT -p tcp -m state --state NEW -m tcp --dport 6379 -j ACCEPT (6379 포트 항목 추가)

$ /etc/init.d/iptables restart (방화벽 포트 설정 재시작)


####################

# GCC 설치         #

####################

# yum groupinstall 'Development Tools'


####################

# Redis 설치       #

####################

$ wget http://redis.googlecode.com/files/redis-2.6.14.tar.gz

$ tar xzf redis-2.6.14.tar.gz

$ cd redis-2.6.14

$ make && make install


$ src/redis-server


$ src/redis-cli

redis> set foo bar

OK

redis> get foo

"bar":q


####################

# Redis 서비스 실행#

####################

$ mkdir /etc/redis /var/lib/redis

$ sed -e "s/^daemonize no$/daemonize yes/" -e "s/^dir \.\//dir \/var\/lib\/redis\//" -e "s/^loglevel debug$/loglevel notice/" -e "s/^logfile stdout$/logfile \/var\/log\/redis.log/" redis.conf > /etc/redis/redis.conf


$ wget https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server

$ sed -i "s/usr\/local\/sbin\/redis/usr\/local\/bin\/redis/" redis-server

$ chmod u+x redis-server

$ mv redis-server /etc/init.d

$ /sbin/chkconfig --add redis-server

$ /sbin/chkconfig --level 345 redis-server on

$ /sbin/service redis-server start

$ ps -ef // 프로세스 체크


####################

# Redis TEST       #

####################

telnet 아이피 포트

set attitude:today "happy"

get attitude:today



[출처]

http://redis.io/download

http://www.ebrueggeman.com/blog/install-redis-centos-56

Posted by CoolDragon

댓글을 달아 주세요