# linux环境部署
## 步骤
-----------------------------
- 配置系统DNS
- 重启网络服务
- 安装jdk
- 新建日志目录设置权限
- 停止防火墙
- 启动后台服务
### 配置系统dns
-----------------------------
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DNS1=
'重启网络服务
systemctl restart network
## 安装jdk
-----------------------------
yum install java-1.8.0-openjdk -y
## 建立日志目录权限设置任意
-----------------------------
mkdir /data/logs
chmod -R 777 /data/logs
## 后台服务方式运行jar
-----------------------------
nohup java -jar testservice.jar > /dev/null &
## 停止防火墙
-----------------------------
systemctl stop firewalld
## 安装mysql5.7数据库
-----------------------------
wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
rpm -ivh mysql57-community-release-el7-8.noarch.rpm
yum install mysql-server -y
mysql5.7默认生成一个随机密码在/var/log/mysql.log.
mysql -uroot -p***** 登录修改密码
set password = password('123456')
exit;
重新登录查看
show databases; 查看数据库
## 更换yum源
-----------------------------
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum makecache
## 安装epel
-----------------------------
yum install epel-release -y
## 安装redis
-----------------------------
yum install redis -y
systemctl start redis 启动服务
redis-cli 访问