俩台服务器搭建redis集群
1、俩服务器分别新建目录:usr/local/redis-cluster
2、下载源码并解压编译(使用redis版本5.0.4)
3、tar xzf redis-5.0.4.tar.gz
4、cd redis-5.0.4
5、make & make install
测试编译:发现报错
6、cd src
make test
CC Makefile.dep
You need tcl 8.5 or newer in order to run the Redis test
make: *** [test] Error 1
问题原因:缺少依赖,进行安装
7、yum install tcl
8、再次测试编译ok
make test
\o/ All tests passed without errors!
Cleanup: may take some time... OK
9、至此,可以启动redis了,默认启动模式为前端启动,指令如下
cd usr/local/bin
./redis-server
10、验证启动是否成功
ps -ef | grep redis
11、报错
a、运行redis-server报错bash: redis-server: command not found
这是因为在系统的usr/local/bin目录下没有命令文件,这就要将usr/local/redis