预备
yum install gcc gcc-c++ automake autoconf libtool
官方安装
$ wget https://download.redis.io/releases/redis-6.2.6.tar.gz
$ tar xzf redis-6.2.6.tar.gz
$ cd redis-6.2.6
$ make
看rejson和seach的moudle.json文件,查看适合版本,最大6.0.8
wget https://download.redis.io/releases/redis-6.0.6.tar.gz
报 Hint: It’s a good idea to run ‘make test’ 😉
运行
make test
报You need tcl 8.5 or newer in order to run the Redis test 错误
下载
wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz
tar -zxvf tcl8.6.1-src.tar.gz
cd tcl8.6.1/
cd unix/
./configure
make
make install
启动
$ src/redis-server
./redis-server redis.conf
$ src/redis-cli
redis> set foo bar
OK
redis> get foo
"bar"
json
yum install gcc gcc-c++ automake autoconf libtool
- 下载
https://redis.com/redis-enterprise-software/download-center/modules/
要登录
https://redismodules.s3.amazonaws.com/rejson/rejson.Linux-rhel7-x86_64.2.0.6.zip
https://s3.amazonaws.com/redismodules/redisearch/redisearch.Linux-rhel7-x86_64.2.2.6.zip
- 说明
https://oss.redis.com/redisjson/ - 安装zip解压
yum install -y unzip zip - 解压文件
unzip rejson.Linux-rhel7-x86_64.2.0.6.zip
得到module.json,rejson.so2个文件
mkdir -p /usr/local/redis/{bin,etc,db,log,modules}
make
make PREFIX=/usr/local/redis install
make clean仅仅是清除之前编译的可执行文件及配置文件。
而make distclean要清除所有生成的文件。
把下载过来的文件里面的conf文件复制到目标地
cp /usr/local/redis-5.0.3/redis.conf /usr/local/redis/bin/
里面添加
loadmodule /usr/local/redis/modules/module-enterprise.so
loadmodule /usr/local/redis/modules/rejson.so
查看已经装的module
module list
JSON.SET foo1 . ‘“bar”’
JSON.get foo1
https://www.xttblog.com/?p=1606
https://segmentfault.com/a/1190000041208585
https://www.jianshu.com/p/f5ae8a79bd68
https://oss.redis.com/redisearch/Quick_Start
FT.CREATE i_index1 ON JSON PREFIX 1 “doc:” SCHEMA $.a TEXT SORTABLE $.b TEXT SORTABLE
JSON.SET doc:001 $ ‘{“a”:2, “b”: 301}’
JSON.SET doc:002 $ ‘{“a”:3, “b”: 302}’
FT.CREATE i_index1 ON JSON LANGUAGE chinese SCHEMA $.title TEXT
FT.CREATE idx:movie ON hash PREFIX 1 “movie:” SCHEMA title TEXT SORTABLE release_year NUMERIC SORTABLE