Redis installation and use under Linux

Source: Internet
Author: User
Tags benchmark zts

????? Redis website address:http://www.redis.io/

???? Latest Version: 2.8.3

???? in the Linux under Installation Redis very simple, the specific steps are as follows (the official website is explained):

???? 1 , download the source code, unzip and compile the source code.

$ wget http://download.redis.io/releases/redis-2.8.3.tar.gz

$ tar xzf redis-2.8. 3. tar.gz

$ cd redis-2.8. 3

$ make

???? 2 , after the compilation is complete, SRC directory, there are four executable files Redis-server , Redis-benchmark , redis-cli and the redis.conf . And then copy it to a directory.

Mkdir/usr/redis

CP Redis-server/usr/redis

CP Redis-benchmark/usr/redis

CP Redis-cli/usr/redis

CP Redis.conf/usr/redis

Cd/usr/redis

???? 3 , start Redis service.

$ redis-server redis.conf

????? 4, then use the client to test whether to start successfully.

$ redis-cli

redis> set foo bar

Ok

redis> get foo

"Bar"

?

?

?

?

If the installation process occurs (refer to :http://blog.csdn.net/luyee2010/article/details/ 18766911)

wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz

sudo tar xzvf tcl8.6.1-src.tar.gz-c/usr/local/

cd/usr/local/tcl8.6.1/unix/

sudo./configure

sudo make

sudo make install

?

?

?

[HTML]? View Plain Copy

  1. Vi?/etc/redis.conf??
  2. # Find Daemonize?no instead ??
  3. # run in daemon mode ??
  4. Daemonize?yes??
  5. # Modify dir?. / for absolute path ,??
  6. # Default Words Redis-server generated or read in the current directory at startup Dump.rdb??
  7. # so if you execute it under the root directory redis-server?/etc/redis.conf words ,??
  8. # is read from the root directory. Dump.rdb, to make Redis-server can be executed in any directory ??
  9. # so here will dir change to Absolute path ??
  10. Dir?/usr/local/redis??
  11. # Modify appendonly to be yes??
  12. # Specifies whether to log records after each update operation, ??
  13. #Redis asynchronously writes data to disk by default. ??
  14. # if it is not turned on, it may result in loss of data over a period of time when power is lost. ??
  15. # because ? Redis the sync data file itself is pressed above Save conditions to synchronize, ??
  16. # so some data will only exist in memory for a period of time. Default is no??
  17. Appendonly?yes??
  18. # will be Redis add to self-launch ??
  19. Echo? " /usr/local/bin/redis-server?/etc/redis.conf "? >>/etc/rc.d/rc.local??
  20. # Start Redis??
  21. Redis-server?/etc/redis.conf??
  22. # View Redis is it started ? ??
  23. Ps?-ef?|? Grep?redis??

2> "Open Redis Port "

[HTML]? View Plain Copy

  1. # shutting down the firewall ??
  2. Service?iptables?stop??
  3. Vi?/etc/sysconfig/iptables??
  4. # Add ??
  5. -A? Input?-m?state?--state? New?-m?tcp?-p?tcp?--dport?6379?-j? ACCEPT??
  6. # Restarting the firewall ??
  7. Service?iptables?restart??

3> the installation Phpredis extension "

[HTML]? View Plain Copy

  1. Tar?-zxvf?owlient-phpredis-2.1.1-1-g90ecd17.tar.gz??
  2. Cd?owlient-phpredis-90ecd17??
  3. /usr/local/php/bin/phpize??
  4. ./configure? --with-php-config=/usr/local/php/bin/php-config??
  5. Make??
  6. Make?install??
  7. # after executing Make?install is generated after the ??
  8. #Installing? Shared?extensions:????? /usr/local/php//lib/php/extensions/no-debug-non-zts-20060613/??
  9. # Modify php.ini??
  10. Vi?/usr/local/php/etc/php.ini??
  11. # Find Extension_dir, modified to ??
  12. Extension_dir? =?" /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/"??
  13. # Add Redis??
  14. Extension? =? Redis. So??
  15. # Restart Apache??
  16. Service?httpd?restart??

Redis installation and use under Linux

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.