redis 命令
./redis-server --port 6380 --slaveof 127.0.0.1 6379
redis-server /usr/local/etc/redis.conf
redis-cli ping
redis-cli
linux centos 本地安装redis
1、下载
wget http://download.redis.io/releases/redis-4.0.8.tar.gz
2、解压
tar xzvf redis-4.0.8.tar.gz
3、安装
cd redis-4.0.8
make
make install PREFIX=/usr/local/redis
如果只要 redis-cli 命令,以上就够了。
4、本地启动方式:
本地redis:
/usr/local/redis/bin/redis-cli -h 127.0.0.1 -p 6379
/usr/local/redis/bin/redis-cli -h 127.0.0.1 -p 6379 keys "*"
/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf
二、以docker 启动 redis
mkdir redis6378
单节点启动
docker run -d --name redis6378 \
-p 6378:6379 \
-v /root/data/soft/redis/redis6378:/data \
-m 1G --memory-swap 1G \
redis:6.2.3 \
--maxmemory 100m