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

南京网站开发南京乐识强免费网站制作

南京网站开发南京乐识强,免费网站制作,洮南网站建设哪家好,免费咨询图片大全大图前言:前两天公司接到客户提供的一个微服务框架,导师让我在本地部署验证一下该框架的可用性,借此机会记录一下微服务项目的一个基本部署流程,仅供学习参考,如有不足还请指正! 文件结构 提供的压缩文件共包含…

前言:前两天公司接到客户提供的一个微服务框架,导师让我在本地部署验证一下该框架的可用性,借此机会记录一下微服务项目的一个基本部署流程,仅供学习参考,如有不足还请指正!

文件结构

提供的压缩文件共包含源码、Maven配置信息以及一份框架说明

image-20240119102558275

部署过程

1、修改Maven信息
  • 打开源码后先将Maven修改为框架提供的Maven配置文件(修改后需刷新Maven)

image-20240119103027036

  • 附(Maven配置源码,供参考;该项目主要采用阿里云组件库):
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"><mirrors><mirror><id>mirror</id><mirrorOf>central,jcenter,!rdc-releases,!rdc-snapshots</mirrorOf><name>mirror</name><url>https://maven.aliyun.com/nexus/content/groups/public</url></mirror></mirrors><servers><server><id>rdc-releases</id><username>64423e0f253e98e0c616d548</username><password>cFMOPZMySW7I</password></server><server><id>rdc-snapshots</id><username>64423e0f253e98e0c616d548</username><password>cFMOPZMySW7I</password></server></servers><profiles><profile><id>rdc</id><properties><altReleaseDeploymentRepository>rdc-releases::default::https://packages.aliyun.com/maven/repository/2260349-release-dYnJeL/</altReleaseDeploymentRepository><altSnapshotDeploymentRepository>rdc-snapshots::default::https://packages.aliyun.com/maven/repository/2260349-snapshot-x4T8Ra/</altSnapshotDeploymentRepository></properties><repositories><repository><id>central</id><url>https://maven.aliyun.com/nexus/content/groups/public</url><releases><enabled>true</enabled></releases><snapshots><enabled>false</enabled></snapshots></repository><repository><id>snapshots</id><url>https://maven.aliyun.com/nexus/content/groups/public</url><releases><enabled>false</enabled></releases><snapshots><enabled>true</enabled></snapshots></repository><repository><id>rdc-releases</id><url>https://packages.aliyun.com/maven/repository/2260349-release-dYnJeL/</url><releases><enabled>true</enabled></releases><snapshots><enabled>false</enabled></snapshots></repository><repository><id>rdc-snapshots</id><url>https://packages.aliyun.com/maven/repository/2260349-snapshot-x4T8Ra/</url><releases><enabled>false</enabled></releases><snapshots><enabled>true</enabled></snapshots></repository></repositories><pluginRepositories><pluginRepository><id>central</id><url>https://maven.aliyun.com/nexus/content/groups/public</url><releases><enabled>true</enabled></releases><snapshots><enabled>false</enabled></snapshots></pluginRepository><pluginRepository><id>snapshots</id><url>https://maven.aliyun.com/nexus/content/groups/public</url><releases><enabled>false</enabled></releases><snapshots><enabled>true</enabled></snapshots></pluginRepository><pluginRepository><id>rdc-releases</id><url>https://packages.aliyun.com/maven/repository/2260349-release-dYnJeL/</url><releases><enabled>true</enabled></releases><snapshots><enabled>false</enabled></snapshots></pluginRepository><pluginRepository><id>rdc-snapshots</id><url>https://packages.aliyun.com/maven/repository/2260349-snapshot-x4T8Ra/</url><releases><enabled>false</enabled></releases><snapshots><enabled>true</enabled></snapshots></pluginRepository></pluginRepositories></profile></profiles><activeProfiles><activeProfile>rdc</activeProfile></activeProfiles>
</settings>
2、框架结构
  • 该框架主要包括gateway(网关)、uaa(认证系统)、platform(基础平台)、plugin(功能组件)四大部分,可根据需要部署使用。

image-20240119103502143

3、初始化数据库
  • 将源码中doc/sq文件夹下的SQL导入本地数据库:

image-20240119103816394

  • navicat中新建数据库(marscloud),字符集参考sql文件中字符集(utf8mb4):

image-20240119104051330

  • 导入结果:

image-20240119104157772

4、初始化nacos

nacos 配置文件在:doc/nacos 目录下,在 nacos 控制台导入目录下的 yaml 文件

  • 首先启动本地nacosimage-20240119104644340

  • 在nacos新建命名空间(marscloud)

    image-20240119104838665

  • 导入yaml文件(可以现将所有yaml文件压缩为zip然后再导入)image-20240119105052509

  • 导入结果

    image-20240119105140265

5、修改nacos中的连接信息
  • 主要是修改Redis和MySQL的连接信息 ,Redis可以修改为自己服务器,MySQL为刚刚我们新建的本地marscloud数据库。(修改后记得发布【手动狗头】)

    image-20240119105526873

    image-20240119105620230

6、修改项目中nacos的连接信息
  • 通常情况下nacos连接信息在项目的bootstrap.yml文件夹中,但该框架无bootstrap.yml文件,而是配置项目启动的环境变量;每个微服务模块启动的环境变量都需要修改,以下为idea中的操作。

    image-20240119110428556

    启动时的环境变量如下(其中 NACOS_GROUP,NACOS_NAMESPACE 表示配置所在的组和命名空间,NACOS_URL 表示 nacos 连接地址,根据实际连接信息替换):

    Active profiles 为当前使用的配置环境

    NACOS_GROUP=DEFAULT_GROUP;NACOS_NAMESPACE=marscloud;NACOS_URL=localhost:8848

    image-20240119111616621

完成以上步骤后即可正常启动
Other 可能会出现的异常

若启动报错如下,说明未连接到nacos,需检查启动时的环境变量。

image-20240119112059566

验证测试

  • 根据以上操作启动gateway、system、uaa三个模块image-20240119113104350

  • 使用apifox获取图片验证码进行测试,正常获取验证码,即项目后端部署完成(10002为网关端口)

image-20240119114354302

Other 可能会出现的异常

若接口请求测试时出现以下异常,则可能是jdk版本导致,将jdk版本切换为1.8即可

image-20240119114622369

Over!

http://www.yidumall.com/news/97251.html

相关文章:

  • 黑山网站制作公司2023免费b站推广大全
  • 网络seo优化平台百度seo关键词排名查询
  • 武汉手机网站建设公司优化网站排名如何
  • wordpress 笔记插件下载win10优化
  • 大亚湾住建局网站 建设工程规划最近国内新闻
  • 深圳坪山网站制作公司多用户建站平台
  • 视频网站视频预览怎么做的四川seo推广方案
  • 视频网站怎么做外链seo优化销售话术
  • 网络营销方法的分析与应用优化大师优化项目有哪些
  • 北京中国建设部网站首页留号码的广告网站不需要验证码
  • wordpress html5 app海口网站关键词优化
  • 上海网站制作哪家奿360优化大师官方最新
  • 自己做的网站本地虚拟上传雅虎搜索引擎入口
  • 门业网站模板下载查关键词热度的网站
  • 网站建设属于软件开发网站建设网站
  • 大神自己做的下载音乐的网站长沙关键词优化费用
  • ps做网站框架搭建爱战网关键词挖掘查询工具
  • 游戏网站设计百度竞价什么意思
  • 蔡家坡网站开发百度浏览器网址链接
  • 建设部质量监督官方网站郑州网站策划
  • 网站做系统下载谷歌seo网站建设
  • 中国建设教育协会的是假网站吗广告公司推广文案
  • 南山做网站公司大数据营销系统多少钱
  • 建网站开发国外客户日照seo优化
  • 网站 业务范围网站制作免费
  • wordpress hookseo优化网站优化
  • 广东seo外包服务网站关键词优化软件
  • 成都市政府门户网站建设如何做网站设计
  • 郴州必去三个景点关键词整站优化公司
  • 网站pv多少可以aso优化技术