远程连接服务器ssh连接工具SecureCRT下载:SecureCRT下载链接
1.centos服务器下安装jdk链接
2.centos服务器下安装tomcat链接
3.centos服务器下安装redis链接
在linux的centos服务器下安装redis步骤如下:
1.安装相关依赖
# 安装gcc依赖
yum -y install gcc
# tcl依赖
cd /usr/local/services/tcl
#下载tcl压缩包
wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz
#解压tcl压缩包
tar -zvxf tcl8.6.1-src.tar.gz
#编译tcl
cd /usr/local/services/tcl/tcl8.6.1/unix/
./configure
make
make install
2.redis安装以及编译
#下载redis压缩包
cd /usr/local/services/redis
wget http://download.redis.io/releases/redis-4.0.8.tar.gz
#解压redis压缩包
tar -zxvf redis-4.0.8.tar.gz
#编译redis
make
# 编译并安装到 /usr/local/redis/redis-4.0.8/bin/ 目录下
make PREFIX=/usr/local/redis/redis-4.0.8/ install
# 将配置文件复制到 /usr/local/dev/redis-4.0.8/bin/ 目录下
cp /usr/local/redis/redis-4.0.8/redis.conf /usr/local/redis/redis-4.0.8/bin/
3.redis配置
# 修改安装目录下的配置文件
cd /usr/local/redis/redis-4.0.8/bin/
vim redis.conf
# 注释掉,可以让其他ip访问
bind 127.0.0.1
# 改为 protected-mode no
protected-mode yes
# 改为daemonize yes ,启用后台启动
daemonize no
4.redis开机自启动设置
vim /etc/rc.d/rc.local
# 使环境变量生效
source /etc/profile
# Redis 启动
/usr/local/redis/redis-4.0.8/bin/redis-server /usr/local/redis/redis-4.0.8/bin/redis.conf
# 赋予执行权限
chmod 755 /etc/rc.d/rc.local
5.启动redis服务器端以及客户端
#启动redis服务器端
cd /usr/local/services/redis/redis-4.0.8/bin
./redis-server
#如果显示以下信息,表示redis服务器端启动正常
25081:C 10 Mar 22:11:48.981 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
25081:C 10 Mar 22:11:48.981 # Redis version=4.0.8, bits=64, commit=00000000, modified=0, pid=25081, just started
25081:C 10 Mar 22:11:48.981 # Warning: no config file specified, using the default config. In order to specify a config file use ./redis-server /path/to/redis.conf
25081:M 10 Mar 22:11:48.982 * Increased maximum number of open files to 10032 (it was originally set to 1024).
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 4.0.8 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 25081
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
25081:M 10 Mar 22:11:48.983 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
25081:M 10 Mar 22:11:48.983 # Server initialized
25081:M 10 Mar 22:11:48.983 # 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.
25081:M 10 Mar 22:11:48.983 # 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.
25081:M 10 Mar 22:11:48.983 * Ready to accept connections
6.执行初始化脚本
#启动redis客户端
cd /usr/local/services/redis/redis-4.0.8/bin
#执行启动客户端脚本
./redis-cli
#在客户端界面执行以下内容,实现rddis初始化
set finance_product_open open
set pay_flag true
set order_flag true
set user_regist_flag true
set addmoney_flag true
set finance_conf_min_order_price 20
set finance_product_cal_flag true