ubuntu 安装redis以及phpredis
一、安装redis
1. 去百度搜索 redis,然后去靠谱的地方下载最新的redisxxx.tar.gz
2. 解压后,sudo make
3. sudo make install
4. //安装完之后,需要启动redis-server,然后在启动redis-cli。默认端口为6379
5. 启动redis-server只需要一个参数那就是 redis.conf,通常redis.conf文件会在你刚才解压的redisxxx文件内。cp到/etc/redis.conf
6. redis-server /etc/redis.conf。此时查看下进程ps -ef | grep redis-server,如果正常启动的花,会有下面一行
root 19473 7671 0 21:47 pts/6 00:00:00 redis-server *:6379
7.此时redis-cli 命令就可以直接进入操作界面了。
[root@SNDA-192-168-1-114 ~]# redis-cli
Could not connect to Redis at 127.0.0.1:6379: Connection refused
not connected> exit
[root@SNDA-192-168-1-114 ~]# redis-server /etc/redis.conf
[root@SNDA-192-168-1-114 ~]# redis-cli
redis 127.0.0.1:6379> quit
8.至于ubuntu下面安装phpredis扩展的话:sudo apt-get install php5-redis 就可以了.
二、注意事项以及参数配置
注意:默认复制过去的redis.conf文件的daemonize参数为no,所以redis不会在后台运行,这时要测试,我们需要重新开一个终端。修改为yes则为后台运行redis。另外配置文件中规定了pid文件,log文件和数据文件的地址,如果有需要先修改,默认log信息定向到stdout.
下面是redis.conf的主要配置参数的意义:
- daemonize:是否以后台daemon方式运行
- pidfile:pid文件位置
- port:监听的端口号
- timeout:请求超时时间
- loglevel:log信息级别
- logfile:log文件位置
- databases:开启数据库的数量
- save * *:保存快照的频率,第一个*表示多长时间,第三个*表示执行多少次写操作。在一定时间内执行一定数量的写操作时,自动保存快照。可设置多个条件。
- rdbcompression:是否使用压缩
- dbfilename:数据快照文件名(只是文件名,不包括目录)
- dir:数据快照的保存目录(这个是目录)
- appendonly:是否开启appendonlylog,开启的话每次写操作会记一条log,这会提高数据抗风险能力,但影响效率。
- appendfsync:appendonlylog如何同步到磁盘(三个选项,分别是每次写都强制调用fsync、每秒启用一次fsync、不调用fsync等待系统自己同步)
ubuntu 安装redis以及phpredis的更多相关文章
- Ubuntu 安装 Redis和phpredis扩展
服务器Ubuntu16.04 环境php7.0+Apache /****************************开始安装Redis****************************/ 1 ...
- centos安装redis及php-redis扩展
centos安装redis及php-redis扩展 Linux, WEB 七162012 今天公司同事要求在测试机上安装redis,并且要求让php安装上redis的扩展,redis是一个key-v ...
- Redis --> Ubuntu安装redis
Ubuntu安装redis 一.下载安装 root@21ebdf03a086:/# apt-cache search redis root@21ebdf03a086:/# apt-get inst ...
- 在windows环境下安装redis和phpredis的扩展
在windows环境下安装redis和phpredis的扩展 1.首先配置php: 需要在windows的集成环境中找到php的扩展文件夹,ext,然后在网上寻找自己的php对应的.dll文件 比如说 ...
- Ubuntu安装redis并配置远程、密码以及开启php扩展
一.前言 redis是当前流行的nosql数据库,很多网站都用它来做缓存,今天我们来安装并配置下redis 二.安装并配置redis 1.安装redis sudo apt-get install re ...
- Ubuntu 安装 Redis
1. 下载并安装 redis 2.6.16版 sudo mkdir /usr/local/src/Redis cd /usr/local/src/Redis sudo wget http://down ...
- centos6.2下安装redis和phpredis扩展,亲测好用
安装redis: 下载:http://www.redis.io/download redis-2.6.2.tar.gz ]# tar -zxf redis-2.6.2.tar.gz ]# cd red ...
- linux下安装redis和phpredis扩展
一.安装redis 1.下载redis-3.2.3.tar.gz wget http://download.redis.io/releases/redis-3.2.3.tar.gz 2.解压redis ...
- WDCP面板Web环境安装redis与phpredis扩展应用方法
http://www.ctyun.cn/bbs/thread-2882-1-1.html根据网友的要求需要在WDCP面板环境中安装人人商城程序,但是这个程序需要支持redis与phpredis扩展.根 ...
随机推荐
- jquery 选中设置的值
select设置值为xxx选中:如下所示 $("#questionClass").val("xxx");
- 【Codeforces 584C】Marina and Vasya
[链接] 我是链接,点我呀:) [题意] 题意 [题解] 设cnt表示s1和s2不同的字符的个数 如果cnt>2t 因为这cnt个位置肯定至少有一边不同 显然肯定会有一个f(s,S)的值大于t的 ...
- js cookies all in one
js cookies all in one cookies // http://10.1.5.202/auto-deploy-platform/publish/index.html // 非当前 UR ...
- HDU 1234 简单模拟题
题目很简单不多说了,我只是觉得这题目的输入方式还是很有特点的 #include <cstdio> #include <cstring> #include <algorit ...
- Minimal string 栈 贪心
time limit per test 1 second memory limit per test 256 megabytes input standard input output standar ...
- JavaScript 读取CSV文件并转为js对象
html部分 <!-- 创建隐藏file input --><button type="button" name="seach" onclic ...
- -- > define的用法与学习(1)
在不久之前,我一直不理解为神马大家在做题时经常用define来代替某些函数,或者用来直接定义某些极大的变量.It is not until today that I understand why it ...
- internalsviewer
https://intview2.codeplex.com/ https://internalsviewer.codeplex.com/releases/view/21139
- iOS截取视频某一帧图片(关键帧,AVAssetImageGenerator)
获取第一帧图片 导入 AVFoundation.Framework.CoreMedia.Framework 实现代码例如以下: + (UIImage*) thumbnailImageForVideo: ...
- Linux下使用Vi是方向键变乱码 退格键不能使用的解决方法
在Linux下编辑一些文件.这就涉及到了vi这个编辑器了.在Linux下,初始使用vi的时候有点问题.就是在编辑模式下使用方向键的时候,并不会使光标移动,而是在命令行中出现[A [B [C [D之类的 ...