单机版本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
standalone模式默认使用过的是derby数据库, derby数据库数据存放在nacos/data目录下, 如果这个目录删除了或者变动了,数据没了是正常的。建议用mysql数据库在存储。
原回答者GitHub用户KomachiSion
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
阿里云拥有国内全面的云原生产品技术以及大规模的云原生应用实践,通过全面容器化、核心技术互联网化、应用 Serverless 化三大范式,助力制造业企业高效上云,实现系统稳定、应用敏捷智能。拥抱云原生,让创新无处不在。