<em>Mac</em>Book项目 2009年学校开始实施<em>Mac</em>Book项目,所有师生配备一本<em>Mac</em>Book,并同步更新了校园无线网络。学校每周进行电脑技术更新,每月发送技术支持资料,极大改变了教学及学习方式。因此2011
2021-06-01 09:32:01
nacos server 原始碼執行在本地自己建立的專案中。
正常啟動的話,SpringBoot框架會自動載入resource目錄下的bootstrap.yml檔案中的設定,紀錄檔記錄會列印相關紀錄檔:
Connected to the target VM, address: '127.0.0.1:54696', transport: 'socket'
2021-12-21 16:18:44.639 INFO 8342 --- [ main] c.a.n.c.l.StartingApplicationListener : Nacos started successfully in stand alone mode. use external storage,--.
,--.'|
,--,: : | Nacos
,`--.'`| ' : ,---. Running in stand alone mode, All function modules
| : : | | ' ,' .--.--. Port: 8848
: | | : ,--.--. ,---. / / | / / ' Pid: 8342
| : ' '; | / / . ; ,. :| : /`./ Console: http://192.168.100.43:8848/nacos/index.html
' ' ;. ;.--. .-. | / / '' | |: :| : ;_
| | | | __/: . .. ' / ' | .; : `. https://nacos.io
' : | ; .' ," .--.; |' ; :__| : | `----.
| | '`--' / / ,. |' | '.'| / / /`--' /
' : | ; : .' : : `----' '--'. /
; |.' | , .-./ / `--'---'
'---' `--`---' `----'2021-12-21 16:18:46.141 INFO 8342 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=71ca1145-0798-3a30-a497-d6b8d15b4f05
2021-12-21 16:18:46.504 INFO 8342 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8848 (http)
2021-12-21 16:18:46.704 INFO 8342 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1780 ms
2021-12-21 16:18:48.714 INFO 8342 --- [ main] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page: class path resource [static/index.html]
2021-12-21 16:18:49.190 INFO 8342 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure Ant [pattern='/**'] with []
2021-12-21 16:18:49.222 INFO 8342 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@20616795, org.springframework.security.web.context.SecurityContextPersistenceFilter@74de1e9d, org.springframework.security.web.header.HeaderWriterFilter@1a927db2, org.springframework.security.web.csrf.CsrfFilter@14abde3e, org.springframework.security.web.authentication.logout.LogoutFilter@7170da18, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@43b9ef41, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@191d69a, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@1b61c1, org.springframework.security.web.session.SessionManagementFilter@4e22fdc0, org.springframework.security.web.access.ExceptionTranslationFilter@281f2d6c]
2021-12-21 16:18:49.270 INFO 8342 --- [ main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 16 endpoint(s) beneath base path '/actuator'
2021-12-21 16:18:49.374 INFO 8342 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8848 (http) with context path '/nacos'
2021-12-21 16:18:49.396 INFO 8342 --- [ main] c.a.n.c.l.StartingApplicationListener : Nacos started successfully in stand alone mode. use external storage
2021-12-21 16:18:49.689 INFO 8342 --- [-192.168.100.43] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2021-12-21 16:18:49.691 INFO 8342 --- [-192.168.100.43] o.s.web.servlet.DispatcherServlet : Completed initialization in 2 ms
但是我把這塊的nocos程式碼原封不動的copy到的自己的一個專案中,修改了bootstrap.yml檔案中的資料庫連線。
然後啟動紀錄檔列印卻顯示使用的是embedded storage。
紀錄檔如下:
Connected to the target VM, address: '127.0.0.1:54270', transport: 'socket'
,--.
,--.'|
,--,: : | Nacos
,`--.'`| ' : ,---. Running in stand alone mode, All function modules
| : : | | ' ,' .--.--. Port: 8848
: | | : ,--.--. ,---. / / | / / ' Pid: 8132
| : ' '; | / / . ; ,. :| : /`./ Console: http://192.168.100.43:8848/nacos/index.html
' ' ;. ;.--. .-. | / / '' | |: :| : ;_
| | | | __/: . .. ' / ' | .; : `. https://nacos.io
' : | ; .' ," .--.; |' ; :__| : | `----.
| | '`--' / / ,. |' | '.'| / / /`--' /
' : | ; : .' : : `----' '--'. /
; |.' | , .-./ / `--'---'
'---' `--`---' `----'2021-12-21 16:17:11.755 WARN 8132 --- [ main] o.s.boot.StartupInfoLogger : InetAddress.getLocalHost().getHostName() took 5002 milliseconds to respond. Please verify your network configuration (macOS machines may need to add entries to /etc/hosts).
2021-12-21 16:17:20.760 INFO 8132 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8848 (http)
2021-12-21 16:17:21.339 INFO 8132 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 4410 ms
2021-12-21 16:17:31.806 INFO 8132 --- [ main] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page: class path resource [static/index.html]
2021-12-21 16:17:32.562 INFO 8132 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure Ant [pattern='/**'] with []
2021-12-21 16:17:32.627 INFO 8132 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@51a06fd5, org.springframework.security.web.context.SecurityContextPersistenceFilter@53c0424a, org.springframework.security.web.header.HeaderWriterFilter@360432d3, org.springframework.web.filter.CorsFilter@71458178, org.springframework.security.web.authentication.logout.LogoutFilter@18487f92, com.alibaba.nacos.filter.JwtAuthenticationTokenFilter@26edfa34, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@408a0e92, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@51a65f56, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@776b7fa2, org.springframework.security.web.session.SessionManagementFilter@6391d34f, org.springframework.security.web.access.ExceptionTranslationFilter@66978c15, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@2e7cd4bb]
2021-12-21 16:17:32.664 INFO 8132 --- [ main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 1 endpoint(s) beneath base path '/actuator'
2021-12-21 16:17:32.783 INFO 8132 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8848 (http) with context path '/nacos'
2021-12-21 16:17:32.829 INFO 8132 --- [ main] c.a.n.c.l.StartingApplicationListener : Nacos started successfully in stand alone mode. use embedded storage
2021-12-21 16:17:33.599 INFO 8132 --- [-192.168.100.43] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2021-12-21 16:17:33.602 INFO 8132 --- [-192.168.100.43] o.s.web.servlet.DispatcherServlet : Completed initialization in 2 ms
看紀錄檔應該發現是服務沒有讀取到bootstrap.yml檔案中的設定。應該就是定位到是bootstrap.yml沒有被載入。
只要全域性引入bootstrap 啟動器和組態檔處理器就可以解決這個問題
<!--bootstrap 啟動器--> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-bootstrap</artifactId> </dependency> <!--組態檔處理器--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-configuration-processor</artifactId> <optional>true</optional> </dependency> <!--組態檔加解密--> <dependency> <groupId>com.github.ulisesbocchio</groupId> <artifactId>jasypt-spring-boot-starter</artifactId> <version>${jasypt.version}</version> </dependency>
也有可能是自己pom檔案排除掉了相關結尾的檔案,刪掉過濾器就行。
<build> <resources> <resource> <directory>src/main/resources</directory> <includes> <include>**/*.properties</include> <include>**/*.xml</include> </includes> <filtering>false</filtering> </resource> <resource> <directory>src/main/java</directory> <includes> <include>**/*.properties</include> <include>**/*.xml</include> </includes> <filtering>false</filtering> </resource> </resources> </build>
以上為個人經驗,希望能給大家一個參考,也希望大家多多支援it145.com。
相關文章
<em>Mac</em>Book项目 2009年学校开始实施<em>Mac</em>Book项目,所有师生配备一本<em>Mac</em>Book,并同步更新了校园无线网络。学校每周进行电脑技术更新,每月发送技术支持资料,极大改变了教学及学习方式。因此2011
2021-06-01 09:32:01
综合看Anker超能充系列的性价比很高,并且与不仅和iPhone12/苹果<em>Mac</em>Book很配,而且适合多设备充电需求的日常使用或差旅场景,不管是安卓还是Switch同样也能用得上它,希望这次分享能给准备购入充电器的小伙伴们有所
2021-06-01 09:31:42
除了L4WUDU与吴亦凡已经多次共事,成为了明面上的厂牌成员,吴亦凡还曾带领20XXCLUB全队参加2020年的一场音乐节,这也是20XXCLUB首次全员合照,王嗣尧Turbo、陈彦希Regi、<em>Mac</em> Ova Seas、林渝植等人全部出场。然而让
2021-06-01 09:31:34
目前应用IPFS的机构:1 谷歌<em>浏览器</em>支持IPFS分布式协议 2 万维网 (历史档案博物馆)数据库 3 火狐<em>浏览器</em>支持 IPFS分布式协议 4 EOS 等数字货币数据存储 5 美国国会图书馆,历史资料永久保存在 IPFS 6 加
2021-06-01 09:31:24
开拓者的车机是兼容苹果和<em>安卓</em>,虽然我不怎么用,但确实兼顾了我家人的很多需求:副驾的门板还配有解锁开关,有的时候老婆开车,下车的时候偶尔会忘记解锁,我在副驾驶可以自己开门:第二排设计很好,不仅配置了一个很大的
2021-06-01 09:30:48
不仅是<em>安卓</em>手机,苹果手机的降价力度也是前所未有了,iPhone12也“跳水价”了,发布价是6799元,如今已经跌至5308元,降价幅度超过1400元,最新定价确认了。iPhone12是苹果首款5G手机,同时也是全球首款5nm芯片的智能机,它
2021-06-01 09:30:45