In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Detailed explanation of the installation steps of Linux Redis
Foreword:
Redis is an open source (BSD licensed), in-memory data structure storage system that can be used as database, cache, and messaging middleware. It supports many types of data structures, such as string (strings), hash (hashes), list (lists), set (sets), ordered set (sorted sets) and range query, bitmaps, hyperloglogs and geospatial (geospatial) index radius query.
Redis is completely open source and free, and is a high-performance key-value database. Redis and other key-value cache products have the following features:
Redis supports data persistence. You can save the data in memory on disk and load it again when you restart it. Redis not only supports simple key-value type data, but also provides storage of data structures such as list,set,zset,hash. Redis supports data backup, that is, data backup in master-slave mode. Extremely high performance-Redis can read at a speed of 110000 times per second and write at a speed of 81000 times per second.
Let's take a look at how to install Redis.
1. Download Redis
Download redis and extract it.
$wget http://download.redis.io/releases/redis-3.2.4.tar.gz$ tar xzf redis-3.2.4.tar.gz
2. Make compilation
$cd redis-3.2.4$ make
The following error may occur
/ bin/sh: cc: command not foundmake [1]: * * [adlist.o] Error 127make [1]: Leaving directory `/ data/program/redis-3.2.8/src'make: * [all] Error 2
The gcc compilation tool is not installed, use the following command to install gcc.
$yum-y install make gcc gcc-c++ ncurses-devel
3 、 make install
After the compilation is successful, go to the src folder and execute make install to install Redis
$cd src$ make install
Using make install, you can have the following command in the / usr/local/bin directory:
Redis-serverredis-cliredis-check-aofredis-check-dump
Just set the redis command to the system command, instead of starting these services in the {redis_home} / src directory. You can use the following command to check whether the installation is successful.
Redis-server-v
4. Install redis
Create / data/program/redis-test for later installation of redis, and copy the conf file of redis to the redis-test file.
$mkdir / data/program/redis-test$ cp / data/program/redis-3.2.4/redis.conf / data/program/redis-test/$ cd / data/program/redis-test
Modify the following properties in the configuration file (redis.conf):
# modify bind IPbind 192.168.74.12 modify port number port 100 modify daemon start redisdaemonize yes# modify pid file path pidfile / data/program/redis-test/redis_1000.pid# modify log level loglevel debug# modify log file path logfile / data/program/redis-test/redis_1000.log
5. Start Redis
Specifies that the configuration file starts redis and detects whether the startup is successful.
$redis-server redis.conf$ ps-ef | grep redis
The following picture appears:
Root 54472 10 10:01? 00:00:00 redis-server 192.168.74.128:1000root 54486 14994 0 10:03 pts/1 00:00:00 grep-color=auto redis
6. Operate Redis
Use the redis-cli command to enter redis and operate.
Redis-cli-h 192.168.74.128-p 1000192.168.74.128 set foo barok192.168.74.128:1000 > get foo "bar"
If you have any questions, please leave a message or go to the community to exchange and discuss, thank you for reading, hope to help you, thank you for your support!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.