IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 系统运维 -> 树莓派上部署jeecg-boot快速开发平台 -> 正文阅读

[系统运维]树莓派上部署jeecg-boot快速开发平台

图片

系统安装Ubuntu Server(可百度)

更换软件源

打开位置

cd /etc/apt/

编辑sources.list

sudo nano sources.list

使用清华的软件源镜像

deb https://mirrors.ustc.edu.cn/ubuntu-ports/ focal main restricted universe multiversedeb https://mirrors.ustc.edu.cn/ubuntu-ports/ focal-updates main restricted universe multiversedeb https://mirrors.ustc.edu.cn/ubuntu-ports/ focal-backports main restricted universe multiversedeb https://mirrors.ustc.edu.cn/ubuntu-ports/ focal-security main restricted universe multiverse

更新源

sudo apt-get update

ubuntu server自动登录

首先指定自动登录用户

sudo vim /etc/systemd/system/getty.target.wants/getty@tty1.service/sbin/agetty后添加-a userExecStart=-/sbin/agetty -a root -o '-p -- \\u' --noclear %I $TERM

设置免密码登录

sudo vim /etc/passwd将 root:x:0:0:root:/root:/bin/bash 中的x去掉,即:root::0:0:root:/root:/bin/bash,如果要指定别的用户可以找到相对应的行,用户名位于第一行。

root 允许ssh远程登录

sudo vim /etc/ssh/sshd_config找到PermitRootLogin without-password 修改为PermitRootLogin yesservice ssh restart

安装mysql数据库

新建my.cnf文件

sudo nano /usr/mysql/my.cnf

运行mysql容器(将容器内的my.cnf映射到新建的文件)

sudo docker run -itd --name mysql -p 3306:3306 --restart=always --privileged=true -e TZ=Asia/Shanghai -e MYSQL_ROOT_PASSWORD=root -v /usr/mysql/my.cnf:/etc/mysql/my.cnf biarms/mysql:5.7.30-linux-arm64v8

修改my.cnf(开启federated,可以创建链接表)

[mysqld]federatedserver_id=1binlog-ignore-db=mysqllog-bin=replicas-mysql-binbinlog_cache_size=1Mbinlog_format=mixedexpire_logs_days=7max_allowed_packet=125Mmax_connections=200max_connect_errors=10000datadir =/opt/mysql/datasocket =/opt/mysql/data/mysql.sockcollation-server = utf8_unicode_ciinit-connect='SET NAMES utf8'character-set-server = utf8log_error=error.log[client]# default-character-set = utf8socket =/opt/mysql/data/mysql.sock

创建链接表

创建表链接到mysql://root:root@127.0.0.1:3306/jeecg-boot/partcapacity

CREATE TABLE partcapacity (id VARCHAR(36) NOT NULL COMMENT ‘主键’ COLLATE ‘utf8mb4_general_ci’,create_by VARCHAR(50) NULL DEFAULT NULL COMMENT ‘创建人’ COLLATE ‘utf8mb4_general_ci’,create_time DATETIME NULL DEFAULT NULL COMMENT ‘创建日期’,update_by VARCHAR(50) NULL DEFAULT NULL COMMENT ‘更新人’ COLLATE ‘utf8mb4_general_ci’,update_time DATETIME NULL DEFAULT NULL COMMENT ‘更新日期’,sys_org_code VARCHAR(64) NULL DEFAULT NULL COMMENT ‘所属部门’ COLLATE ‘utf8mb4_general_ci’,partno VARCHAR(32) NULL DEFAULT NULL COMMENT ‘料号’ COLLATE ‘utf8mb4_general_ci’,capacity DOUBLE(10,0) NULL DEFAULT NULL COMMENT ‘产能/天’,notes VARCHAR(255) NULL DEFAULT NULL COMMENT ‘备注’ COLLATE ‘utf8mb4_general_ci’,leadtime DOUBLE(10,0) NULL DEFAULT NULL COMMENT ‘采购周期/天’,PRIMARY KEY (id) USING BTREE)CHARSET=utf8 COMMENT='产能’ENGINE =FEDERATED CONNECTION=‘mysql://root:root@127.0.0.1:3306/jeecg-boot/partcapacity’;


安装redis(最好加上密码)
---------------

sudo docker run -d --name jeecgredis -p 6379:6379 --restart=always redis --requirepass “redis”


制作jeecgboot镜像
-------------

### 下载jdk文件

jdk-8u241-linux-arm64-vfp-hflt.tar.gzhttps://www.oracle.com/java/technologies/javase/javase8u211-later-archive-downloads.html#license-lightbox


### 制作java dockerfile(跟jdk文件放在同一目录)

FROM buildpack-depsMAINTAINER sean# Default to UTF-8 file.encodingENV LANG C.UTF-8ENV JAVA_HOME /usr/local/jdk8ENV PATH J A V A H O M E / b i n : JAVA_HOME/bin: JAVAH?OME/bin:PATHENV JDK_FILE jdk-8u241-linux-arm64-vfp-hflt.tar.gzCOPY J D K F I L E / u s r / l o c a l / R U N m k d i r ? p " JDK_FILE /usr/local/RUN mkdir -p " JDKF?ILE/usr/local/RUNmkdir?p"JAVA_HOME"; \ ? tar --extract --file /usr/local/KaTeX parse error: Undefined control sequence: \- at position 10: JDK_FILE \?-?-directory "JAVA_HOME" --strip-components 1 --no-same-owner; \ ? rm /usr/local/$JDK_FILE


### 制作java镜像

sudo docker build -t arm64jdk:8 .


### 制作jeecgboot dockerfile(跟后端程序的jar包放在同一目录)

FROM arm64jdk:8MAINTAINER SeanRUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtimeRUN mkdir -p /jeecg-bootWORKDIR /jeecg-bootEXPOSE 8080ADD jeecg-boot-module-system-2.4.3.jar ./CMD sleep 60;java -Djava.security.egd=file:/dev/./urandom -jar jeecg-boot-module-system-2.4.3.jar


### 制作jeecgboot后端镜像

sudo docker build -t jeecg-boot:v1.0 .


### 运行jeecgboot后端程序

sudo docker run -p 8080:8080 --name jeecg-boot --restart=always jeecg-boot:v1.0


  

制作jeecg前端程序nginx镜像
------------------

### 制作dockerfile(跟前端程序dist目录放在一起)

FROM arm64v8/nginxMAINTAINER jeecgVOLUME /tmpENV LANG en_US.UTF-8RUN echo " ? server { \ ? ? ? ? ? ? ? ? ? ? listen ? ? ? 80; \ ? ? ? ? ? ? ? ? ? ? location ^~ /jeecg-boot { \ ? ? ? ? ? ? ? ? ? ? proxy_pass ? ? ? ? ? ? http://127.0.0.1:8080/jeecg-boot/; \ ? ? ? ? ? ? ? ? ? ? proxy_set_header ? ? ? Host 127.0.0.1; \ ? ? ? ? ? ? ? ? ? ? proxy_set_header ? ? ? X-Real-IP $remote_addr; \ ? ? ? ? ? ? ? ? ? ? proxy_set_header ? ? ? X-Forwarded-For $proxy_add_x_forwarded_for; \ ? ? ? ? ? ? ? ? } \ ? ? ? ? ? ? ? ? #解决Router(mode: ‘history’)模式下,刷新路由地址不能找到页面的问题 \ ? ? ? ? ? ? ? ? location / { \ ? ? ? ? ? ? ? ? ? ? root ? /var/www/html/; \ ? ? ? ? ? ? ? ? ? ? index index.html index.htm; \ ? ? ? ? ? ? ? ? ? ? if (!-e $request_filename) { \ ? ? ? ? ? ? ? ? ? ? ? ? rewrite ^(.*)$ /index.html?s=$1 last; \ ? ? ? ? ? ? ? ? ? ? ? ? break; \ ? ? ? ? ? ? ? ? ? ? } \ ? ? ? ? ? ? ? ? } \ ? ? ? ? ? ? ? ? access_log /var/log/nginx/access.log ; \ ? ? ? ? ? ? } " > /etc/nginx/conf.d/default.conf \ ? && mkdir -p /var/www \ ? && mkdir -p /var/www/htmlADD dist/ /var/www/html/EXPOSE 80EXPOSE 443


### 制作nginx镜像

sudo docker build -t jeecg-nginx:v1.0 .


### 运行nginx前端程序

sudo docker run -p 80:80 --name jeecg-nginx --restart=always jeecg-nginx:v1.0


开启nginx压缩
---------

### nginx.conf

user nginx;worker_processes auto;error_log /var/log/nginx/error.log notice;pid ? ? ? /var/run/nginx.pid;events { ? worker_connections 1024;}http { ? include ? ? ? /etc/nginx/mime.types; ? default_type application/octet-stream; ? log_format main '$remote_addr - r e m o t e u s e r [ remote_user [ remoteu?ser[time_local] “ r e q u e s t " ′ ? ? ? ? ? ? ? ? ? ? ′ request" ' ? ? ? ? ? ? ? ? ? ? ' request"??????????status b o d y b y t e s s e n t " body_bytes_sent " bodyb?ytess?ent"http_referer” ’ ? ? ? ? ? ? ? ? ? ? ‘“ h t t p u s e r a g e n t " " http_user_agent" " httpu?sera?gent""http_x_forwarded_for”’; ? access_log /var/log/nginx/access.log main; ? sendfile ? ? ? on; ? #tcp_nopush ? ? on; ? keepalive_timeout 65; ? # gzip config ? gzip on; ? gzip_min_length 1k; ? gzip_comp_level 9; ? gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png; ? gzip_vary on; ? gzip_disable “MSIE [1-6].”; ? include /etc/nginx/conf.d/*.conf;}


### 复制nginx.conf到容器(可减少加载页面时间)

sudo docker cp /usr/jeecg/jeecgnginx/nginx.conf 4497a5de8344:/etc/nginx/

4497a5de8344为容器id

登录在线开发平台
--------

![图片](https://img-blog.csdnimg.cn/img_convert/556ac631ff8e4c4107e5a4fa8483097c.png)
  系统运维 最新文章
配置小型公司网络WLAN基本业务(AC通过三层
如何在交付运维过程中建立风险底线意识,提
快速传输大文件,怎么通过网络传大文件给对
从游戏服务端角度分析移动同步(状态同步)
MySQL使用MyCat实现分库分表
如何用DWDM射频光纤技术实现200公里外的站点
国内顺畅下载k8s.gcr.io的镜像
自动化测试appium
ctfshow ssrf
Linux操作系统学习之实用指令(Centos7/8均
上一篇文章      下一篇文章      查看所有文章
加:2021-08-15 15:58:38  更:2021-08-15 16:00:43 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年5日历 -2024/5/21 0:18:10-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码