Mac OS Xwget http://download.redis.io/redis-stable.tar.gztar xzf redis-stable.tar.gzcd redis-stablemakeRedis没有其他外部依赖,安装过程很简单。编译后在 Redis 源代码目录的src文件夹中可以找到若干个可执行程序,最好在编译后直接执行 make install 命令来将这些可执行程序复制到/usr/local/bin 目录中以便以后执行程序时可以不用输入完整的路径。
redis-server --port 6379redis-server --port 6380redis-server redis.confredis-cli shutdown 强行终止Redis可能导致数据丢失,正确的做法是上面的shutdown,当Redis收到shutdown命令后,会先断开所有客户端连接,然后根据配置执行持久化,最后完成退出。kill pid 效果同 shutdown。
附一:Mac 常用命令ssh root@61.172.255.56 密钥登录scp test.txt root@61.172.240.58:/home 上传scp root@...:/home/s.txt /usr/tmp 下载/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.confcurl http://downloads.mongodb.org/osx/mongodb-osx-x86_64-2.4.6.tgz > mongodb.tgzjps -v
附二:ssh免密登录每次登陆ssh都需要输入用户名和密码,我想作一个双机的互备。考虑密码隔断时间都需要修改,那我的备份程序也需要修改。因此就想使用不需要密码用ssh登陆机器,这样我就可以使用rsync,scp,rexec等命令来做的远程备份了。
方法如下:假设A,B两服务器,现在需要在A机上用root登陆B机,而不需要输入密码,那我们可按照下面的步骤来做:1)在A机上生成钥匙对
A# ssh-keygen -t rsa Generating public/private rsa key pair.Enter file in which to save the key (/root/.ssh/id_rsa):Enter passphrase (empty for no passphrase):Enter same passphrase again:Your identification has been saved in /root/.ssh/id_rsa.Your public key has been saved in /root/.ssh/id_rsa.pub.The key fingerprint is:f6:61:a8:27:35:cf:4c:6d:13:22:70:cf:4c:c8:a0:23 mlsx@mlsx
这样,会生成id_rsa,和id_rsa.pub,其中id_rsa是密钥,id_rsa.pub是公钥。
2)把在A机生成的id_rsa.pub拷贝到B机上。A# scp id_rsa.pub root@B:/tmp
3)用root帐号登陆B机,进入其主目录,创建authorized_keys文件,并设置好权限
B# cd ~/.ssh
4)测试在A机上转到root帐号,尝试登录B机。看看是不是不要密码.
5)authorized_keys文件的权限很重要,如果设置为777,那么登录的时候,还是需要提供密码的
原文链接:[http://wely.iteye.com/blog/2273449]
相关资源:敏捷开发V1.0.pptx