部署Nacos的源碼環(huán)境搭建過程
正文
最近在學(xué)習(xí)nacos
,通過調(diào)式源碼查看服務(wù)注冊和發(fā)現(xiàn)流程和原理,本地部署naos
源碼需要一定的步驟,本文主要做nacos
源碼部署。
nacos版本:2.1.1
下載源碼
從github上下載源碼到本地,下載下圖的源碼包,
地址為https://github.com/alibaba/nacos/releases/tag/2.1.1
解壓后用idea
打開源碼,com.alibaba.nacos.consistency.entity
報紅錯誤:
編譯
解決com.alibaba.nacos.consistency.entity
報紅問題,編譯總項目。在目錄nacos-2.1.1
打開終端編譯整個項目:
mvn compile
啟動
啟動類
找到console
項目中的Nacos
啟動類。
設(shè)置單機(jī)啟動
啟動類配置VM options
添加參數(shù),設(shè)置成單機(jī)啟動:
-Dnacos.standalone=true
啟動輸出
有以下輸出,說明項目啟動成功:
,--. ,--.'| ,--,: : | Nacos ,`--.'`| ' : ,---. Running in stand alone mode, All function modules | : : | | ' ,'\ .--.--. Port: 8848 : | \ | : ,--.--. ,---. / / | / / ' Pid: 7184 | : ' '; | / \ / \. ; ,. :| : /`./ Console: http://192.168.3.181:8848/nacos/index.html ' ' ;. ;.--. .-. | / / '' | |: :| : ;_ | | | \ | \__\/: . .. ' / ' | .; : \ \ `. https://nacos.io ' : | ; .' ," .--.; |' ; :__| : | `----. \ | | '`--' / / ,. |' | '.'|\ \ / / /`--' / ' : | ; : .' \ : : `----' '--'. / ; |.' | , .-./\ \ / `--'---' '---' `--`---' `----' 2023-01-11 11:20:45.576 INFO 7184 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8848 (http) 2023-01-11 11:20:45.716 INFO 7184 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1964 ms 2023-01-11 11:20:48.151 INFO 7184 --- [ main] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page: class path resource [static/index.html] 2023-01-11 11:20:48.402 WARN 7184 --- [ main] o.s.s.c.a.web.builders.WebSecurity : You are asking Spring Security to ignore Ant [pattern='/**']. This is not recommended -- please use permitAll via HttpSecurity#authorizeHttpRequests instead. 2023-01-11 11:20:48.402 INFO 7184 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will not secure Ant [pattern='/**'] 2023-01-11 11:20:48.418 INFO 7184 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@637c8632, org.springframework.security.web.context.SecurityContextPersistenceFilter@7c4a5ef2, org.springframework.security.web.header.HeaderWriterFilter@3055f310, org.springframework.security.web.csrf.CsrfFilter@7901a5ab, org.springframework.security.web.authentication.logout.LogoutFilter@7a2fd94c, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@34d3409d, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@2f64f99f, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@156eeff1, org.springframework.security.web.session.SessionManagementFilter@7d7c05fa, org.springframework.security.web.access.ExceptionTranslationFilter@288b8663] 2023-01-11 11:20:48.433 INFO 7184 --- [ main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 1 endpoint(s) beneath base path '/actuator' 2023-01-11 11:20:48.465 INFO 7184 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8848 (http) with context path '/nacos' 2023-01-11 11:20:48.480 INFO 7184 --- [ main] c.a.n.c.l.StartingApplicationListener : Nacos started successfully in stand alone mode. use embedded storage 2023-01-11 11:20:48.752 INFO 7184 --- [)-192.168.3.181] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet' 2023-01-11 11:20:48.752 INFO 7184 --- [)-192.168.3.181] o.s.web.servlet.DispatcherServlet : Completed initialization in 0 ms
查看控制臺
請求http://127.0.0.1:8848/nacos
,查看控制臺。
以上就是部署Nacos的源碼環(huán)境搭建過程的詳細(xì)內(nèi)容,更多關(guān)于Nacos源碼部署環(huán)境搭建的資料請關(guān)注腳本之家其它相關(guān)文章!
相關(guān)文章
深入分析@Resource和@Autowired注解區(qū)別
這篇文章主要為大家介紹了深入分析@Resource和@Autowired注解區(qū)別,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-04-04java動態(tài)代理和cglib動態(tài)代理示例分享
這篇文章主要介紹了java動態(tài)代理和cglib動態(tài)代理示例,JDK1.3之后,Java提供了動態(tài)代理的技術(shù),允許開發(fā)者在運(yùn)行期間創(chuàng)建接口的代理實例,下面我們使用示例學(xué)習(xí)一下2014-03-03Java實現(xiàn)數(shù)據(jù)脫敏的方法詳細(xì)講解
這篇文章主要給大家介紹了關(guān)于Java實現(xiàn)數(shù)據(jù)脫敏的相關(guān)資料,數(shù)據(jù)脫敏是指對某些敏感信息通過脫敏規(guī)則進(jìn)行數(shù)據(jù)的變形,實現(xiàn)敏感隱私數(shù)據(jù)的可靠保護(hù),需要的朋友可以參考下2023-06-06mybatis-plus動態(tài)表名的實現(xiàn)示例
這篇文章主要介紹了mybatis-plus動態(tài)表名的實現(xiàn)示例,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2021-04-04MyBatis-Plus 插件擴(kuò)展的實現(xiàn)
MyBatis-Plus通過插件擴(kuò)展機(jī)制增強(qiáng)功能,基于MyBatis Interceptor攔截器,包括分頁插件、邏輯刪除、SQL性能分析和樂觀鎖等,開發(fā)者可自定義插件以適應(yīng)特定需求,有效地增強(qiáng)SQL執(zhí)行過程的控制和優(yōu)化,同時注意插件使用的性能影響和執(zhí)行順序2024-09-09