linux下安装redis3.2
这部分来自网络:
http://blog.csdn.net/cuibruce/article/details/53501532
1.下载
[root@mongodb1 redis]# lsredis-3.2.1 redis-3.2.1.tar.gz2.编译安装
[root@mongodb1 redis-3.2.1]# ls00-RELEASENOTES BUGS CONTRIBUTING COPYING deps INSTALL Makefile MANIFESTO README.md redis.conf runtest runtest-cluster runtest-sentinel sentinel.conf src tests utils[root@mongodb1 redis-3.2.1]# makecd src && make allmake[1]: Entering directory `/root/redis/redis-3.2.1/src' CC adlist.o CC quicklist.o CC ae.oIn file included from ae.c:53:ae_epoll.c: In function 'aeApiAddEvent':ae_epoll.c:75: warning: missing initializerae_epoll.c:75: warning: (near initialization for 'ee.data')ae_epoll.c: In function 'aeApiDelEvent':ae_epoll.c:92: warning: missing initializerae_epoll.c:92: warning: (near initialization for 'ee.data') CC anet.oanet.c: In function 'anetSockName':anet.c:640: warning: dereferencing pointer 's' does break strict-aliasing rulesanet.c:638: note: initialized from hereanet.c:644: warning: dereferencing pointer 's' does break strict-aliasing rulesanet.c:642: note: initialized from hereanet.c: In function 'anetPeerToString':anet.c:584: warning: dereferencing pointer 's' does break strict-aliasing rulesanet.c:582: note: initialized from hereanet.c:588: warning: dereferencing pointer 's' does break strict-aliasing rulesanet.c:586: note: initialized from hereanet.c: In function 'anetTcpAccept':anet.c:555: warning: dereferencing pointer 's' does break strict-aliasing rulesanet.c:553: note: initialized from hereanet.c:559: warning: dereferencing pointer 's' does break strict-aliasing rulesanet.c:557: note: initialized from here CC dict.o CC server.o CC sds.o CC zmalloc.o CC lzf_c.o CC lzf_d.o CC pqsort.o CC zipmap.o CC sha1.o CC ziplist.o CC release.o CC networking.o CC util.o CC object.o CC db.o CC replication.o CC rdb.o CC t_string.o CC t_list.o CC t_set.o CC t_zset.o CC t_hash.o CC config.o CC aof.o CC pubsub.o CC multi.o CC debug.o CC sort.o CC intset.o CC syncio.o CC cluster.o CC crc16.o CC endianconv.o CC slowlog.o CC scripting.o CC bio.o CC rio.o CC rand.o CC memtest.o CC crc64.o CC bitops.o CC sentinel.o CC notify.o CC setproctitle.o CC blocked.o CC hyperloglog.o CC latency.o CC sparkline.o CC redis-check-rdb.o CC geo.o LINK redis-server INSTALL redis-sentinel CC redis-cli.o LINK redis-cli CC redis-benchmark.o LINK redis-benchmark INSTALL redis-check-rdb CC redis-check-aof.o LINK redis-check-aof Hint: It's a good idea to run 'make test' ;) make[1]: Leaving directory `/root/redis/redis-3.2.1/src'[root@mongodb1 redis-3.2.1]# mkdir /usr/local/redis
[root@mongodb1 redis-3.2.1]# make PREFIX=/usr/local/redis installcd src && make installmake[1]: Entering directory `/root/redis/redis-3.2.1/src' Hint: It's a good idea to run 'make test' ;) INSTALL install INSTALL install INSTALL install INSTALL install INSTALL installmake[1]: Leaving directory `/root/redis/redis-3.2.1/src'[root@mongodb1 bin]# cat ~/.bash_profile# .bash_profile # Get the aliases and functionsif [ -f ~/.bashrc ]; then . ~/.bashrcfi # User specific environment and startup programs PATH=/usr/local/redis/bin:/usr/local/mongodb/bin:$PATH:$HOME/bin3.创建redis服务
% ./redis-server --port 9999 --slaveof 127.0.0.1 6379 % ./redis-server /etc/redis/6379.conf --loglevel debug[root@mongodb1 utils]# ./install_server.sh Welcome to the redis service installerThis script will help you easily set up a running redis server Please 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] /data/redis/log/redis_6378.logPlease select the data directory for this instance [/var/lib/redis/6379] /data/redis/6379Please select the redis executable path [/usr/local/redis/bin/redis-server]Selected config:Port : 6379Config file : /etc/redis/6379.confLog file : /data/redis/log/redis_6378.logData dir : /data/redis/6379Executable : /usr/local/redis/bin/redis-serverCli Executable : /usr/local/redis/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...Successfully added to chkconfig!Successfully added to runlevels 345!Starting Redis server...Installation successful![root@mongodb1 init.d]# ls -l re*-rwxr-xr-x 1 root root 1714 Jul 1 11:13 redis_6379-rwxr-xr-x. 1 root root 1822 Jan 16 2013 restorecond[root@mongodb1 init.d]# service redis_6379 statusRedis is running (19280)[root@mongodb1 init.d]# service redis_6379 stopStopping ...Redis stopped[root@mongodb1 init.d]# service redis_6379 startStarting Redis server...[root@mongodb1 init.d]# redis-cli127.0.0.1:6379>4.redis服务解析
#!/bin/sh#Configurations injected by install_server below.... EXEC=/usr/local/redis/bin/redis-serverCLIEXEC=/usr/local/redis/bin/redis-cliPIDFILE=/var/run/redis_6379.pidCONF="/etc/redis/6379.conf"REDISPORT="6379"################ SysV Init Information# chkconfig: - 58 74# description: redis_6379 is the redis daemon.### BEGIN INIT INFO# Provides: redis_6379# Required-Start: $network $local_fs $remote_fs# Required-Stop: $network $local_fs $remote_fs# Default-Start: 2 3 4 5# Default-Stop: 0 1 6# Should-Start: $syslog $named# Should-Stop: $syslog $named# Short-Description: start and stop redis_6379# Description: Redis daemon### END INIT INFO case "$1" in start) if [ -f $PIDFILE ] then echo "$PIDFILE exists, process is already running or crashed" else echo "Starting Redis server..." $EXEC $CONF fi ;; stop) if [ ! -f $PIDFILE ] then echo "$PIDFILE does not exist, process is not running" else PID=$(cat $PIDFILE) echo "Stopping ..." $CLIEXEC -p $REDISPORT shutdown while [ -x /proc/${PID} ] do echo "Waiting for Redis to shutdown ..." sleep 1 done echo "Redis stopped" fi ;; status) PID=$(cat $PIDFILE) if [ ! -x /proc/${PID} ] then echo 'Redis is not running' else echo "Redis is running ($PID)" fi ;; restart) $0 stop $0 start ;; *) echo "Please use start, stop, restart or status as first argument" ;;esac/usr/local/redis/bin/redis-server /etc/redis/6379.conf/usr/local/redis/bin/redis-server -p 6379 shutdown[root@mongodb1 utils]# grep -E -v "^#" /etc/redis/6379.conf |sed '/^$/d'bind 127.0.0.1protected-mode yesport 6379tcp-backlog 511timeout 0tcp-keepalive 300daemonize yessupervised nopidfile /var/run/redis_6379.pidloglevel noticelogfile /data/redis/log/redis_6379.logdatabases 16save 900 1save 300 10save 60 10000stop-writes-on-bgsave-error yesrdbcompression yesrdbchecksum yesdbfilename dump.rdbdir /data/redis/6379slave-serve-stale-data yesslave-read-only yesrepl-diskless-sync norepl-diskless-sync-delay 5repl-disable-tcp-nodelay noslave-priority 100appendonly noappendfilename "appendonly.aof"appendfsync everysecno-appendfsync-on-rewrite noauto-aof-rewrite-percentage 100auto-aof-rewrite-min-size 64mbaof-load-truncated yeslua-time-limit 5000slowlog-log-slower-than 10000slowlog-max-len 128latency-monitor-threshold 0notify-keyspace-events ""hash-max-ziplist-entries 512hash-max-ziplist-value 64list-max-ziplist-size -2list-compress-depth 0set-max-intset-entries 512zset-max-ziplist-entries 128zset-max-ziplist-value 64hll-sparse-max-bytes 3000activerehashing yesclient-output-buffer-limit normal 0 0 0client-output-buffer-limit slave 256mb 64mb 60client-output-buffer-limit pubsub 32mb 8mb 60hz 10aof-rewrite-incremental-fsync yesat redis.clients.jedis.Protoc
linux下安装redis3.2的更多相关文章
- Linux下安装Redis3.2.4
安装: 通过wget方式直接在linux上下载Redis $ wget http://download.redis.io/releases/redis-3.2.4.tar.gz , 默认下载到路径是r ...
- 通过xshell在linux上安装redis3.0.0
通过xshell在linux上安装redis3.0.0 0)首先要安装环境:yum install gcc-c++ 1)通过xftp6将redis安装包上传到linux:解压缩:tar -xvfz r ...
- redis-windows和linux下安装
Window 下安装 下载地址:https://github.com/dmajkic/redis/downloads. 下载到的Redis支持32bit和64bit.根据自己实际情况选择,将64bit ...
- python 基础1.1--windows/linux 下安装python
一.windows下安装python 1>windows上python后缀是.msi的,下载下来后,直接双击运行.会在c盘生成python.exe的文件,把python.exe的文件加入到win ...
- Linux下安装python,mysql,redis
linux 安装Python3 1.python下载 请在终端输入如下命令: cd /home wget http://cdn.npm.taobao.org/dist/python/3.6.5/Pyt ...
- Linux下安装 Posgresql 并设置基本参数
在Linux下安装Postgresql有二进制格式安装和源码安装两种安装方式,这里用的是二进制格式安装.各个版本的Linux都内置了Postgresql,所以可直接通过命令行安装便可.本文用的是Cen ...
- Linux下安装Tomcat服务器和部署Web应用
一.上传Tomcat服务器
- Linux下安装使用Solr
Linux下安装使用Solr 1.首先下载Solr.mmseg4j分词包.tomcat并解压,这用google.百度都可以搜索得到下载地址. 2.因为要使用到中文分词,所以要设置编码,进入tomcat ...
- Linux下安装tar.gz类型的jdk,并配置环境变量
近期因要学习一门技术,必须在Linux下运行,故开始学习如何使用Linux. 在安装jdk时出现了困难,环境变量配置不成功,花了一天时间才搞定,特分享出来,供大家参考. Linux下安装jdk,步骤如 ...
随机推荐
- 大数据查询——HBase读写设计与实践--转
背景介绍 本项目主要解决 check 和 opinion2 张历史数据表(历史数据是指当业务发生过程中的完整中间流程和结果数据)的在线查询.原实现基于 Oracle 提供存储查询服务,随着数据量的不断 ...
- os.clock()导致的bug
os.clock () 功能:返回一个程序使用CPU时间的一个近似值 最近做了一个功能,这个功能需要统计时间间隔,例如每隔0.5秒做一次调用. 我用了os.clock()去统计时间,结果在pc机上都没 ...
- python的小数据池和深浅拷贝
小数据池 一种数据缓存机制,也称驻留机制 在同一代码块,相同的值不会开辟新的内存 特殊字符除外 小数据池只针对:在控制台时! 数字 :-5到256间的整数会被缓存 布尔值:都会缓存8 字符串 小于等于 ...
- vc++如何创建程序-函数的重载
重载构成的条件:函数的参数类型,参数个数不同,才能构成函数的重载 函数重载分为两种情况: 1 .(1)void output(); (2)int output(); 2 .(1)void output ...
- hive优化分享
粘贴一下我在部门中的一次hive优化的分享. 简述 hive构建在hadoop基础上,利用分布式存储,通过mr引擎实现对大数据的计算.MR会频繁地读写磁盘而且MR任务的启动成本很高.对于hive优化显 ...
- Jenkins 部署 PHP 应用
安装 Jenkins 方式一:docker方式安装 拉取jenkins官方镜像,按照镜像文档启动镜像就可以了 方式二:手动安装 以下所有操作都使用 root 用户进行操作. 在各项目官网,下载 Jav ...
- 洛谷P1540 机器翻译 水题 模拟
注意一下细节,尤其是更新minv时不要更新错. Code: #include<vector> #include<iostream> #include<cstdio> ...
- bootstrapvalidator使用,重置校验
1.html页面需要注意的是验证字段需要用form-group包裹.需要引用相应的css和js. <form id="jobForm" role="form&quo ...
- Linux crontab 在每月最后一天执行
59 23 * * * if [ `date +%d -d tomorrow` = 01 ]; then; command(/usr/bin/curl -s -o temp.txt http:// ...
- Redis 报错:MISCONF Redis is configured to save RDB snapshots
MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Com ...