安装
步骤
1.下载
2.解压缩
注:github下载二进制超级慢,也可以在csdn下载。
启动
步骤
1.切换目录
2.启动 //单机模式启动
3.验证是否启动成功
gongzhihaodeMacBook-Pro:bin gongzhihao$ sh shutdown.sh //第一次启动失败,因为集群启动,但是没有配置集群配置文件
No nacosServer running.
gongzhihaodeMacBook-Pro:bin gongzhihao$
gongzhihaodeMacBook-Pro:bin gongzhihao$ sh startup.sh -m standalone //再次启动
/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/bin/java -Xms512m -Xmx512m -Xmn256m -Dnacos.standalone=true -Djava.ext.dirs=/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/jre/lib/ext:/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/lib/ext:/Users/gongzhihao/Downloads/nacos/plugins/cmdb:/Users/gongzhihao/Downloads/nacos/plugins/mysql -Xloggc:/Users/gongzhihao/Downloads/nacos/logs/nacos_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000 -Dnacos.home=/Users/gongzhihao/Downloads/nacos -Dloader.path=/Users/gongzhihao/Downloads/nacos/plugins/health -jar /Users/gongzhihao/Downloads/nacos/target/nacos-server.jar --spring.config.location=classpath:/,classpath:/config/,file:./,file:./config/,file:/Users/gongzhihao/Downloads/nacos/conf/ --logging.config=/Users/gongzhihao/Downloads/nacos/conf/nacos-logback.xml --server.max-http-header-size=524288
nacos is starting with standalone
nacos is starting,you can check the /Users/gongzhihao/Downloads/nacos/logs/start.out //日志文件
gongzhihaodeMacBook-Pro:bin gongzhihao$
gongzhihaodeMacBook-Pro:bin gongzhihao$
gongzhihaodeMacBook-Pro:bin gongzhihao$ ps -ef | grep nacos //查看进程
501 18676 1 0 8:31PM ttys000 0:36.32 /Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/bin/java -Xms512m -Xmx512m -Xmn256m -Dnacos.standalone=true -Djava.ext.dirs=/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/jre/lib/ext:/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/lib/ext:/Users/gongzhihao/Downloads/nacos/plugins/cmdb:/Users/gongzhihao/Downloads/nacos/plugins/mysql -Xloggc:/Users/gongzhihao/Downloads/nacos/logs/nacos_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000 -Dnacos.home=/Users/gongzhihao/Downloads/nacos -Dloader.path=/Users/gongzhihao/Downloads/nacos/plugins/health -jar /Users/gongzhihao/Downloads/nacos/target/nacos-server.jar --spring.config.location=classpath:/,classpath:/config/,file:./,file:./config/,file:/Users/gongzhihao/Downloads/nacos/conf/ --logging.config=/Users/gongzhihao/Downloads/nacos/conf/nacos-logback.xml --server.max-http-header-size=524288 nacos.nacos
501 18678 18549 0 8:32PM ttys000 0:00.00 grep nacos
gongzhihaodeMacBook-Pro:bin gongzhihao$
gongzhihaodeMacBook-Pro:bin gongzhihao$
日志
启动之后,输出日志
/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/bin/java -Xms512m -Xmx512m -Xmn256m -Dnacos.standalone=true -Djava.ext.dirs=/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/jre/lib/ext:/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/lib/ext:/Users/gongzhihao/Downloads/nacos/plugins/cmdb:/Users/gongzhihao/Downloads/nacos/plugins/mysql -Xloggc:/Users/gongzhihao/Downloads/nacos/logs/nacos_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000 -Dnacos.home=/Users/gongzhihao/Downloads/nacos -Dloader.path=/Users/gongzhihao/Downloads/nacos/plugins/health -jar /Users/gongzhihao/Downloads/nacos/target/nacos-server.jar --spring.config.location=classpath:/,classpath:/config/,file:./,file:./config/,file:/Users/gongzhihao/Downloads/nacos/conf/ --logging.config=/Users/gongzhihao/Downloads/nacos/conf/nacos-logback.xml --server.max-http-header-size=524288
Listening for transport dt_socket at address: 8000
,--.
,--.'|
,--,: : | Nacos 1.1.4
,`--.'`| ' : ,---. Running in stand alone mode, All function modules
| : : | | ' ,'\ .--.--. Port: 8848 //端口
: | \ | : ,--.--. ,---. / / | / / ' Pid: 18676
| : ' '; | / \ / \. ; ,. :| : /`./ Console: http://192.168.168.104:8848/nacos/index.html //管理系统访问地址
' ' ;. ;.--. .-. | / / '' | |: :| : ;_
| | | \ | \__\/: . .. ' / ' | .; : \ \ `. https://nacos.io
' : | ; .' ," .--.; |' ; :__| : | `----. \
| | '`--' / / ,. |' | '.'|\ \ / / /`--' /
' : | ; : .' \ : : `----' '--'. /
; |.' | , .-./\ \ / `--'---'
'---' `--`---' `----'
2020-02-17 20:31:52,614 INFO Bean 'org.springframework.security.config.annotation.configuration.ObjectPostProcessorConfiguration' of type [org.springframework.security.config.annotation.configuration.ObjectPostProcessorConfiguration$$EnhancerBySpringCGLIB$$b9bd296d] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-02-17 20:31:52,723 INFO Bean 'objectPostProcessor' of type [org.springframework.security.config.annotation.configuration.AutowireBeanFactoryObjectPostProcessor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-02-17 20:31:52,725 INFO Bean 'org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler@5f4d427e' of type [org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-02-17 20:31:52,728 INFO Bean 'org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration' of type [org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration$$EnhancerBySpringCGLIB$$de91cc1f] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-02-17 20:31:52,732 INFO Bean 'methodSecurityMetadataSource' of type [org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-02-17 20:31:53,258 INFO Tomcat initialized with port(s): 8848 (http)
2020-02-17 20:31:53,414 INFO Root WebApplicationContext: initialization completed in 2897 ms
2020-02-17 20:31:56,701 INFO Initializing ExecutorService 'applicationTaskExecutor'
2020-02-17 20:31:56,920 INFO Adding welcome page: class path resource [static/index.html]
2020-02-17 20:31:57,318 INFO Creating filter chain: Ant [pattern='/'], []
2020-02-17 20:31:57,318 INFO Creating filter chain: Ant [pattern='/**/*.css'], []
2020-02-17 20:31:57,318 INFO Creating filter chain: Ant [pattern='/**/*.js'], []
2020-02-17 20:31:57,318 INFO Creating filter chain: Ant [pattern='/**/*.html'], []
2020-02-17 20:31:57,318 INFO Creating filter chain: Ant [pattern='/**/*.map'], []
2020-02-17 20:31:57,318 INFO Creating filter chain: Ant [pattern='/**/*.svg'], []
2020-02-17 20:31:57,318 INFO Creating filter chain: Ant [pattern='/**/*.png'], []
2020-02-17 20:31:57,319 INFO Creating filter chain: Ant [pattern='/**/*.ico'], []
2020-02-17 20:31:57,319 INFO Creating filter chain: Ant [pattern='/console-fe/public/**'], []
2020-02-17 20:31:57,319 INFO Creating filter chain: Ant [pattern='/v1/auth/login'], []
2020-02-17 20:31:57,319 INFO Creating filter chain: Ant [pattern='/v1/console/health/**'], []
2020-02-17 20:31:57,319 INFO Creating filter chain: Ant [pattern='/v1/cs/**'], []
2020-02-17 20:31:57,319 INFO Creating filter chain: Ant [pattern='/v1/ns/**'], []
2020-02-17 20:31:57,319 INFO Creating filter chain: Ant [pattern='/v1/cmdb/**'], []
2020-02-17 20:31:57,319 INFO Creating filter chain: Ant [pattern='/actuator/**'], []
2020-02-17 20:31:57,319 INFO Creating filter chain: Ant [pattern='/v1/console/server/**'], []
2020-02-17 20:31:57,370 INFO Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@3d19d85, org.springframework.security.web.context.SecurityContextPersistenceFilter@4a8e6e89, org.springframework.security.web.header.HeaderWriterFilter@43984213, org.springframework.security.web.authentication.logout.LogoutFilter@1391af3b, com.alibaba.nacos.console.filter.JwtAuthenticationTokenFilter@2ae62bb6, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@63d5874f, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@23a918c7, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@68ed3f30, org.springframework.security.web.session.SessionManagementFilter@1e1b061, org.springframework.security.web.access.ExceptionTranslationFilter@e11ecfa, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@44af588b]
2020-02-17 20:31:57,495 INFO Exposing 2 endpoint(s) beneath base path '/actuator'
2020-02-17 20:31:57,534 INFO Initializing ExecutorService 'taskScheduler'
2020-02-17 20:31:57,679 INFO Tomcat started on port(s): 8848 (http) with context path '/nacos' //web端口
2020-02-17 20:31:57,685 INFO Nacos Log files: /Users/gongzhihao/Downloads/nacos/logs/
2020-02-17 20:31:57,685 INFO Nacos Conf files: /Users/gongzhihao/Downloads/nacos/conf/
2020-02-17 20:31:57,685 INFO Nacos Data files: /Users/gongzhihao/Downloads/nacos/data/
2020-02-17 20:31:57,685 INFO Nacos started successfully in stand alone mode.
2020-02-17 20:32:01,031 INFO Initializing Servlet 'dispatcherServlet'
2020-02-17 20:32:01,041 INFO Completed initialization in 10 ms
管理系统
即console。
访问路径是 http://localhost:8848/nacos
如何知道访问路径?
看启动日志。
或者,官方github项目有个console项目目录,里面有配置。
用户名密码
nacos/nacos
登陆之后