Redis 4.0原始碼安裝
去官網下載軟體
最新穩定版本是4.0
上傳到伺服器
解壓軟體
[root@MySQL01 ~]# cd /install/
[root@MySQL01 install]# tar xvfz redis-4.0.2.tar.gz
編譯安裝
[root@MySQL01 install]# cd redis-4.0.2
[root@MySQL01 redis-4.0.2]# make
...
CC module.o
CC evict.o
CC expire.o
CC geohash.o
CC geohash_helper.o
CC childinfo.o
CC defrag.o
CC siphash.o
CC rax.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
INSTALL redis-check-aof
Hint: It's a good idea to run 'make test' ;)
make[1]: Leaving directory `/install/redis-4.0.2/src'
啟動redis
[root@MySQL01 redis-4.0.2]# src/redis-server &
[1] 48741
[root@MySQL01 redis-4.0.2]# 48741:C 03 Nov 19:29:48.941 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
48741:C 03 Nov 19:29:48.941 # Redis version=4.0.2, bits=64, commit=00000000, modified=0, pid=48741, just started
48741:C 03 Nov 19:29:48.941 # Warning: no config file specified, using the default config. In order to specify a config file use src/redis-server /path/to/redis.conf
48741:M 03 Nov 19:29:48.944 * Increased maximum number of open files to 10032 (it was originally set to 1024).
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 4.0.2 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 48741
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
48741:M 03 Nov 19:29:48.950 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
48741:M 03 Nov 19:29:48.950 # Server initialized
48741:M 03 Nov 19:29:48.950 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
48741:M 03 Nov 19:29:48.950 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
48741:M 03 Nov 19:29:48.950 * DB loaded from disk: 0.000 seconds
48741:M 03 Nov 19:29:48.950 * Ready to accept connections
透過內建的客戶端工具連線到redis
[root@MySQL01 redis-4.0.2]# src/redis-cli
127.0.0.1:6379> set foo bar
OK
127.0.0.1:6379> get foo
"bar
檢視程式
[root@MySQL01 redis-4.0.2]# ps -ef|grep redis
root 48741 1 0 Nov03 ? 00:00:25 src/redis-server *:6379
為Python 3.6.1語言安裝Redis客戶端庫
[root@MySQL01 redis-4.0.2]# pip3 install redis hiredis
Collecting redis
Downloading redis-2.10.6-py2.py3-none-any.whl (64kB)
100% |████████████████████████████████| 71kB 107kB/s
Collecting hiredis
Downloading hiredis-0.2.0.tar.gz (46kB)
100% |████████████████████████████████| 51kB 501kB/s
Installing collected packages: redis, hiredis
Running setup.py install for hiredis ... done
Successfully installed hiredis-0.2.0 redis-2.10.6
透過Python 3登入Redis
[root@MySQL01 redis-4.0.2]# python
Python 3.6.1 (default, Oct 2 2017, 06:28:48)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import redis
>>> conn = redis.Redis()
>>> conn.set('hello', 'world')
True
>>> conn.get('hello')
b'world'
最新穩定版本是4.0
上傳到伺服器
解壓軟體
[root@MySQL01 ~]# cd /install/
[root@MySQL01 install]# tar xvfz redis-4.0.2.tar.gz
編譯安裝
[root@MySQL01 install]# cd redis-4.0.2
[root@MySQL01 redis-4.0.2]# make
...
CC module.o
CC evict.o
CC expire.o
CC geohash.o
CC geohash_helper.o
CC childinfo.o
CC defrag.o
CC siphash.o
CC rax.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
INSTALL redis-check-aof
Hint: It's a good idea to run 'make test' ;)
make[1]: Leaving directory `/install/redis-4.0.2/src'
啟動redis
[root@MySQL01 redis-4.0.2]# src/redis-server &
[1] 48741
[root@MySQL01 redis-4.0.2]# 48741:C 03 Nov 19:29:48.941 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
48741:C 03 Nov 19:29:48.941 # Redis version=4.0.2, bits=64, commit=00000000, modified=0, pid=48741, just started
48741:C 03 Nov 19:29:48.941 # Warning: no config file specified, using the default config. In order to specify a config file use src/redis-server /path/to/redis.conf
48741:M 03 Nov 19:29:48.944 * Increased maximum number of open files to 10032 (it was originally set to 1024).
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 4.0.2 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 48741
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
48741:M 03 Nov 19:29:48.950 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
48741:M 03 Nov 19:29:48.950 # Server initialized
48741:M 03 Nov 19:29:48.950 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
48741:M 03 Nov 19:29:48.950 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
48741:M 03 Nov 19:29:48.950 * DB loaded from disk: 0.000 seconds
48741:M 03 Nov 19:29:48.950 * Ready to accept connections
透過內建的客戶端工具連線到redis
[root@MySQL01 redis-4.0.2]# src/redis-cli
127.0.0.1:6379> set foo bar
OK
127.0.0.1:6379> get foo
"bar
檢視程式
[root@MySQL01 redis-4.0.2]# ps -ef|grep redis
root 48741 1 0 Nov03 ? 00:00:25 src/redis-server *:6379
為Python 3.6.1語言安裝Redis客戶端庫
[root@MySQL01 redis-4.0.2]# pip3 install redis hiredis
Collecting redis
Downloading redis-2.10.6-py2.py3-none-any.whl (64kB)
100% |████████████████████████████████| 71kB 107kB/s
Collecting hiredis
Downloading hiredis-0.2.0.tar.gz (46kB)
100% |████████████████████████████████| 51kB 501kB/s
Installing collected packages: redis, hiredis
Running setup.py install for hiredis ... done
Successfully installed hiredis-0.2.0 redis-2.10.6
透過Python 3登入Redis
[root@MySQL01 redis-4.0.2]# python
Python 3.6.1 (default, Oct 2 2017, 06:28:48)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import redis
>>> conn = redis.Redis()
>>> conn.set('hello', 'world')
True
>>> conn.get('hello')
b'world'
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26506993/viewspace-2146826/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- macbook 原始碼安裝 redisMac原始碼Redis
- rpm方式安裝redis4.0Redis
- 原始碼編譯安裝Redis原始碼編譯Redis
- CentOS 7.4安裝redis 4.0詳細步驟CentOSRedis
- centos7.4原始碼安裝php,swoole,nginx,redis,mariadbCentOS原始碼PHPNginxRedis
- [環境搭建] 透過原始碼編譯安裝 Redis原始碼編譯Redis
- webug4.0安裝Web
- 原始碼安裝openresty原始碼REST
- nginx原始碼安裝Nginx原始碼
- 原始碼安裝postgresql原始碼SQL
- Nginx 原始碼安裝Nginx原始碼
- 原始碼安裝GO原始碼Go
- PostgreSQL 10.12 安裝系列 - 原始碼安裝SQL原始碼
- 【推薦 - 原始碼安裝】nginx - 安裝原始碼Nginx
- yum安裝與原始碼安裝比較原始碼
- Mysql for Linux安裝配置之—— 原始碼安裝MySqlLinux原始碼
- linux安裝python3(原始碼安裝)LinuxPython原始碼
- MySQL 5.7.28 原始碼安裝MySql原始碼
- paramiko 2.4.1原始碼安裝原始碼
- macbook 原始碼安裝 nginxMac原始碼Nginx
- docker原始碼安裝NginxDocker原始碼Nginx
- 【PG安裝】postgresql10 for linux 原始碼安裝SQLLinux原始碼
- 連網安裝mysql與原始碼安裝mysqlMySql原始碼
- Why Redis 4.0?Redis
- 【redis安裝】Redis
- Redis 安裝Redis
- redis安裝Redis
- 安裝RedisRedis
- mysql5.5.20原始碼安裝MySql原始碼
- EOS原始碼分析(1)安裝原始碼
- PostgreSQL-原始碼安裝(一)SQL原始碼
- openeuler原始碼安裝Postgresql 16原始碼SQL
- 原始碼安裝Nginx和PHP原始碼NginxPHP
- 原始碼包安裝過程原始碼
- 【Redis原始碼】Redis 6 ACL原始碼詳解Redis原始碼
- Mac安裝Redis,詳細redis安裝步驟MacRedis
- Redis for linux原始碼&叢集(cluster)&主從(master-slave)&哨兵(sentinel)安裝配置RedisLinux原始碼AST
- 【Redis】Windows下安裝RedisRedisWindows
- linux-原始碼的編譯安裝和解除安裝Linux原始碼編譯