gpmall商城部署

352 阅读1分钟

本文已参与「新人创作礼」活动,一起开启掘金创作之路。gpmall商城部署

 1.yum源配置

local.repo
[centos]
name=centos
baseurl=file:///opt/centos
gpgcheck=0
enabled=1
[mall]
name=mall
baseurl=file:///opt/gpmall-repo
gpgcheck=0
enabled=1

2.在gpmall-single中

mv gpmall-repo/ /opt

cd gpmall下
yum -y install java-1.8.0-openjdk java-1.8.0-openjdk-devel redis nginx mariadb mariadb-server

4.验证

java -version

5.mysql

systemctl restart mariadb

mysqladmin -uroot password 123456

6.systemctl restart redis

systemctl enable redis

7.systemctl restart nginx

systemctl enable nginx

8.mv kafka_2.11-1.1.1.tgz zookeeper-3.4.14.tar.gz /opt

cd /opt

tar -zxf kafka_2.11-1.1.1.tgz

tar -zxf zookeeper-3.4.14.tar.gz

cd zookeeper-3.4.14

cd conf

cd ..

cd bin/

./zkServer.sh start 

jps

./zkServer.sh status

cd ~

cd /opt

cd kafka_2.11-1.1.1

cd bin/

ls

./kafka-server-start.sh -daemon ../config/server.properties

jps

netstat -ntpl

mysql -uroot -p123456

create database gpmall;

use gpmall;

source /root/gpmall/gpmall/gpmall.sql

grant all privileges on . to root@"%"  identified by'123456';

grant all privileges on . to root@"localhost"  identified by'123456';

ctrl + d

systemctl enable mariadb

systemctl restart mariadb

vi /etc/my.cnf.d/my.cnf

[mysqld]
init_connect='SET collation_connection = utf8_unicode_ci'
init_connect='SET NAME utf8'
character-set-server =utf8
collation-server = utf8_unicode_ci
skip-character-set-client-handshake

systemctl restart mariadb

vi /etc/myhosts

.............. kafka.mall
.............. zookeeper.mall
.............. redis.mall 
.............. mysql.mall
..............

cd /etc/nginx

ls

cd conf.d/

ls

vi default.conf

server {
    listen       80;
    server_name  localhost;

    #charset koi8-r;
    #access_log  /var/log/nginx/host.access.log  main;

    location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm;
    }
    
    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;
    }

    #error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ .php$ {
    #    proxy_pass   http://127.0.0.1;
    #}

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

systemctl restart nginx

crm -rf /usr/share/nginx/html/*

ls

cd ~

cd gpmall/

ls

cp -r dist/* /usr/share/nginx/html/

ls

mv * .jar /root

ls

cd ~

ls

nohup java -jar shopping-provider-0.0.1-SNAPSHOT.jar &

nohup: igoring input and appending output to 'nohup.out'

jps

nohup java - jar user-provider-0.0.1-SNAPSHOT.jar &

nohup: ignoring input and appending output to 'nohup.out'

jps

nohup java -jar shopping-provider-0.0.1-SNAPSHOT.jar &

nohup: igoring input and appending output to 'nohup.out'

tail nohup.out

vi /etc/redis.conf

注释bind127.0.0.1
protected-mode yes 改为no

systemctl restart redis

nohup java -jar shopping-provider-0.0.1-SNAPSHOT.jar &

nohup: igoring input and appending output to 'nohup.out'

tail nohup.out(多执行几次)

nohup java -jar user-provider-0.0.1-SNAPSHOT.jar &

nohup: igoring input and appending output to 'nohup.out'

tail user-provider-0.0..1_SNAPSHOT.jar

tail nohup.out(多几次)

jps

ls

nuhup java -jar gpmall-shopping -0.0.1-SNAPSHOT.jar & 

nohup: ignoring input and appeending output to 'nohup.out'

tail nohup.out(多几次)

nohup java -jar gpmall-shopping-0.0.1-SNAPSHOT.jar &

nohup: ignoring input and appeending output to 'nohup.out'

jps

tail nohup.out

访问

\