Redis的安装配置

参考

Mac上

安装:
brew install redis

To have launchd start redis now and restart at login: brew services start redis Or, if you don’t want/need a background service you can just run: redis-server /usr/local/etc/redis.conf ==> Summary 🍺 /usr/local/Cellar/redis/5.0.4: 13 files, 3.1MB

启动:brew services start redis
重启:brew services restart redis
关闭:brew services stop redis
连接:redis-cli ping
卸载:
brew uninstall redis
rm ~/Library/LaunchAgents/homebrew.mxcl.redis.plist

配置密码,编辑默认配置文件:/usr/local/etc/redis.conf,去掉requirepass注释并修改密码或添加一行
requirepass xxxxxxxxxxxxxxxxxxx   

Ubuntu 14.04上

更新Apt仓库:sudo apt-get update
安装Redis-Server:sudo apt-get -y install redis-server
查看Redis-Server状态:sudo service redis-server status
查看端口监听情况:sudo netstat -naptu | grep LISTEN
编辑Redis配置文件:sudo vi /etc/redis/redis.conf
在Redis配置文件中添加密码:requirepass xxxxxxxxxxxxxxxxxxx
重启Redis-Server:sudo service redis-server restar
使用redis-cli连接:redis-cli 
验证密码:~> AUTH xxxxxxxxxxxxxxxxxxx

版权所有,转载请注明出处 luowei.github.io.