3.17应用系统部署

3.17应用系统部署

1、基础准备
#hostnamectl set-hostname mall(修改主机名)
#bash
#vi /etc/hosts(添加主机网络映射)
192.168.100.10 mall
192.168.100.10 kafka.mall
192.168.100.10 mysql.mall
192.168.100.10 redis.mall
192.168.100.10 zookeeper.mall
#vi /etc/yum.repo.d/local.repo(配置yum源)
[mall]
name=mall
baseurl=file:///opt/gpmall-repo
gpgcheck=0
enabled=1
#yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel
#java -version(查看版本号)
#yum install redis -y
#yum install elasticsearch -y
#yum install nginx -y
#yum install mariadb mariadb-server -y
#cd /zookeeper-3.4.14/conf
#mv zoo_sample.cfg zoo.cfg
#cd zookeeper-3.4.14/bin
#./zkServer.sh start
#./zkServer.sh status(查看状态出现standalone 即可)
#cd /kafka_2.11-.1.1.1/bin
#./kafka-server-start-sh -daemon ../config/server.properties
(jps 查看kafka是否启动、下载net-tools #netstat -ntpl 查看9092端口号)
2、启动服务
vi /etc/my.cnf
添加:
[mysqld]
init_connect='SET collation_connection = utf8_unicode_ci'
init_connect='SET NAMES utf8'
character-set-server=utf8
collation-server=utf8_unicode_ci
skip-character-set-client-handshake
#systemctl start mariadb
#mysql_secure_installation (启动数据库只有 disallow root login remotely 选择 no )
#mysql -uroot -p123456
(设置root权限  *重点*)
#grant all privileges on *.* to root@localhost identified by '123456' with grant option;
#grant all privileges on *.* to root@"%" identified by '123456' with grant option;
#create database gpmall;
#use gpmall;
#source /root/gpmall.sql
#systemctl enable mariadb (redis)
#vi /etc/elasticsearch/elasticsearch.yml
添加:
http.cors.enabled:true
https.cors.allow-origin: "*"
http.cors.allow-credentials:true
去掉注释 并修改network.host的ip为本机ip
cluster.name:my-application
node.name:node-1
betwork.host:192.168.100.10
https.port:9200
#systemctl start(enable) elasticsearch
#systemctl start nginx
#systemctl enable nginx
3.部署前端
#rm -rf /usr/share/nginx/html/*
#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;
}
#nohup java -jar shopping-provider-0.0.1-SNAPSHOT.jar &
(user--provider-0.0.1-SNAPSHOT\gpmall-shopping--0.0.1-SNAPSHOT.jar\gpmall-user-0.0.1-SNAPSHOT.jar)

按照顺序依次打开jar包

#curl http://192.168.100.10
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值