1. 程式人生 > 其它 >穀粒商城的環境搭建(一)

穀粒商城的環境搭建(一)

原文:

穀粒商城的環境搭建(一) - 天宇軒-王 - 部落格園
https://www.cnblogs.com/dalianpai/p/12953199.html

穀粒商城是尚矽谷推出的全棧視訊,沒有相應的課件,整好自己動手整理一下,然後上傳到碼雲上,架構圖如下:

準備了一臺伺服器,放在家裡,通過ksa可以進行遠端訪問,配置如下:

現在做的工作是把k8s和kubesphere部署好了,這個到後面再寫,Win10可以放nexus等等。

現在伺服器上安裝docker,192.168.1.117,在配置阿里雲映象加速

官網可以檢視:https://docs.docker.com/engine/install/centos/

08、環境-linux安裝docker

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 [root@topcheer harbor]# yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine
已載入外掛:fastestmirror, langpacks 引數 docker-client-latest 沒有匹配 引數 docker-latest 沒有匹配 引數 docker-latest-logrotate 沒有匹配 引數 docker-logrotate 沒有匹配 引數 docker-engine 沒有匹配 正在解決依賴關係 --> 正在檢查事務 ---> 軟體包 container-selinux.noarch.2.2.107-3.el7 將被 刪除 ---> 軟體包 docker.x86_64.2.1.13.1-103.git7f2769b.el7.centos 將被 刪除
---> 軟體包 docker-client.x86_64.2.1.13.1-103.git7f2769b.el7.centos 將被 刪除 ---> 軟體包 docker-common.x86_64.2.1.13.1-103.git7f2769b.el7.centos 將被 刪除 --> 解決依賴關係完成 依賴關係解決 ===================================================================================================================================================== Package 架構 版本 源 大小 ===================================================================================================================================================== 正在刪除: container-selinux noarch 2:2.107-3.el7 @extras 40 k docker x86_64 2:1.13.1-103.git7f2769b.el7.centos @extras 65 M docker-client x86_64 2:1.13.1-103.git7f2769b.el7.centos @extras 13 M docker-common x86_64 2:1.13.1-103.git7f2769b.el7.centos @extras 4.4 k 事務概要 ===================================================================================================================================================== 移除 4 軟體包 安裝大小:77 M 是否繼續?[y/N]:y Downloading packages: Running transaction check Running transactiontest Transactiontestsucceeded Running transaction 正在刪除 : 2:docker-1.13.1-103.git7f2769b.el7.centos.x86_64 1/4 警告:/etc/sysconfig/docker-storage已另存為/etc/sysconfig/docker-storage.rpmsave 正在刪除 : 2:docker-client-1.13.1-103.git7f2769b.el7.centos.x86_64 2/4 正在刪除 : 2:docker-common-1.13.1-103.git7f2769b.el7.centos.x86_64 3/4 正在刪除 : 2:container-selinux-2.107-3.el7.noarch 4/4 驗證中 : 2:docker-common-1.13.1-103.git7f2769b.el7.centos.x86_64 1/4 驗證中 : 2:docker-1.13.1-103.git7f2769b.el7.centos.x86_64 2/4 驗證中 : 2:container-selinux-2.107-3.el7.noarch 3/4 驗證中 : 2:docker-client-1.13.1-103.git7f2769b.el7.centos.x86_64 4/4 刪除: container-selinux.noarch 2:2.107-3.el7 docker.x86_64 2:1.13.1-103.git7f2769b.el7.centos docker-client.x86_64 2:1.13.1-103.git7f2769b.el7.centos docker-common.x86_64 2:1.13.1-103.git7f2769b.el7.centos 完畢!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 [root@topcheer harbor]# yum install -y yum-utils 已載入外掛:fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: mirrors.tuna.tsinghua.edu.cn * extras: mirrors.tuna.tsinghua.edu.cn * updates: mirrors.tuna.tsinghua.edu.cn 正在解決依賴關係 --> 正在檢查事務 ---> 軟體包 yum-utils.noarch.0.1.1.31-50.el7 將被 升級 ---> 軟體包 yum-utils.noarch.0.1.1.31-52.el7 將被 更新 --> 解決依賴關係完成 依賴關係解決 [root@topcheer harbor]# yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo 已載入外掛:fastestmirror, langpacks adding repo from: https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo grabbingfilehttps://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo to/etc/yum.repos.d/docker-ce.repo repo saved to/etc/yum.repos.d/docker-ce.repo [root@topcheer harbor]# yum list docker-ce --showduplicates|sort -r 已載入外掛:fastestmirror, langpacks 可安裝的軟體包 * updates: mirrors.tuna.tsinghua.edu.cn Loading mirror speeds from cached hostfile * extras: mirrors.tuna.tsinghua.edu.cn docker-ce.x86_64 3:19.03.4-3.el7 docker-ce-stable docker-ce.x86_64 3:19.03.3-3.el7 docker-ce-stable docker-ce.x86_64 3:19.03.2-3.el7 docker-ce-stable ..... [root@topcheer harbor]# yum install docker-ce-17.06.2.ce-1.el7.centos 已載入外掛:fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: mirrors.tuna.tsinghua.edu.cn * extras: mirrors.tuna.tsinghua.edu.cn * updates: mirrors.tuna.tsinghua.edu.cn 正在解決依賴關係 --> 正在檢查事務 ---> 軟體包 docker-ce.x86_64.0.17.06.2.ce-1.el7.centos 將被 安裝 --> 正在處理依賴關係 container-selinux >= 2.9,它被軟體包 docker-ce-17.06.2.ce-1.el7.centos.x86_64 需要 --> 正在檢查事務 ---> 軟體包 container-selinux.noarch.2.2.107-3.el7 將被 安裝 --> 解決依賴關係完成  

在配置阿里雲加速,此處為以前的筆記

09、環境-配置docker阿里雲映象加速

1 2 3 4 5 6 [root@topcheer ~]# systemctl start docker [root@topcheer ~]# mkdir -p /etc/docker [root@topcheer ~]# vim /etc/docker/daemon.json #配置阿里雲映象加速 [root@topcheer ~]# systemctl daemon-reload #載入配置檔案 [root@topcheer ~]# systemctl restart docker #重啟 [root@topcheer ~]#

10、環境-docker安裝mysql 

檢視配置檔案

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 [root@localhost mysql]# cd conf/ [root@localhost conf]# ll total 4 -rw-r--r--. 1 root root 281 May 24 09:19 my.cnf [root@localhost conf]# cat my.cnf [client] default-character-set=utf8 [mysql] default-character-set=utf8 [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 skip-name-resolve [root@localhost conf]#
1 2 3 4 5 6 7 8 9 10 11 [root@localhost ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE mysql 5.7 a4fdfd462add 3 days ago 448MB quay.io/openebs/provisioner-localpv1.5.0 73d1ddefdddb 5 months ago 62.2MB quay.io/openebs/admission-server1.5.0 1bd4847011cc 5 months ago 194MB quay.io/openebs/snapshot-provisioner1.5.0 1900bbdb7100 5 months ago 76.2MB [root@localhost ~]# docker run -p 3306:3306 --name mysql --privileged=true -v /mydata/mysql/conf:/etc/mysql/conf.d -v /mydata/mysql/logs:/logs -v /mydata/mysql/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=root -d a4fdfd462add 4dd3eda0035b755dc6a2b0b241733c5b454442ae0f19929f1494611397dd6969 [root@localhost ~]# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 4dd3eda0035b a4fdfd462add"docker-entrypoint.s…"7 seconds ago Up 5 seconds 0.0.0.0:3306->3306/tcp, 33060/tcpmysql

11、環境-docker安裝redis

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 [root@localhost conf]# docker pull redis Using default tag: latest latest: Pulling from library/redis afb6ec6fdc1c: Already exists 608641ee4c3f: Pull complete 668ab9e1f4bc: Pull complete ea9ab8bf5f73: Pull complete 137e0d1a14d9: Pull complete b2c5e1be4a59: Pull complete Digest: sha256:89051d5ec46a89d4a708467af38eaaf4029450c4b1b9835ffd413cf70625b22e Status: Downloaded newer imageforredis:latest docker.io/library/redis:latest [root@localhost conf]# mkdir -p /mydata/redis/conf [root@localhost conf]# touch /mydata/redis/conf/redis.conf [root@localhost conf]# docker run -p 6379:6379 --privileged=true -v /mydata/redis/data:/data -v /mydata/redis/conf/redis.conf:/etc/redis/redis.conf -d redis redis-server /etc/redis/redis.conf 961ab799c1fef33a0e5cf3e7d9f52a68c843092c3520c9d2534ff17639a1efd0 [root@localhost conf]# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 961ab799c1fe redis"docker-entrypoint.s…"6 seconds ago Up 4 seconds 0.0.0.0:6379->6379/tcpfocused_kirch 4dd3eda0035b a4fdfd462add [root@localhost conf]# docker exec -it focused_kirch redis-cli 127.0.0.1:6379>setaa bb OK 127.0.0.1:6379> get aa "bb" 127.0.0.1:6379>exit [root@localhost conf]# docker restart focused_kirch focused_kirch [root@localhost conf]# docker exec -it focused_kirch redis-cli 127.0.0.1:6379> get aa "bb" 127.0.0.1:6379>exit [root@localhost conf]# ll total 4 -rw-r--r--. 1 root root 15 May 24 09:34 redis.conf [root@localhost conf]# cat redis.conf appendonlyyes [root@localhost conf]#

12、環境-開發工具&環境安裝配置  

配置

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 <profile> <id>jdk1.8</id> <activation> <activeByDefault>true</activeByDefault> <jdk>1.8</jdk> </activation> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion> </properties> </profile> <mirror> <id>alimaven</id> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <mirrorOf>central</mirrorOf> </mirror>

VSCODE安裝外掛