Redis (i) First acquaintance

Source: Internet
Author: User
Tags mkdir redis

Website
http://redis.io/
Chinese community
http://redis.cn/

Introduced
Redis is completely open source free, compliant with the BSD protocol, advanced Key-value durable products. It is often referred to as a data structure server because values (value) can be types such as strings, hashes (maps), lists (list), collections (sets), and ordered sets (sorted sets).
A NoSQL server that can be persisted, typically compared to memcached.

CentOS Installation
Yum Install make GCC
Make MALLOC=LIBC prefix=/root/usr/redis/redis-2.6.16 Install
After the installation is successful, there is only one bin directory and several binary files

Switch to the installation directory
cd/root/usr/redis/redis-2.6.16
Create a directory Etc,tmp,run
Mkdir-p/root/usr/redis/redis-2.6.16/etc
Mkdir-p/root/usr/redis/redis-2.6.16/tmp
Mkdir-p/root/usr/redis/redis-2.6.16/run

and copy the configuration file src/redis.conf to etc
Copy startup script to run

Configuration
Modify run mode (17 lines)
Daemonize Yes

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/Servers/zs/

Modify the location of the configuration file Pidfile (21 lines)
Pidfile/root/usr/redis/redis-2.6.16/tmp/redis.pid

Add password (258 lines)
Requirepass root_123

Modify Data Persistence location (153 rows)
Dir/data0/search/redis/data

Modify log file location (69 rows)
Logfile/data0/search/redis/log/redis.log

Modify database Persistence frequency) (108-110 rows)

Kernel modifications
Modify configuration file
/etc/sysctl.conf
Add to
Vm.overcommit_memory=1
Refreshing the configuration to take effect
Sysctl Vm.overcommit_memory=1
Supplementary Introduction:
* * If the memory situation is more stressful, you need to set kernel parameters:
Echo 1 >/proc/sys/vm/overcommit_memory
The kernel parameters are described below:
The Overcommit_memory file specifies the kernel's policy for memory allocation, which can be 0, 1, and 2.
0 indicates that the kernel will check if there is enough available memory to use the process, and if there is enough memory available, the memory request is allowed, otherwise the memory request fails and the error is returned to the application process.
1 indicates that the kernel allows all physical memory to be allocated regardless of the current state of memory.
2, which indicates that the kernel allows to allocate more memory than the sum of all physical memory and swap space

Start, stop, log on
1 start
./redis-server./redis.conf &
2 stop
./REDIS-CLI shutdown
3 Set Password stop
./redis-cli-a Password
Run shutdown
4 Login
./redis-cli-a password-H ip-p Port

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.