`

redis 设置

 
阅读更多
Download, extract and compile Redis with:

$ wget http://download.redis.io/releases/redis-4.0.6.tar.gz
$ tar xzf redis-4.0.6.tar.gz
$ cd redis-4.0.6
$ make

The binaries that are now compiled are available in the src directory. Run Redis with:

$ src/redis-server


vi redis.conf 设置

bind 0.0.0.0
protected-mode no
requirepass tiger
daemonize yes




启动
src/redis-server ./redis.conf&
停止
src/redis-cli
(如设置requirepass tiger 则 auth tiger)
shutdown

--------------------------------
安装ruby环境
gpg2 --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3
curl -L get.rvm.io | bash -s stable
find / -name rvm -print
source /usr/local/rvm/scripts/rvm
rvm list known
rvm install 2.3.4
rvm use 2.3.4
rvm use 2.3.3 --default
gem install redis

./redis-trib.rb create --replicas 1 127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005

----------------------------------
测试
$ redis-cli -c -p 7000
redis 127.0.0.1:7000> set foo bar
-> Redirected to slot [12182] located at 127.0.0.1:7002
OK
redis 127.0.0.1:7002> set hello world
-> Redirected to slot [866] located at 127.0.0.1:7000
OK
redis 127.0.0.1:7000> get foo
-> Redirected to slot [12182] located at 127.0.0.1:7002
"bar"
redis 127.0.0.1:7000> get hello
-> Redirected to slot [866] located at 127.0.0.1:7000
"world"

------------------------------------
集群密码问题
masterauth tiger
requirepass tiger

find / -name client.rb
修改passord
:password => "tiger",

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics