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

让别人做网站需要注意什么问题最新新闻热点国际

让别人做网站需要注意什么问题,最新新闻热点国际,福田欧曼,同一个空间可以做两个网站么再接入nacos配置中心时#xff0c;需要确认几点#xff1a; 1. spring boot 版本 (spring boot 2.x ) 2. nacos 配置中心 服务端 版本 (1.1.4) 3. nacos client 客户端版本 (1.1.4) 方式一 1. 启动 nacos 服务端#xff0c;这里不做解释 在配置中心中加入几个配置 2. 在…再接入nacos配置中心时需要确认几点 1. spring boot 版本 (spring boot 2.x ) 2. nacos 配置中心 服务端 版本 (1.1.4) 3. nacos client 客户端版本 (1.1.4) 方式一 1. 启动 nacos 服务端这里不做解释 在配置中心中加入几个配置 2. 在自己的应用里引入 依赖包 dependencygroupIdcom.alibaba.boot/groupIdartifactIdnacos-config-spring-boot-starter/artifactIdversion0.2.8/version/dependency 注意 nacos-config-spring-boot-starter 的版本内 引入了 nacos-client需要注意引入的版本 是否与nacos服务端匹配。如果不匹配可能会有问题。 这里使用的 nacos 服务端 是 1.x版本所有引入的包也是1.x的才可以。 3. 配置 nacos 服务端地址 nacos.config.server-addr localhost:8848  4.  在spring boot 启动类 加入 注解 如果是 只有一个 dataId使用 NacosPropertySource 如果有 多个 dataId使用 NacosPropertySources SpringBootApplication NacosPropertySources({NacosPropertySource(dataId springboot-nacos-hello, autoRefreshed true,type ConfigType.PROPERTIES),NacosPropertySource(dataId useLocalCache, autoRefreshed true,type ConfigType.PROPERTIES) }) public class NacostestApplication {public static void main(String[] args) {SpringApplication.run(NacostestApplication.class, args);}} 5. 读取 配置 使用 注解 NacosValue NacosValue(value ${hi}, autoRefreshed true)private String useLocalCache; 方式二 引入依赖 dependencygroupIdcom.alibaba.nacos/groupIdartifactIdnacos-client/artifactIdversion1.1.4/version/dependency 直接调用api Component public class ConfigS {Beanpublic ConfigService configService() {try {Properties properties new Properties();properties.setProperty(serverAddr, localhost:8848);ConfigService configService NacosFactory.createConfigService(properties);configService.addListener(springboot-nacos-hello, DEFAULT_GROUP, new Listener() {Overridepublic Executor getExecutor() {return null;}Overridepublic void receiveConfigInfo(String configInfo) {// 配置更新处理逻辑System.out.printf(configInfo);}});return configService;} catch (Exception e) {return null;}} } configService.getConfig(springboot-nacos-hello,DEFAULT_GROUP,10000) 这种方式 只是简单的拉去配置中心的内容需要自己解析 配置内容和监听更新 方案三 引入依赖包 dependencygroupIdcom.alibaba.cloud/groupIdartifactIdspring-cloud-starter-alibaba-nacos-config/artifactIdversion2.1.1.RELEASE/versionexclusionsexclusiongroupIdcom.alibaba.nacos/groupIdartifactIdnacos-client/artifactId/exclusion/exclusions/dependencydependencygroupIdcom.alibaba.nacos/groupIdartifactIdnacos-client/artifactIdversion1.1.4/version/dependency 在 bootstrap.properties 文件中配置属性 #服务地址 spring.cloud.nacos.config.server-addr localhost:8848#共享配置 spring.cloud.nacos.config.shared-dataidsa.properties,b.properties spring.cloud.nacos.config.refreshable-dataidsa.properties#扩展配置 spring.cloud.nacos.config.ext-config.0.data-iduseLocalCache.properties spring.cloud.nacos.config.ext-config.0.refreshtrue spring.cloud.nacos.config.ext-config.1.data-iduseLocalCache2.properties#当前应用 spring.cloud.nacos.config.prefixapp spring.cloud.nacos.config.file-extension properties 读取配置 使用Value 注解 Value(value ${hi}) private String useLocalCache;   nacos配置中心添加配置 共有三种配置 1. 加载共享配置 sharedDataids 注意 需要有后缀 refreshableDataids 分隔符 [,] 2. 加载扩展配置 extConfig 数组结构 dataId 必须有后缀 3. 加载应用级别的配置 读取 prefix /name/spring.application.name 属性 作为dataId 1. 直接加载 dataId 2. 加载 dataId.fileExtension 3. 加载 dataId - profile . fileExtension 覆盖
http://www.hkea.cn/news/14503374/

相关文章:

  • 正能量网站推荐免费下载茂名网站建设优化
  • 深圳网站建设行业排行快速搭建网站的工具
  • 濮阳市建站公司衡水市网站制作
  • 天津制作网站公司推荐软件外包交易平台
  • 校友会网站建设各行业关键词
  • 农化网站建设广州安全教育平台初始密码
  • 建网站一定要备案吗湖南外发加工网
  • 哈尔滨建设工程交易中心网站河北石家庄最新数据消息
  • 网站后台怎么做qq群自动加电子商务能从事什么工作
  • 网站建设 企业 资质 等级建设网站需要钱吗
  • 南昌个人做网站展会广告策划公司
  • 英文网站怎么切换中文嘟嘟嘟在线观看播放免费
  • 河南建设工程信息网站郑州seo怎么做
  • 购物网站 开发德宏商城网站建设
  • 南京网站建设服务落实20条优化措施
  • 在小型网站建设小组中的基本不一样的婚恋网站怎么做
  • 太原市城市建设规划局官方网站个人博客网站取名
  • 宁波网站推广公司报价百度平台营销软件
  • 学习php网站开发绿色主题 wordpress
  • 广东电白建设集团有限公司网站做广告的公司
  • 网站开发源代码什么意思主办单位性质与网站名称不符
  • 怎样加入好大夫网站做医生网络平面设计培训班
  • 潜江网站搭建二级域名免费分发
  • 哈尔滨网络科技公司网站购物商城网站建设流程
  • 自助建站系统免费模式自定义优定软件网站建设
  • 目前做的比较好的法律网站有哪些臭臭猫网站建设
  • 网站建设及推广文案小鱼在线网站建设
  • 域名连接网站邢台信息港官网
  • 如何利用淘宝建设网站挣钱常州市网站制作
  • 零基础网站建设教学北京智能网站建设哪里好