Redis开源代码读书笔记零(Ubuntu14.04 64位安装)
来源:互联网 发布:搜狗下载软件 编辑:程序博客网 时间:2024/05/03 13:13
Redis代码可以在Linux, OSX, OpenBSD, NetBSD, FreeBSD系统上进行部署,并且支持大小端CPU类型。学习环境采用了一台Ubuntu14.04 64位的系统,所有代码的学习是基于redis-3.0.7。
请从Redis官网http://redis.io,下载redis-3.0.7.tar.gz源代码
安装完成后,可以使用redis_6379脚本进行启动redis服务。当然如果需要每次随机启动redis,可以将以下脚本增加到rc.local等脚本中。
/etc/init.d/redis_6379
服务启动后,可以采用redis-cli进行连接
==》更多的编译输出,make时添加V宏,比如"make V=1"
==》自定义配置启动,比如"redis-server /path/to/redis.conf"
==》主从配置,比如"redis-server --port 9999 --slaveof 127.0.0.1 6379"
==》运行日志记录级别定义,比如"redis-server /etc/redis/6379.conf --loglevel debug"
请从Redis官网http://redis.io,下载redis-3.0.7.tar.gz源代码
Redis代码编译
32位,64bit的系统需要安装32位系统的一些支持库
# apt-get install libc6-dev-i386 g++-multilib# make distclean# make 32bit
64位,64bit的系统,所以一把过。
# tar -zxvf redis-3.0.7.tar.gz# cd redis-3.0.7# make# make test
Redis安装
这里我们学习和测试使用的是64位结果。直接进行安装,这里都采用默认配置。# make installcd utils./install_server.shWelcome to the redis service installerThis script will help you easily set up a running redis serverYou must run this script as root. Sorry!daniel@ubuntu:~/redis-3.0.7/utils$ sudo ./install_server.shWelcome to the redis service installerThis script will help you easily set up a running redis serverPlease select the redis port for this instance: [6379]Selecting default: 6379Please select the redis config file name [/etc/redis/6379.conf]Selected default - /etc/redis/6379.confPlease select the redis log file name [/var/log/redis_6379.log]Selected default - /var/log/redis_6379.logPlease select the data directory for this instance [/var/lib/redis/6379]Selected default - /var/lib/redis/6379Please select the redis executable path [/usr/local/bin/redis-server]Selected config:Port : 6379Config file : /etc/redis/6379.confLog file : /var/log/redis_6379.logData dir : /var/lib/redis/6379Executable : /usr/local/bin/redis-serverCli Executable : /usr/local/bin/redis-cliIs this ok? Then press ENTER to go on or Ctrl-C to abort.Copied /tmp/6379.conf => /etc/init.d/redis_6379Installing service... Adding system startup for /etc/init.d/redis_6379 ... /etc/rc0.d/K20redis_6379 -> ../init.d/redis_6379 /etc/rc1.d/K20redis_6379 -> ../init.d/redis_6379 /etc/rc6.d/K20redis_6379 -> ../init.d/redis_6379 /etc/rc2.d/S20redis_6379 -> ../init.d/redis_6379 /etc/rc3.d/S20redis_6379 -> ../init.d/redis_6379 /etc/rc4.d/S20redis_6379 -> ../init.d/redis_6379 /etc/rc5.d/S20redis_6379 -> ../init.d/redis_6379Success!Starting Redis server...Installation successful!
安装完成后,可以使用redis_6379脚本进行启动redis服务。当然如果需要每次随机启动redis,可以将以下脚本增加到rc.local等脚本中。
/etc/init.d/redis_6379
命令行客户端
服务启动后,可以采用redis-cli进行连接
% cd src% redis-cliredis> pingPONGredis> set foo barOKredis> get foo"bar"redis> incr mycounter(integer) 1redis> incr mycounter(integer) 2redis>
其他注意事项
==》glibc, jemalloc, tcmalloc编译配置, make时添加MALLOC宏,默认是glibc,比如"make MALLOC=libc"==》更多的编译输出,make时添加V宏,比如"make V=1"
==》自定义配置启动,比如"redis-server /path/to/redis.conf"
==》主从配置,比如"redis-server --port 9999 --slaveof 127.0.0.1 6379"
==》运行日志记录级别定义,比如"redis-server /etc/redis/6379.conf --loglevel debug"
0 0
- Redis开源代码读书笔记零(Ubuntu14.04 64位安装)
- Redis开源代码读书笔记一(介绍)
- ubuntu14.04 安装redis
- ubuntu14.04 安装 Redis
- ubuntu14.04,安装Git(源代码管理工具)
- ubuntu14.04,安装docker(源代码管理工具)
- Redis开源代码读书笔记二(源代码及工程结构)
- Ubuntu14.04(64位) 安装ia32-libs
- TensorFlow安装,基于 VirtualEnv (Ubuntu14.04 64位 cpu)
- 64位Ubuntu14.04安装WineQQ记录
- Ubuntu14.04 64位安装wineqq过程
- 64位ubuntu14.04安装winqq
- ubuntu14.04 64位 安装JDK1.7
- ubuntu14.04 64位 安装eclipse
- ubuntu14.04 64位 安装eclipse出错
- ubuntu14.04 64位 安装Tomcat
- 64位ubuntu14.04安装FFmepg
- 64位Ubuntu14.04 RTX安装
- Ubuntu 14.04下MySQL服务器和客户端的安装
- mysql UNION ALL查询分页
- Python format
- [LeetCode]81. Search in Rotated Sorted Array II
- ArcEngine开发控件授权、代码授权license方式介绍
- Redis开源代码读书笔记零(Ubuntu14.04 64位安装)
- 在Windows7上搭建Cocos2d-x 3.2alpha0开发环境
- 对路径"E:\System Volume Information"的访问被拒绝.
- SpringMVC拦截器(资源和权限管理)
- ADB检查APP已安装列,是否已安装,获取已安装APP的版本号,
- 利用快速排序思想找出数组中第K大的数
- nettop加指令
- Unity3D PoolManager缓冲池插件
- 66. Plus One