Centos7安装源码安装Redis

环境

  1. CentOS7 如(CentOS Linux release 7.3.1611 (Core)
  2. GCC 如(gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC)
  3. tcl如(tcl8.6.1

安装

下载Redis源码,并解压

[root@localhost opt]# wget http://download.redis.io/releases/redis-5.0.5.tar.gz

[root@localhost opt]# ll | grep redis
-rw-r--r--.  1 root  root    1975750 May 16 00:26 redis-5.0.5.tar.gz

[root@localhost opt]# tar zxvf redis-5.0.5.tar.gz

[root@localhost opt]# ll | grep redis
drwxrwxr-x.  6 root  root       4096 May 16 00:07 redis-5.0.5
-rw-r--r--.  1 root  root    1975750 May 16 00:26 redis-5.0.5.tar.gz

make test & make & make install

[root@localhost opt]# cd redis-5.0.5
[root@localhost redis-5.0.5]# make test
[root@localhost redis-5.0.5]# make
[root@localhost redis-5.0.5]# make install

install

[root@localhost redis-5.0.5]# cd utils
[root@localhost utils]# ll
total 52
-rw-rw-r--. 1 root root  593 May 16 00:07 build-static-symbols.tcl
-rw-rw-r--. 1 root root 1303 May 16 00:07 cluster_fail_time.tcl
-rw-rw-r--. 1 root root 1098 May 16 00:07 corrupt_rdb.c
drwxrwxr-x. 2 root root   60 May 16 00:07 create-cluster
-rwxrwxr-x. 1 root root 2149 May 16 00:07 generate-command-help.rb
drwxrwxr-x. 3 root root   31 May 16 00:07 graphs
drwxrwxr-x. 2 root root   39 May 16 00:07 hashtable
drwxrwxr-x. 2 root root   70 May 16 00:07 hyperloglog
-rwxrwxr-x. 1 root root 9567 May 16 00:07 install_server.sh
drwxrwxr-x. 2 root root   63 May 16 00:07 lru
-rw-rw-r--. 1 root root 1277 May 16 00:07 redis-copy.rb
-rwxrwxr-x. 1 root root 1352 May 16 00:07 redis_init_script
-rwxrwxr-x. 1 root root 1047 May 16 00:07 redis_init_script.tpl
-rw-rw-r--. 1 root root 1762 May 16 00:07 redis-sha1.rb
drwxrwxr-x. 2 root root  135 May 16 00:07 releasetools
-rwxrwxr-x. 1 root root 3787 May 16 00:07 speed-regression.tcl
-rwxrwxr-x. 1 root root  693 May 16 00:07 whatisdoing.sh

[root@localhost 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] 
Selecting default: 6379
Please select the redis config file name [/etc/redis/6379.conf] 
Selected default - /etc/redis/6379.conf
Please select the redis log file name [/var/log/redis_6379.log] 
Selected default - /var/log/redis_6379.log
Please select the data directory for this instance [/var/lib/redis/6379] 
Selected default - /var/lib/redis/6379
Please select the redis executable path [/usr/local/bin/redis-server] 
Selected config:
Port           : 6379
Config file    : /etc/redis/6379.conf
Log file       : /var/log/redis_6379.log
Data dir       : /var/lib/redis/6379
Executable     : /usr/local/bin/redis-server
Cli Executable : /usr/local/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!
/var/run/redis_6379.pid exists, process is already running or crashed
Installation successful!

设置开机启动

[root@localhost utils]# chkconfig redis_6379 on

重启

[root@localhost utils]# service redis_6379 restart

安装另外一个实例

[root@localhost 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] 2379
Please select the redis config file name [/etc/redis/2379.conf] 
Selected default - /etc/redis/2379.conf
Please select the redis log file name [/var/log/redis_2379.log] 
Selected default - /var/log/redis_2379.log
Please select the data directory for this instance [/var/lib/redis/2379] 
Selected default - /var/lib/redis/2379
Please select the redis executable path [/usr/local/bin/redis-server] 
Selected config:
Port           : 2379
Config file    : /etc/redis/2379.conf
Log file       : /var/log/redis_2379.log
Data dir       : /var/lib/redis/2379
Executable     : /usr/local/bin/redis-server
Cli Executable : /usr/local/bin/redis-cli
Is this ok? Then press ENTER to go on or Ctrl-C to abort.
Copied /tmp/2379.conf => /etc/init.d/redis_2379
Installing service...
Successfully added to chkconfig!
Successfully added to runlevels 345!
Starting Redis server...
Installation successful!
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值