Redis stand-alone deployment

Source: Internet
Author: User
Tags redis server

    1. Redis Features

      1.1 Memory-enabled cache, equivalent to memcached

      1.2 Rich data types

      1.3 Support for Cluster distributed

      1.4 Persistence, equivalent to Memcachedb

      1.5 Redis supports read and write frequencies of 10W per second

    2. Features of Memcache

      2.1 Deployment of simple support for high concurrency

      2.2 Memory cache only, restart service, cache loss

3. Redis Persistence

3.1.RDB

A snapshot of a dataset is generated within a specified time

Every once in a while, Redis will make the data in memory convenient, generate a Dump.rdb file, stored on the hard disk, this is called a snapshot, the Redis parent process will open a child process, the child process will be responsible for the Rdb file saving work, the parent process does not need to consume disk IO. But if the server goes down, because it's a snapshot of time, it will lose some of the data

3.2.AOF

Persistent records the operation of Redis Server command, redis is the default 1s to execute a fsync command, the data is appended to the hard disk, but the disk I/O consumption is particularly large, but the data consistency is more complete.

Installation deployment of 4.redis

4.1 Download the installation package

Yum-y install gcc gcc++ tclcd/rootwget tar xf redis-3.0.6.tar.gz

4.2 Compiling the installation

Mkdir-p/opt/redis-3.0.6cd/root/redis-3.0.6makemake prefix=/opt/redis-3.0.6 installln-s/opt/redis-3.0.6/opt/redis

4.3 Copy configuration file

Mkdir-p/opt/redis/confcp/root/redis-3.2.2/opt/redis/conf/6379.confvim/opt/redis/conf/6379.confdaemonize Yes # Modify the Yes daemon to start pidfile/var/run/redis_6379.pid #这个要和接下来的启动脚本一致

4.4 Modify Startup script default is not

CD/ROOT/REDIS-3.2.2/UTILSCP redis_init_script/etc/init.d/redis6379vi/etc/init.d/redis6379# chkconfig:2345 #加上 Exec=/opt/redis/bin/redis-servercliexec=/opt/redis/bin/redis-clipidfile=/var/run/redis_${redisport}.pidconf= "/ Opt/redis/conf/${redisport}.conf "#注意脚本中定义的变量chmod +x/etc/init.d/redis6379chkconfig--add redis6379

4.5 Adding environment variables

echo "path=/opt/redis/bin/" >>/etc/profilesource/etc/profile


4.6 Starting Redis

/etc/init.d/redis6379 start[[email protected] utils]# ps -ef |grep  Redisroot       5715      1  0  20:32 ?        00:00:00 /opt/redis/bin/redis-server  127.0.0.1:6379root       5743   5654  0  20:43 pts/2    00:00:00 grep --color=auto redis[[email  Protected] utils]# [[email protected] utils]# /etc/init.d/redis6379  stop  STOPPING&NBSP, ..... redis stopped[[email protected] utils]# ps -ef |grep redisroot        5753   5654  0 20:46 pts/2     00:00:00 grep --color=auto redis[[email protected] utils]# [[email  Protected] utIls]# redis-cli127.0.0.1:6379> 




This article is from the "Brick Blog" blog, please be sure to keep this source http://wsxxsl.blog.51cto.com/9085838/1885928

Redis stand-alone deployment

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.