Redis第一篇(Redis单机版本安装及启动)
安装:
|
1
2
3
4
5
|
[root@M2_Redis1 ~]# yum install gcc gcc-c++ (安装依赖)[root@M2_Redis1 tools]# wget http://download.redis.io/releases/redis-3.0.7.tar.gz[root@M2_Redis1 tools]# tar -zxf redis-3.0.7.tar.gz[root@M2_Redis1 tools]# cd redis-3.0.7[root@M2_Redis1 redis-3.0.7]# make |
说明:
执行“make”,会在当前目录的src目录下生成启动执行程序,包括: redis-server, redis-sentinel, redis-benchmark等文件
启动:
|
1
|
[root@M2_Redis1 redis-3.0.7]# src/redis-server (默认启动) |
说明:
后台启动参数:daemonize yes
默认启动为“前台启动”,当推出前台界面时,程序会退出
默认启动不使用配置文件
|
1
2
3
4
|
[root@M2_Redis1 redis-3.0.7]# pwd /home/tools/redis-3.0.7[root@M2_Redis1 redis-3.0.7]# ll redis.conf (redis生成配置文件)rw-rw-r-- 1 root root 41560 Jan 25 2016 redis.conf |
redis配置参数:
|
1
2
3
4
5
6
7
8
9
10
|
daemonize yes 是否一后台daemonize方式运行pidfile pid文件的位置,默认为:/run/redis.pidport 监听端口号,默认为6379bind 127.0.0.1 配置监听网卡的IPlogfile log文件位置,默认值为stdout,使用”标准输出”,默认后台模式会输出到/dev/nullloglevel notice 指定日志记录级别,redis一共支持四个级别:debug,verbose,notice,warning,默认为notice # debug 记录很多信息,用于开发和测试 # verbose 很多精简有用的信息,不像debug会记录那么多 # Notice 普通的verbose,常用于生产环境 # warning 只有非常重要或者严重的信息会记录到日志 |
Redis自启动配置:
Copy配置
|
1
2
3
|
[root@M2_Redis1 ~]# cd /etc/[root@M2_Redis1 etc]# mkdir redis[root@M2_Redis1 etc]# cp /home/tools/redis-3.0.7/redis.conf /etc/redis/6379.conf |
Copy启动脚本
|
1
2
3
4
5
6
7
8
9
|
[root@M2_Redis1 ~]# cd /home/tools/redis-3.0.7/utils/[root@M2_Redis1 utils]# cp redis_init_script /etc/init.d/redisd[root@M2_Redis1 utils]# vim /etc/init.d/redisd# chkconfig: 2345 90 10 (添加启动级别)REDISPORT=6379EXEC=/home/tools/redis-3.0.7/src/redis-serverCLIEXEC=/home/tools/redis-3.0.7/src/redis-cliPIDFILE=/var/run/redis_${REDISPORT}.pid (以redis_port命名)CONF="/etc/redis/${REDISPORT}.conf" (以port命名) |
编辑配置文件
|
1
2
3
4
5
|
[root@M2_Redis1 redis-3.0.7]# vim /etc/redis/6379.conflogfile "/data/log/redis_6379.log"port 6379pidfile /var/run/redis_6379.piddaemonize yes |
启动
|
1
2
3
4
5
6
7
8
|
[root@M2_Redis1 utils]# service redisd start Starting Redis server...[root@M2_Redis1 utils]# netstat -ntulpActive Internet connections (only servers)Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN 17491/redis-server tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1189/sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1280/master |
Redis第一篇(Redis单机版本安装及启动)的更多相关文章
- ElasticSearch入门 第一篇:Windows下安装ElasticSearch
这是ElasticSearch 2.4 版本系列的第一篇: ElasticSearch入门 第一篇:Windows下安装ElasticSearch ElasticSearch入门 第二篇:集群配置 E ...
- .net core工具组件系列之Redis—— 第一篇:Windows环境配置Redis(5.x以上版本)以及部署为Windows服务
Cygwin工具编译Redis Redis6.x版本是未编译版本(官方很调皮,所以没办法,咱只好帮他们编译一下了),所以咱们先下载一个Cygwin,用它来对Redis进行编译. Cygwin下载地址: ...
- 15天玩转redis —— 第一篇 开始入手
双十一终于还是过去了,我负责的mongodb由于做了副本集,最终还是挺过去了,同事负责的redis,还是遗憾的在早上8点左右宕机了,然后大家就是马不停 蹄的赶往公司解决问题,因为我对redis也不是很 ...
- redis 第一篇
一.redis简介 redis是一个开源的高性能键值对数据库:本质上是数据结构服务器或者是数据结构数据库 特点: 1.共享内存 如果有自己的线程可以读list,如果外界还有一个程序都上面的list,那 ...
- redis在linux环境下的安装与启动
定义 redis是一个key-value存储系统.和Memcached类似,它支持存储的value类型相对更多,包括string(字符串).list(链表).set(集合).zset(sorted s ...
- Ansible第一篇:介绍及安装
Ansible介绍 Ansible是个什么东西呢?官方的title是"Ansible is Simple IT Automation"--简单的自动化IT工具.ansible基于P ...
- Redis在Linux系统下的安装和启动
详情可参见:https://blog.csdn.net/q1035331653/article/details/79077260 开机自启脚本参见:https://www.cnblogs.com/si ...
- Redis 单机版本安装
亲装! 1.linux 系统镜像 redis 版本 使用redis-3.2.8.tar.gz(截止2017年4月的最新稳定版) 在安装之前先安装下redis 需要的环境 wget http://do ...
- redis第一篇--综述
1 redis里边有数据库的概念.可分为1-255这些表.在存储或者查找的时候要指明. redis_sentinel 集群里边封装成了namespace这样的概念.与db是不一样的.
随机推荐
- sql server2008 字段类型
bit 整型 bit数据类型是整型,其值只能是0.1或空值.这种数据类型用于存储只有两种可能值的数据,如Yes 或No.True 或False .On 或Off. 注意:很省空间的一种数据类型, ...
- Ubuntu 14.04 英文系统 安装中文搜狗输入法
ubuntu默认的输入法是ibus框架,而搜狗输入法是基于fcitx的框架,因此需要先安装fcitx框架. STEP1: 在Ubuntu Software Center 搜索fcitx,安装fcitx ...
- asp.net LINQ实现数据分页
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...
- 历史命令:history
[root@linux ~]# history [n][root@linux ~]# history [-c][root@linux ~]# history [-raw] histfiles参数:n ...
- java_js从字符串中截取数字
var str="1件*20桶*30包*123.45公斤"; var res=str.match(/\d+(\.\d+)?/g); alert(res);
- 阅读笔记Multi-task Learning for Stock Selection [NIPS1996]
Multi-task Learning for Stock Selection Joumana Ghosn and Yoshua Bengio 摘要 用人工神经网络预测未来回报以便于做出对应的金融决 ...
- C++ STL 助记1:vector
vector<, ); // Creates vector of 10 ints with value 100 vector<, "hello"); vector< ...
- 十分钟使用github pages +hexo拥有个人博客
最近想自己搭建自己的个人博客,毕竟这样觉得比较geek,但是搜了资料,感觉良莠不齐,好多东西说的含糊不清,于是自己记录下自己的搭建过程. 1, 安装nodejs 2, 安装git 3, 申请githu ...
- With语句以及@contextmanager的语法解析
with 语句以及@contextmanager的语法解析 with语句可以通过很简单的方式来替try/finally语句. with语句中EXPR部分必须是一个包含__enter__()和__e ...
- 20151210study
-----------------------------------------------------The election officials were not neutral.选举官员并不是 ...