Redis Small Note

Source: Internet
Author: User

Redis is a key-value storage system. Similar to memcached, but solves a situation where the data is completely lost after a power outage (because it can also support persistence), Redis is a high-performance Key-value storage System (cache and store) issued under the BSD Open source protocol. It is commonly referred to as a data structure server, because the value can be a string (string), a hash (hashes), a list, a collection (sets), and an ordered collection (sorted sets). These data types support Push/pop, Add/remove, and intersection-set and difference sets, and richer operations, and these operations are atomic.

More study can refer to http://www.cnblogs.com/yanghuahui/p/3696400.html

A little redis problem that I met today, record it. Redis on one server does not have a password, although it is only a test environment, but for security, it is decided to restart a Redis instance with a password in place of the original.

The original Redis is version 2.8.8, replaced by the latest 3.0.5, the package is placed in the same directory after the decompression, and then execute Makeinstall in the 3.0.5 directory.

Since the previous configuration has been configured to boot, you can start the command directly with Redis-server, So I wanted to start a 3.0.5 Redis instance by specifying 3.0.5 's redis.conf file, but at that time, because of the path problem in the Conf file, it had not started successfully, and started a redis process in Redis-server--port 6380 instead. But the display is actually 3.0.5 version, because this does not specify the Conf file startup process is started by default Conf, the default Conf should be 2.8.8 before.

Later on, should be the server Redis is 3.0.5 to cover the reason for it?

After the various paths inside the new conf are configured, the boot succeeds. The main configuration is

1. Redis is not running as a daemon by default and can be modified by this configuration item, enabling the daemon with Yes

daemonize No

2. When Redis is running as a daemon, Redis writes the PID to the/var/run/redis.pid file by default and can be specified by pidfile

pidfile/var/run/redis.pid

3. Specify the Redis listening port, the default port is 6379, the author in his own article blog post explains why 6379 as the default port, because 6379 Merz the corresponding number on the phone keypad, and Merz from Italy showgirl Alessia Merz name

Port 6379

4. The host address of the binding

bind 127.0.0.1

5. If the client closes the connection after a long period of inactivity, if it is specified as 0, the function is turned off

Timeout

6. Specify logging level, Redis supports four levels in total: Debug, verbose, notice, warning, default is verbose

loglevel Verbose

7. Logging mode, default to standard output, if Redis is configured to run as daemon, and this is configured as logging mode as standard output, the log will be sent to/dev/null

logfile stdout

8. Set the number of databases, the default database is 0, you can use the Select <dbid> command to specify the database ID on the connection

Databases

9. Specify the local database file name, the default value is Dump.rdb

dbfilename Dump.rdb

10. Specify the local database to hold the directory

dir./

11. Set up the Redis connection password, if the connection password is configured, the client will need to provide the password via auth <password> command when connecting to Redis, turn off by default

requirepass foobared

For more configuration, please refer to http://www.cnblogs.com/wenanry/archive/2012/02/26/2368398.html

Then, Redis-cli-p 6380 launches the client for Redis use, and more Redis commands can learn the first link.

Redis Small Note

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.