1.删除自带openjdk
rpm -qa | grep jdk
2.通过Xftp 将安装包拷贝到Centos中
3.通过命令安装JDK
rpm -ivh jdk-8u221-linux-x64.rpm
4.配置环境变量
JAVA_HOME=/usr/local/java/jdk1.8.0_221-amd64
CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
export PATH CLASSPATH JAVA_HOME
5.让配置生效
source /etc/profile
Redis 安装操作步骤
4.安装命令
mkdir /data/soft -p
cd /data/soft/
wget https://download.redis.io/releases/redis-5.0.7.tar.gz
tar zxf redis-5.0.7.tar.gz -C /opt/
cd /opt
ln -s /opt/redis-5.0.7 /opt/redis
cd /opt/redis
make
make install
5.编写配置文件
mkdir -p /opt/redis_6379/{conf,logs,pid}
mkdir -p /data/redis_6379
查看配置文件
cat /opt/redis_6379/conf/redis_6379.conf
vim /opt/redis_6379/conf/redis_6379.conf
以下是配置文件内容:
daemonize yes
bind 127.0.0.1 10.0.0.51
port 6379
pidfile /opt/redis_6379/pid/redis_6379.pid
logfile /opt/redis_6379/logs/redis_6379.log
启动redis
redis-server /opt/redis_6379/conf/redis_6379.conf
检测redis是否启动
ps -ef|grep redis
netstat -lntup|grep 6379
如果 netstat 未安装
yum -y install net-tools
netstat -tlnp
客户端连接redis
redis_cli
set key value
get key
关闭命令:
redis-cli shutdown