Windows and Linux system installation and use of redis

Windows and Linux system installation and use of redis

linux

修改端口号(redis.conf文件中)
搜索port,修改对应端口号

修改密码(redis.conf文件中)
搜索requirepass,放开注释,设置密码

查询服务进程号
ps -ef|grep redis

关闭服务
kill -9 查询进程号

启动服务(进入redis的bin目录)
./redis-server /usr/local/mydata/soft/redis/bin/redis.conf &

验证端口是否正常
netstat -ntulp |grep 6389

安装redis时 ,出现Requires: libjemalloc.so.1()(64bit)
yum -y install epel-release
yum -y install jemalloc

Install redis reference link

https://blog.csdn.net/qq_47831505/article/details/123883715

希望将redis安装到此目录 /usr/local/redis
希望将安装包下载到此目录 /usr/local/src

1.创建安装目录/usr/local/redis
mkdir /usr/local/redis 

2.进入安装包目录
cd /usr/local/src

3.进行下载安装包
wget http://download.redis.io/releases/redis

4.进行解压
tar -xzvf redis-3.0.7.tar.gz

5.进入redis-3.0.7此目录
cd redis-3.0.7 

6.安装到指定目录中
make PREFIX=/usr/local/redis install 

7.配置文件,拷贝redis.conf到安装目录下
cp redis.conf /usr/local/redis/bin/

8.启动 :进入安装目录/usr/local/redis/bin,运行启动命令
cd /usr/local/redis/bin
./redis-server /usr/local/redis/bin/redis.conf

若远程连接错误,则:
首先进入服务器上的redis下的conf目录下的redis.conf文件;
第一步,以vim方式编辑redis.conf文件设置protected-mode的值为no;
第二步,找到bind 127.0.0.1项,前面加上#注释掉,如果bind前面没有加#,则不需要再管了
如果上面步骤做完之后还是不行的话,可以试试关掉自己虚拟机或者服务器上的防火墙

some general commands

redis-server /usr/local/redis-4.0.11/redis.conf & 
ps -ef|grep redis
cd /usr/local/redis
cd src
./redis-cli
AUTH redis
set ttt 'www'

window

Modify the port number and password with linux

启动命令
redis-server.exe  redis.windows.conf

启动脚本:
start /d "D:\Redis" redis-server.exe  redis.windows.conf

extended notes

redis

download:

http://redis.io/download

https://github.com/mythz/redis-windows

Installation and use: http://www.linuxidc.com/Linux/2014-05/101979.htm

Official website: https://redis.io/

Website structure map: http://www.redis.cn/map.html

api:http://www.redis.cn/documentation.html

Redis is an open source (BSD licensed), in-memory data structure storage system that can be used as a database, cache, and messaging middleware. It supports many types of data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs and geospatial ( geospatial) Index radius query. Redis has built-in replication, LUA scripting (Lua scripting), LRU-driven events (LRU eviction), transactions (transactions) and different levels of disk persistence (persistence), and through Redis Sentinel (Sentinel) and automatic partition (Cluster ) to provide high availability (high availability).

Five data types: string, hash, list, set and zset (sorted set)

Two file formats: full data and incremental request

Collection of questions:

1、ERR Client sent AU TH, but no password is set

Reason: The default password of the redis client is empty, but now you have changed the password of redis.

Method: redis change password http://www.cnblogs.com/langtianya/p/5189234.html

2、noauth authentication required

The meaning of the error is that you do not have authentication, indicating that no password is used to connect.

Method: When the redis-cli operation statement prompts an exception, check the password value of requirepass in the redis.config file, and then enter auth xxx on the cli client and press Enter, and the login is successful if it prompts OK.

Reference: https://blog.csdn.net/leisure_life/article/details/78460733

redis-server.exe redis.windows.conf

parameter:

http://www.imooc.com/article/3645

http://www.redis.cn/commands/info.html

Startup script:

start /d "D:\Redis" redis-server.exe redis.windows.conf

Learning materials:

https://mp.weixin.qq.com/s/CMYHiW3hgDCBYH5P1XcmaQ

Install Redis under Linux using RPM

https://blog.csdn.net/u010280562/article/details/117267371

Redis and MySQL data consistency problem

https://mp.weixin.qq.com/s/sH24S8UeaEHUc-OOc6xupw

Guess you like

Origin blog.csdn.net/huawangxin/article/details/128639263