当前位置:网站首页>un7.29: How to install and configure redis in Linux-centos?
un7.29: How to install and configure redis in Linux-centos?
2022-07-30 03:05:00 【Excellent little love】
1. What is Redis
Before introducing Redis, first understand that NoSQL (Not only SQL) is not only a non-relational database; Redis is a traditional non-relational database such as Mysql, oracle, sql server, etc.are relational databases
Why do you need NoSQL, mainly to deal with the following problems, traditional relational databases are not enough
1, High performance - high concurrent read and write
2, Huge Storage - efficient storage and access of massive data
3, High Scalablility && High Availability High scalability and high availability
4,NoSQL products, MongoDB, Redis, etc. Redis is currently mainstream
1.1, Features of NoSQL
Easy expansion
Flexible data model
Large data volume, high performance
High availability
High performance key-value database, supported key-value data types
String Type
List Type
Ordered Collection Type
Hash Type
Collection Type
1.2, Redis Application Scenarios
Cache
Task Queue
Website access statistics
Data expiration processing
Application rankings
Session separation in distributed cluster architecture
Second, Redis installation
Redis only supports Linux from the beginning, although there are teams behindCome up with a Window version, but I still recommend everyone to install it in Linux.
1. Install gcc
gcc compiles c, because redis is written in c, so let's install gcc first
yum install gcc-c++
2. Download the redis archive and extract it
wget method Download the redis archive, extract it, and compile it
Download:
wget http://download.redis.io/releases/redis-3.2.9.tar.gz
Unzip:
tar -zxvf redis-3.2.9.tar.gz
In this way, there is a wrongly decompressed redis directory in the /usr/local/ directory
3. Compile
Compilation is complete, go back to the /usr/local/ directory and find that the redis directory already exists
3. Start Redis
1. Copy the redis.conf file in the decompressed package to the compiled folder redis
2. Modify the redis.conf file and change the daemonize value to yes
3.Start redis
Check whether redis has been started by command
The redis process exists, indicating that it has been successfully started
3.4, close redis
Query the redis process has been closed by command
Fourth, the basic use of Redis
4.1, start Redis through the command line
4.2, execute the redis client
4.3, operate
4.3.1, store the name-value pair name:helloworld
Set by set method, get by get
4.3.2. Get the record value named name
4.4. Get all records
4.5. Delete records by key
5. Download resources
redis-3.2.9.tar
Six, open port number 6379
Reference: https://blog.csdn.net/qzc70919700/article/details/78940222
Seven, modify the bound host
This machine is bound here, we remark this; # bind 127.0.0.1
Close the redis service and restart redis
8. Modify the Redis access password
Modify the /usr/local/redis/redis.conf configuration file, remove the # in front of #requirepass foobared, and replace the password with your own password, for example: Aa123123.
#requirepass Aa123123.
After setting the password, if you want to enter the redis client next time, you need to enter the password, for example: ./bin/redis-cli -a Aa123123.
Nine, modify the protected mode
Need to modify the configuration file redis.conf.Change protected-mode yes under NETWORK to protected-mode no
Then restart the service
边栏推荐
猜你喜欢
随机推荐
Ansible简介(详细)特性+优点+设计理念+应用领域+系统架构+工作原理+任务执行流程
分类之决策树分类
Kotlin接口
复星医药募资44.84亿:高毅资产认购20亿 成第三大股东
再度入围|“国产化”大潮来袭,汉得助力乘风破浪!
【C语言刷LeetCode】592. 分数加减运算(M)
Leetcode.234 判断回文链表(双指针/快慢指针)
The relationship between the number of Oracle processes and the number of sessions
判断Object是否依赖于名叫“XX“的资产
C# 一周入门之《C#-类和对象》Day Six
详解轮播图二-通过left定位来轮播图片
每日优鲜生死劫:被曝清退大部分员工 仍未递交年报(附音频)
nSoftware.PowerShell.Server.2020
Excuse me, when datax is synchronized to the oceanbase database, it is written according to the primary key update method. How to fill in the content in the drop-down box?
B. Different Divisors- Codeforces Round #696 (Div. 2)
Detailed explanation of carousel picture 2 - carousel pictures through left positioning
redis的学习_基础部分
A transaction is in Mysql?What's the use?
一文读懂Elephant Swap,为何为ePLATO带来如此高的溢价?
【高性能计算】openMP