当前位置: 首页 > 工具软件 > Redis Studio > 使用案例 >

install redis

司马飞鸿
2023-12-01
1. Office Download redis.tar.gz  from website --- redis.io

2.uncompact file

$ tar zxvf redis-3.2.9.tar.gz && mv redis-3.2.9  /opt/redis

3.compile redis:

$ cd /opt/redis && make && make install

4.configure redis

$ sudo mkdir /etc/redis

$ sudo cp redis.conf  /etc/redis/redis.conf

5.launch redis,specialize configuration file

$ /opt/redis/src/redis-server /etc/redis/redis.conf

6.lauch redis passing arguments via the command line

$ ./redis-server --port 6380 --slaveof 127.0.0.1 6379

7. use redis-cli

redis-Command Line Interface

(1)

$ ./redis-cli  # Pass authentication Using "auth" directives

127.0.0.1:6379> auth foobared
OK

(2)

$ ./redis-cli -n 1 -a foobared incr mycounter

8. get value

$ ./src/redis-cli -a foobared get k1

 9. enable authentication

(1) uncomment the line including 'requirepass'

$ sudo sed -r '/^#\s?requirepass/ s/^#\s?//g' -i /etc/redis/redis.conf

$ cat /etc/redis/redis.conf | grep -P \s?requirepass

 

 类似资料:

相关阅读

相关文章

相关问答