“应用系统部署”的版本间的差异
来自CloudWiki
(创建页面,内容为“将4个jar包和dist上传 ==全局变量配置== vi /etc/hosts <nowiki>127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1…”) |
|||
第35行: | 第35行: | ||
proxy_pass http://127.0.0.1:8083; | proxy_pass http://127.0.0.1:8083; | ||
}</nowiki> | }</nowiki> | ||
+ | |||
+ | 重启nginx服务,至此前端部署完毕: | ||
+ | |||
+ | systemctl restart nginx | ||
+ | |||
+ | ==部署后端== | ||
+ | 将4个jar包上传,并测试启动: | ||
+ | |||
+ | <nowiki>[root@localhost ~]# cd /opt | ||
+ | [root@localhost opt]# ls | ||
+ | CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo | ||
+ | CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo gpmall | ||
+ | [root@localhost opt]# cd gpmall | ||
+ | [root@localhost gpmall]# ls | ||
+ | gpmall-file kafka_2.11-1.1.1 zookeeper-3.4.14 | ||
+ | gpmall-repo kafka_2.11-1.1.1.tgz zookeeper-3.4.14.tar.gz | ||
+ | [root@localhost gpmall]# cd gpmall-file | ||
+ | [root@localhost gpmall-file]# ls | ||
+ | dist gpmall-user-0.0.1-SNAPSHOT.jar | ||
+ | gpmall-shopping-0.0.1-SNAPSHOT.jar shopping-provider-0.0.1-SNAPSHOT.jar | ||
+ | gpmall.sql user-provider-0.0.1-SNAPSHOT.jar</nowiki> | ||
+ | |||
+ | 112 cd gpmall-file | ||
+ | 113 ls | ||
+ | 114 java -jar shopping-provider-0.0.1-SNAPSHOT.jar & | ||
+ | 115 ls | ||
+ | 116 java -jar user-provider-0.0.1-SNAPSHOT.jar & | ||
+ | 117 ls | ||
+ | 118 java -jar gpmall-shopping-0.0.1-SNAPSHOT.jar & | ||
+ | 119 ls | ||
+ | 120 java -jar gpmall-user-0.0.1-SNAPSHOT.jar & | ||
+ | |||
+ | ==网站访问== | ||
+ | |||
+ | 访问主机地址, | ||
+ | |||
+ | java.sql.SQLException: Access denied for user 'root'@'mall' (using password: YES) |
2019年10月22日 (二) 09:22的版本
将4个jar包和dist上传
全局变量配置
vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.214.100 mall 192.168.214.100 kafka.mall 192.168.214.100 mysql.mall 192.168.214.100 redis.mall 192.168.214.100 zookeeper.mall
部署前端
将dist目录上传/root
rm -rf /usr/share/nginx/html/*
cd ~
cp -rvf dist/* /usr/share/nginx/html
vi /etc/nginx/conf.d/default.conf
location /user { proxy_pass http://127.0.0.1:8082; } location /shopping { proxy_pass http://127.0.0.1:8081; } location /cashier { proxy_pass http://127.0.0.1:8083; }
重启nginx服务,至此前端部署完毕:
systemctl restart nginx
部署后端
将4个jar包上传,并测试启动:
[root@localhost ~]# cd /opt [root@localhost opt]# ls CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo gpmall [root@localhost opt]# cd gpmall [root@localhost gpmall]# ls gpmall-file kafka_2.11-1.1.1 zookeeper-3.4.14 gpmall-repo kafka_2.11-1.1.1.tgz zookeeper-3.4.14.tar.gz [root@localhost gpmall]# cd gpmall-file [root@localhost gpmall-file]# ls dist gpmall-user-0.0.1-SNAPSHOT.jar gpmall-shopping-0.0.1-SNAPSHOT.jar shopping-provider-0.0.1-SNAPSHOT.jar gpmall.sql user-provider-0.0.1-SNAPSHOT.jar
112 cd gpmall-file 113 ls 114 java -jar shopping-provider-0.0.1-SNAPSHOT.jar & 115 ls 116 java -jar user-provider-0.0.1-SNAPSHOT.jar & 117 ls 118 java -jar gpmall-shopping-0.0.1-SNAPSHOT.jar & 119 ls 120 java -jar gpmall-user-0.0.1-SNAPSHOT.jar &
网站访问
访问主机地址,
java.sql.SQLException: Access denied for user 'root'@'mall' (using password: YES)