国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

centos 部署整套應(yīng)用

2023-03-26 01:42 作者:小劉Java之路  | 我要投稿

分享:服務(wù)器部署java的環(huán)境和應(yīng)用

初始化 ECS

購買 ECS

  • 阿里云 ECS 官網(wǎng)?https://www.aliyun.com/minisite/goods?userCode=ueyxv2qf

  • 數(shù)據(jù)庫/redis 等也安裝在云上?鏡像選擇centos7

img

初始化 CentOS7

curl -O http://pigx.vip/os7init.sh

sh os7init.sh pig4cloud

安裝 JDK

yum install -y java

java -version

安裝 Mysql 8

https://dev.mysql.com/downloads/

rpm -ivh ?xx.rpm

yum install -y mysql mysql-server

vi /etc/my.cnf

lower_case_table_names=1

systemctl restart mysqld

grep password /var/log/mysqld.log

set global validate_password.check_user_name=0;
set global validate_password.policy=0;
set global validate_password.length=1;

alter user 'root'@'localhost' identified by 'root';

use mysql;

update user set host = '%' where user = 'root';

FLUSH PRIVILEGES;

安裝 Redis

yum install redis

systemctl restart redis

安裝 NGINX

  • https://nginx.org/en/linux_packages.html

vim /etc/yum.repos.d/nginx.repo

[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true

[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true

yum install -y yum-utils
yum-config-manager --enable nginx-mainline
yum install -y nginx

配置 hosts

vim /etc/hosts

127.0.0.1 ? pig-mysql
127.0.0.1 ? pig-redis
127.0.0.1 ? pig-gateway
127.0.0.1 ? pig-register
127.0.0.1 ? pig-sentinel
127.0.0.1 ? pig-job

source /etc/hosts

部署 pig

準(zhǔn)備源碼包

  • pig 服務(wù)端 編譯 jar

mvn clean install

  • pig-ui 前端 編譯 dist

npm run build

初始化數(shù)據(jù)庫

  • pig db目錄

source pig.sql
source pig_codegen.sql
source pig_config.sql
source pig_job.sql

啟動服務(wù)端

nohup java -Dfile.encoding=utf-8 -jar pig-register.jar > /dev/null 2>&1 &

nohup java -Dfile.encoding=utf-8 -jar pig-monitor.jar > /dev/null 2>&1 &
nohup java -Dfile.encoding=utf-8 -jar pig-sentinel-dashboard.jar > /dev/null 2>&1 &
nohup java -Dfile.encoding=utf-8 -jar pig-xxl-job-admin.jar > /dev/null 2>&1 &

nohup java -Dfile.encoding=utf-8 -jar pig-gateway.jar > /dev/null 2>&1 &
nohup java -Dfile.encoding=utf-8 -jar pig-auth.jar > /dev/null 2>&1 &
nohup java -Dfile.encoding=utf-8 -jar pig-upms-biz.jar > /dev/null 2>&1 &

部署前端

mkdir -p /data/pig-ui && cp -r dist/* /data/pig-ui

cd /etc/nginx/conf.d && rm -f default.conf

vim pigx.conf

server {
? ?listen 80;
? ?server_name localhost;
? ?
? ?# 打包好的dist目錄文件,放置到這個目錄下
? ?root /data/pig-ui;
? ?
? ?# 注意維護新增微服務(wù),gateway 路由前綴
? ?location ~* ^/(code|auth|admin|gen) {
? ? ? proxy_pass http://127.0.0.1:9999;
? ? ? #proxy_set_header Host $http_host;
? ? ? proxy_connect_timeout 15s;
? ? ? proxy_send_timeout 15s;
? ? ? proxy_read_timeout 15s;
? ? ? proxy_set_header X-Real-IP $remote_addr;
? ? ? proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
? ? ? proxy_set_header X-Forwarded-Proto http;
? ?}
}

nginx

ECS 安全組

  • 注意配置安全組,服務(wù)相關(guān)的端口對外暴露

img
  • 80/443

  • 9999 網(wǎng)關(guān) (如需訪問swagger 需要)

  • 5001 監(jiān)控 (如需訪問monitor 需要)

  • 5020 監(jiān)控 (如需訪問monitor 需要)


centos 部署整套應(yīng)用的評論 (共 條)

分享到微博請遵守國家法律
霍州市| 武功县| 二连浩特市| 泸定县| 克拉玛依市| 绵阳市| 会理县| 昌图县| 泊头市| 尚志市| 乌海市| 扎鲁特旗| 定兴县| 乐亭县| 洛南县| 遂宁市| 双牌县| 平安县| 酒泉市| 南丹县| 吴川市| 萍乡市| 滁州市| 房山区| 察雅县| 仁寿县| 安国市| 含山县| 株洲县| 西乌珠穆沁旗| 松阳县| 南靖县| 积石山| 道孚县| 哈尔滨市| 乌苏市| 故城县| 京山县| 保德县| 开平市| 伊通|