Linux下Redis安装及配置为服务
2016-10-30 13:08
447 查看
最重要的要点
必备知识:linux常用软件安装过程
演示版本:Redis3.2.3
依赖软件:tcl8.5+
1.解压
2.编译
3.安装
4.其它
5.Redis基本配置
1.首先,需要确认配置文件是哪一个?/etc/redis.conf还是/etc/redis/6379.conf?
由于我们使用的服务,所以/etc/init.d/redis_6379中肯定会包含配置信息:
确认就是/etc/redis/6379.conf
2.修改配置
现在还不知道该改什么配置。
6.测试
最终结果:All testspassed without errors!
7.将Redis配置为服务
给出如下信息(会配置Redis的相关信息):
Welcome to the redis service installer
This script will help you easily set up a running redis server
Please select the redis port for this instance: [6379] #选择Redis端口
Selecting default: 6379
Please select the redis config file name[/etc/redis/6379.conf] #选择redis配置文件
Selected default - /etc/redis/6379.conf
Please select the redis log file name [/var/log/redis_6379.log] #选择redis日志文件位置
Selected default - /var/log/redis_6379.log
Please select the data directory for this instance[/var/lib/redis/6379] #选择redis数据目录
Selected default - /var/lib/redis/6379
Please select the redis executable path [/bin/redis-server] #选择redis可执行目录
Selected config:
Port : 6379
Config file :/etc/redis/6379.conf
Log file :/var/log/redis_6379.log
Data dir :/var/lib/redis/6379
Executable :/bin/redis-server
Cli Executable : /bin/redis-cli
Is this ok? Then press ENTER to go on or Ctrl-C to abort.
Copied /tmp/6379.conf => /etc/init.d/redis_6379
Installing service...
Successfully added to chkconfig!
Successfully added to runlevels 345!
Starting Redis server...
Installation successful!
可能存在的问题
问题1:安装时出现如下提示信息:
install:无法创建普通文件"/usr/local/bin/redis-server":权限不够
原因:
执行该安装命令时权限不足
解决:
使用sudo makeinstall命令执行
问题2:测试时出现如下提示信息:
You need tcl 8.5 or newer in order to run the Redis test
原因:
没有安装tcl或者tcl版本低于8.5
解决:
1.解压
2.配置
3.编译
4.安装
参考
http://blog.csdn.net/daniel_ustc/article/details/18099067
最重要的要点
必备知识:linux常用软件安装过程
演示版本:Redis3.2.3
依赖软件:tcl8.5+
1.解压
tar -zxf redis-3.2.3.tar.gz | #解压压缩包 |
cd redis-3.2.3/ | #切换目录 |
sudo make | #编译 |
sudo make install | #安装,防止权限不够 |
sudo cp src/redis-server src/redis-cli /usr/bin/ | #方便在终端在任何地方直接运行 |
sudo cp redis.conf /etc/ | # |
1.首先,需要确认配置文件是哪一个?/etc/redis.conf还是/etc/redis/6379.conf?
由于我们使用的服务,所以/etc/init.d/redis_6379中肯定会包含配置信息:
确认就是/etc/redis/6379.conf
2.修改配置
现在还不知道该改什么配置。
6.测试
make test | #测试 |
7.将Redis配置为服务
cd utils | #进入redis-3.2.3目录下的utils目录下 |
./install_server.sh | #配置为服务 |
Welcome to the redis service installer
This script will help you easily set up a running redis server
Please select the redis port for this instance: [6379] #选择Redis端口
Selecting default: 6379
Please select the redis config file name[/etc/redis/6379.conf] #选择redis配置文件
Selected default - /etc/redis/6379.conf
Please select the redis log file name [/var/log/redis_6379.log] #选择redis日志文件位置
Selected default - /var/log/redis_6379.log
Please select the data directory for this instance[/var/lib/redis/6379] #选择redis数据目录
Selected default - /var/lib/redis/6379
Please select the redis executable path [/bin/redis-server] #选择redis可执行目录
Selected config:
Port : 6379
Config file :/etc/redis/6379.conf
Log file :/var/log/redis_6379.log
Data dir :/var/lib/redis/6379
Executable :/bin/redis-server
Cli Executable : /bin/redis-cli
Is this ok? Then press ENTER to go on or Ctrl-C to abort.
Copied /tmp/6379.conf => /etc/init.d/redis_6379
Installing service...
Successfully added to chkconfig!
Successfully added to runlevels 345!
Starting Redis server...
Installation successful!
/etc/init.d/redis_6379 start | #启动Redis Server |
/etc/init.d/redis_6379 stop | #停止Redis Server |
redis-cli | #进入Redis Command Line |
service redis_6379 start | #使用服务启动Redis |
service redis_6379 stop | #使用服务停止Redis |
问题1:安装时出现如下提示信息:
install:无法创建普通文件"/usr/local/bin/redis-server":权限不够
原因:
执行该安装命令时权限不足
解决:
使用sudo makeinstall命令执行
问题2:测试时出现如下提示信息:
You need tcl 8.5 or newer in order to run the Redis test
原因:
没有安装tcl或者tcl版本低于8.5
解决:
1.解压
tar -zxf tcl8.6.6-src.tar.gz | #解压 |
cd unix | #切换到unix目录 |
./configure | #配置 |
make | #编译 |
make install | #安装 |
http://blog.csdn.net/daniel_ustc/article/details/18099067
相关文章推荐
- Linux下安装redis并配置服务
- Redis 一:Linux下 安装Redis并配置服务
- Redis 一:Linux下 安装Redis并配置服务
- linux下安装配置redis服务
- Redis 一:Linux下 安装Redis并配置服务
- Linux下 安装Redis并配置服务
- 【Linux系统和服务管理】MySQL服务器安装与配置(二)
- 转载备忘:【实验】【VNC】Linux环境VNC服务安装、配置与使用
- 在linux中配置安装telnet服务
- linux环境下安装及配置sendmail服务(邮件服务)
- 在Red Hat Linux5下构建LAMP网站服务平台之MySQL、PHP的安装与配置
- cvs服务在linux下的安装与配置
- linux下FTP服务的安装与配置
- LINUX 第四章 Linux(RHEL 5)中Bind服务的安装与配置全过程
- Linux下rpm安装DHCP服务及配置
- Linux(RHEL 5)中Bind服务的安装与配置全过程
- 【Linux系统和服务管理】MySQL服务器安装与配置(一)
- CentOS 5.2,Linux 2.6+ 内核 ,Apache+MySQL+PHP 安装及基本配置过程记录 && 将apache安装为系统服务
- 【VNC】Linux环境VNC服务安装、配置与使用
- Linux与Windows 共享文件Samba 服务的安装于配置