redis基本安装
redis的安装# ls(两个rpm包,一个tar包,一定对应好包名和操作系统!!)
jemalloc-3.6.0-1.el6.x86_64.rpmjemalloc-devel-3.6.0-1.el6.x86_64.rpmredis-stableredis-stable.tar.gz
# redis-server /tmp/hahaha/redis-stable/redis.conf &
9778
# 9778:C 28 May 15:57:09.310 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
9778:C 28 May 15:57:09.310 # Redis version=4.0.9, bits=64, commit=00000000, modified=0, pid=9778, just started
9778:C 28 May 15:57:09.310 # Configuration loaded
9778:M 28 May 15:57:09.313 * Increased maximum number of open files to 10032 (it was originally set to 1024).
_._
_.-``__ ''-._
_.-`` `.`_.''-._ Redis 4.0.9 (00000000/0) 64 bit
.-`` .-```.```\/ _.,_ ''-._
( ' , .-`| `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 9778
`-._ `-._`-./_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
9778:M 28 May 15:57:09.328 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
9778:M 28 May 15:57:09.329 # Server initialized
9778:M 28 May 15:57:09.329 # 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.
9778:M 28 May 15:57:09.330 # 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.
9778:M 28 May 15:57:09.330 * DB loaded from disk: 0.000 seconds
9778:M 28 May 15:57:09.330 * Ready to accept connections
^C
# ps -ef|grep redis
root 977824340 15:57 pts/1 00:00:00 redis-server 127.0.0.1:6379
root 978324340 15:57 pts/1 00:00:00 grep redis
我们之前说过tomcat连接mysql数据库需要mysql-connector-java驱动,那么tomcat连接redis又需要那些驱动呢??
1.commons-logging.zip
2.commons-pool2.jar
3.jedis.jar
4.tomcat-juli.zip
5.tomcat-redis-session-manager-tomcat-java.jar
*(以上的的驱动都应该放在tomcat服务目录下的lib目录,驱动版本一定得注意)
除此外还需要定义连接数据库配置文件
页:
[1]