当前位置: 首页 > news >正文

davinci本地启动

系列文章目录

davinci本地启动: link


文章目录

  • 系列文章目录
  • 1.后台启动
    • 1.1 准备mysql数据库
    • 1.2 改配置文件
  • 2 启动前端项目
    • 2.1 npm install
    • 2.2 运行npm start 失败
  • 3 配置nginx
  • 4 访问 http://localhost:8080/davinci


1.后台启动

1.1 准备mysql数据库

本人使用的是mysql8.0.19的版本所以需要把mysql-connector-java的版本调至8.0.19
pom.xml

        <dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><!--<version>5.1.44</version>--><version>8.0.19</version></dependency>

数据库信息:
在这里插入图片描述
调整config/application-dev.yml中的datasource

  datasource:type: com.alibaba.druid.pool.DruidDataSourceurl: jdbc:mysql://localhost:3306/mysql_db1?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=falseusername: <你的账号>password: <你的密码>

进入数据库执行bin/davinci.sql创建所需要的表
在这里插入图片描述

1.2 改配置文件

改后台端口号 与 环境变量中的${DAVINCI3_HOME}
config/application.yml

server:protocol: httpaddress: 127.0.0.1port: 18080 #根据你的来url: http://localhost:18080 # 根据你的来

server\src\main\resources\application.yml
${DAVINCI3_HOME}这个变量可以在系统环境变量中设置,这样你在配置文件中就不用设置了。如果不想设置在环境变量可以手动改成你的项目路径

#第一处
file:userfiles-path: <你的项目路径>/userfiles/web_resources: <你的项目路径>/davinci-ui/base-path: <你的项目路径>/lib/
#第二处
logging:config: file:<你的项目路径>/config/logback.xml
#第三处
custom-datasource-driver-path: <你的项目路径>/config/datasource_driver.yml

config/application-dev.yml
注释掉截图的配置,有可能会报错.
更改端口
设置本项目的context-path后面呢nginx会用到

screenshot:
#  default_browser: CHROME
#  timeout_second: 600
#  chromedriver_path: $your_chromedriver_path$
#  remote_webdriver_url: $your_remote_webdriver_url$server:protocol: httpaddress: 127.0.0.1port: 18080servlet:context-path: /davinci

运行DavinciServerApplication修改Active profiles为dev:
在这里插入图片描述
成功启动日志:
在这里插入图片描述

2 启动前端项目

2.1 npm install

在webapp目录下运行 npm install 成功

npm warn deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm warn deprecated axios@0.19.2: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
npm warn deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm warn deprecated intl-relativeformat@2.2.0: This package has been deprecated, please see migration guide at 'https://github.com/formatjs/formatjs/tree/master/packages/intl-relativeformat#migration-guide'
npm warn deprecated eslint@6.6.0: This version is no longer supported. Please see https://eslint.org/version-support for other options.
npm warn deprecated core-js@1.2.7: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm warn deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.> davinci-webapp@0.3.0 preinstall
> npm run npmcheckversion> davinci-webapp@0.3.0 npmcheckversion
> node ./internals/scripts/npmcheckversion.jsadded 2246 packages in 2m155 packages are looking for fundingrun `npm fund` for details

2.2 运行npm start 失败

在这里插入图片描述
出现了 ​​Error: error:0308010C:digital envelope routines::unsupported​​ 错误。这是 ​​Node.js 18+ 与 Webpack 4 的兼容性问题​​,原因是 Node.js 18+ 默认使用 OpenSSL 3,而旧版 Webpack 4 的哈希算法不兼容
设置 OpenSSL 兼容模式(临时)​​
在启动命令前添加环境变量,强制使用旧版 OpenSSL:

# Linux/macOS
export NODE_OPTIONS=--openssl-legacy-provider
npm start# Windows (PowerShell)
$env:NODE_OPTIONS="--openssl-legacy-provider"
npm start

成功启动:
在这里插入图片描述

3 配置nginx

nginx.config主要是server 中的对于davinci中的转发


#user  nobody;
worker_processes  1;#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;#pid        logs/nginx.pid;events {worker_connections  1024;
}http {include       mime.types;default_type  application/octet-stream;#log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '#                  '$status $body_bytes_sent "$http_referer" '#                  '"$http_user_agent" "$http_x_forwarded_for"';#access_log  logs/access.log  main;sendfile        on;#tcp_nopush     on;#keepalive_timeout  0;keepalive_timeout  65;#gzip  on;server {listen       80;server_name  localhost;location / {root   html;index  index.html index.htm;}error_page   500 502 503 504  /50x.html;location = /50x.html {root   html;}}server {listen       8080;# listen       443 ssl;server_name  localhost;ssl_session_cache    shared:SSL:1m;ssl_session_timeout  5m;ssl_ciphers  HIGH:!aNULL:!MD5;ssl_prefer_server_ciphers  on;server_tokens off;client_max_body_size 100m;# davinci 的配置到你的端口号location /davinci/ {proxy_pass http://localhost:18080;
#            proxy_http_version 1.1;proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header X-Forwarded-Proto $scheme;}# davinci/backend 的转发location /backend {proxy_pass http://localhost:18080/davinci;
#            proxy_http_version 1.1;proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header X-Forwarded-Proto $scheme;        }location /dashboard {index index.html;try_files $uri $uri/ /dashboard/index.html; # 用于支持单页应用的HTML5 History Mode}location /dashboard2 {index index.html;try_files $uri $uri/ /dashboard2/index.html; # 用于支持单页应用的HTML5 History Mode}error_page   500 502 503 504  /50x.html;location = /50x.html {root   html;}}
}

4 访问 http://localhost:8080/davinci

在这里插入图片描述
附npm version

{npm: '10.8.2',node: '20.18.0',acorn: '8.12.1',ada: '2.9.0',ares: '1.33.1',base64: '0.5.2',brotli: '1.1.0',cjs_module_lexer: '1.4.1',cldr: '45.0',icu: '75.1',llhttp: '8.1.2',modules: '115',napi: '9',nghttp2: '1.61.0',nghttp3: '0.7.0',ngtcp2: '1.1.0',openssl: '3.0.13+quic',simdutf: '5.5.0',tz: '2024a',undici: '6.19.8',unicode: '15.1',uv: '1.46.0',uvwasi: '0.0.21',v8: '11.3.244.8-node.23',zlib: '1.3.0.1-motley-71660e1'
}
http://www.lqws.cn/news/448489.html

相关文章:

  • 全面掌握 C++ 基础:关键特性与进化
  • uni-app-配合iOS App项目开发apple watch app
  • 巧用云平台API实现开源模型免费调用的实战教程
  • 电子电气架构 --- 软件供应商如何进入OEM体系
  • Git 命令全景图:从 clone 到 merge 的完整流程解析
  • 基于深度学习的智能视频行为识别系统:技术与实践
  • 【音视频 | RTP】RTP协议详解(H.264的RTP封包格式、AAC的RTP封包格式)
  • CSS3 3D 转换
  • GitHub Copilot 是什么,怎么使用
  • 上海人工智能实验室明珠湖会议首开,解答AI前沿疑问,推进科学智能
  • 【新手向】GitHub Desktop 的使用说明(含 GitHub Desktop 和 Git 的功能对比)
  • java面试题02访问修饰符有哪些?区别是什么?
  • 如何自建服务器并开启公网IP:本地内网网址让外网访问详细教学
  • 华为CE交换机抓包
  • 如何导出和迁移离线 Conda 环境
  • Java八股文——数据结构「排序算法篇」
  • 【目标检测】什么是目标检测?应用场景与基本流程
  • Spring 中的依赖注入(DI)详解
  • Transformer实战——Hugging Face环境配置与应用详解
  • 【编译原理】语句的翻译
  • Docker环境部署
  • Centos 离线部署(MQTT)EMOX脚本并设置开机自启
  • 4、做中学 | 二年级下期 Golang整型和浮点型
  • 高并发网络通信Netty之空轮询问题
  • 【LUT技术专题】采样间隔自适应3DLUT-AdaInt
  • STM32 HAL 初始化I2C启动DS1307
  • 第1章: 伯努利模型的极大似然估计与贝叶斯估计
  • apisix-使用hmac-auth插件进行接口签名身份验证\apisix consumer
  • 机构运动分析系统开发(Python实现)
  • 工程师生活:清除电热水壶(锅)水垢方法