开发者社区 > 云原生 > 正文

nacos1.4.1升级到2.1或2.0,以前的配置文件数据没有了

单机版本nacos1.4.1升级到2.1.2,以前的配置文件数据没有了

配置文件添加了 nacos.core.support.upgrade.from.1x=true

执行了以前操作:

1、nacos/bin/shutdown.sh

2、将其下的bin,conf,target目录覆盖原Nacos1.X的安装目录下

3、修改了配置文件application.prpperties的mysql配置, 添加了nacos.core.support.upgrade.from.1x=true

4、sh startup.sh -m standalone

tail -f logs/start.out 2022-12-09 10:33:53,040 INFO Will not secure Ant [pattern='/**'] 2022-12-09 10:33:53,072 INFO Will secure any request with [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@63cd604c, org.springframework.security.web.context.SecurityContextPersistenceFilter@10c8f62, org.springframework.security.web.header.HeaderWriterFilter@4ef27d66, org.springframework.security.web.csrf.CsrfFilter@1568159, org.springframework.security.web.authentication.logout.LogoutFilter@25bcd0c7, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@25f7391e, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@5ab14cb9, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@40dd3977, org.springframework.security.web.session.SessionManagementFilter@1d9bec4d, org.springframework.security.web.access.ExceptionTranslationFilter@5d5d9e5] 2022-12-09 10:33:53,097 INFO Exposing 1 endpoint(s) beneath base path '/actuator' 2022-12-09 10:33:53,173 INFO Tomcat started on port(s): 8858 (http) with context path '/nacos' 2022-12-09 10:33:53,199 INFO Nacos started successfully in stand alone mode. use embedded storage 2022-12-09 10:34:24,666 INFO Initializing Servlet 'dispatcherServlet' 2022-12-09 10:34:24,671 INFO Completed initialization in 5 ms

tail -f logs/nacos.log 2022-12-09 10:33:53,198 INFO Started Nacos in 10.692 seconds (JVM running for 11.325) 2022-12-09 10:33:53,199 INFO Nacos started successfully in stand alone mode. use embedded storage 2022-12-09 10:34:24,666 INFO Initializing Spring DispatcherServlet 'dispatcherServlet' 2022-12-09 10:34:24,666 INFO Initializing Servlet 'dispatcherServlet' 2022-12-09 10:34:24,671 INFO Completed initialization in 5 ms

tail -f logs/naming-server.log 2022-12-09 10:33:50,881 INFO [SelectorManager] Load SelectorContextBuilder(class com.alibaba.nacos.naming.selector.context.CmdbSelectorContextBuilder) contextType(CMDB) successfully. 2022-12-09 10:33:50,881 INFO [SelectorManager] Load SelectorContextBuilder(class com.alibaba.nacos.naming.selector.context.NoneSelectorContextBuilder) contextType(NONE) successfully. 2022-12-09 10:33:50,881 INFO [SelectorManager] Load Selector(class com.alibaba.nacos.naming.selector.LabelSelector) type(label) contextType(CMDB) successfully. 2022-12-09 10:33:50,881 INFO [SelectorManager] Load Selector(class com.alibaba.nacos.naming.selector.NoneSelector) type(none) contextType(NONE) successfully. 2022-12-09 10:33:52,048 INFO Load instance extension handler []

//nacos/v1/ns/upgrade/ops/metrics upgraded = true isAll20XVersion = true isDoubleWriteEnabled = true doubleWriteDelayTaskCount = 0 serviceCountV1 = 0 instanceCountV1 = 0 serviceCountV2 = 0 instanceCountV2 = 0 subscribeCountV2 = 0 responsibleServiceCountV1 = 0 responsibleInstanceCountV1 = 0 ephemeralServiceCountV2 = 0 persistentServiceCountV2 = 0 ephemeralInstanceCountV2 = 0 persistentInstanceCountV2 = 0 service.V1.not.in.V2 = service.V2.not.in.V1 =

原提问者GitHub用户yfgcq

展开
收起
学习娃 2023-05-22 15:48:20 432 0
1 条回答
写回答
取消 提交回答
  • standalone模式默认使用过的是derby数据库, derby数据库数据存放在nacos/data目录下, 如果这个目录删除了或者变动了,数据没了是正常的。建议用mysql数据库在存储。

    原回答者GitHub用户KomachiSion

    2023-05-22 20:32:37
    赞同 展开评论 打赏

阿里云拥有国内全面的云原生产品技术以及大规模的云原生应用实践,通过全面容器化、核心技术互联网化、应用 Serverless 化三大范式,助力制造业企业高效上云,实现系统稳定、应用敏捷智能。拥抱云原生,让创新无处不在。

相关电子书

更多
Nacos架构&原理 立即下载
workshop专场-微服务专场-开发者动手实践营-微服务-使用Nacos进行服务的动态发现和流量调度 立即下载
Nacos 启航,发布第一个版本, 云原生时代助力用户微服务平台建设 立即下载