云服务器 centos7.9安装nacos2.4问题处理

11 篇文章 0 订阅
云服务器 centos7.9安装nacos2.4,单机模式启动失败,问题发现解决过程

准备好nacos安装包
nacos安装包

安装简略步骤

1、上传安装包到 /usr/local/

2、解压tar包

3、编写配置文件(注意)

这些配置一定要放开注释

### If use MySQL as datasource:
spring.datasource.platform=mysql

### Count of DB:
db.num=1

### Connect URL of DB:
db.url.0=jdbc:mysql://127.0.0.1:3306/naocs-config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
db.user.0=root
db.password.0=12345678

4、新建数据库naocs-config,导入数据源

5、切换到 bin 目录下启动 (单机模式启动)

# 进入bin启动服务
cd /usr/local/nacos/bin

sh startup.sh -m standalone

输出:
在这里插入图片描述
6、切换到 cd /usr/local/nacos/logs 下

cat start.out

查看启动日志:发现错误

 ERROR Error starting Tomcat context. Exception: org.springframework.beans.factory.BeanCreationException. Message: Error creating bean with name 'authFilterRegistration' defined in class path resource........略
 
nested exception is org.springframework.boot.web.server.WebServerException: Unable 
to start embedded Tomcat.......略

java.lang.RuntimeException: java.lang.RuntimeException: [db-load-error]load jdbc.properties error

7、切换到 bin 目录下,执行 shutdown.sh命令停掉服务

8、编辑 start.sh脚本 改成单机启动
vim start.sh
修改 export MODE=“standalone”

done
    esac
        exit 1;;
        echo "Unknown parameter"
        ?)
            EMBEDDED_STORAGE=$OPTARG;;
        p)
            MEMBER_LIST=$OPTARG;;
        c)
            SERVER=$OPTARG;;
        s)
            FUNCTION_MODE=$OPTARG;;
        f)
            MODE=$OPTARG;;
        m)
    case $opt in
do
while getopts ":m:f:s:c:p:" opt
export EMBEDDED_STORAGE=""
export MEMBER_LIST=""
export FUNCTION_MODE="all"
export MODE="standalone"
export SERVER="nacos-server"

9、重新启动

cd /usr/local/nacos/bin

sh startup.sh -m standalone

10、查看start.out查看状态 启动成功

/usr/local/jdk1.8.0_11/bin/java -Djava.ext.dirs=/usr/local/jdk1.8.0_11/jre/lib/ext:/usr/local/jdk1.8.0_11/lib/ext  -Xms512m -Xmx512m -Xmn256m -Dnacos.standalone=true -Dnacos.member.list= -Xloggc:/usr/local/nacos2.4/nacos/logs/nacos_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -Dloader.path=/usr/local/nacos2.4/nacos/plugins/health,/usr/local/nacos2.4/nacos/plugins/cmdb,/usr/local/nacos2.4/nacos/plugins/selector -Dnacos.home=/usr/local/nacos2.4/nacos -jar /usr/local/nacos2.4/nacos/target/nacos-server.jar  --spring.config.additional-location=file:/usr/local/nacos2.4/nacos/conf/ --logging.config=/usr/local/nacos2.4/nacos/conf/nacos-logback.xml --server.max-http-header-size=524288

         ,--.
       ,--.'|
   ,--,:  : |                                           Nacos 2.0.4
,`--.'`|  ' :                       ,---.               Running in stand alone mode, All function modules
|   :  :  | |                      '   ,'\   .--.--.    Port: 8848
:   |   \ | :  ,--.--.     ,---.  /   /   | /  /    '   Pid: 26526
|   : '  '; | /       \   /     \.   ; ,. :|  :  /`./   Console: http://172.18.117.101:8848/nacos/index.html
'   ' ;.    ;.--.  .-. | /    / ''   | |: :|  :  ;_
|   | | \   | \__\/: . ..    ' / '   | .; : \  \    `.      https://nacos.io
'   : |  ; .' ," .--.; |'   ; :__|   :    |  `----.   \
|   | '`--'  /  /  ,.  |'   | '.'|\   \  /  /  /`--'  /
'   : |     ;  :   .'   \   :    : `----'  '--'.     /
;   |.'     |  ,     .-./\   \  /            `--'---'
'---'        `--`---'     `----'

2022-03-10 21:06:16,113 INFO Bean 'org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler@7d61eccf' 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)

2022-03-10 21:06:16,453 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)

2022-03-10 21:06:36,157 INFO Tomcat initialized with port(s): 8848 (http)

2022-03-10 21:06:51,269 INFO Root WebApplicationContext: initialization completed in 185710 ms

2022-03-10 21:09:30,297 INFO Initializing ExecutorService 'applicationTaskExecutor'

2022-03-10 21:09:36,976 INFO Adding welcome page: class path resource [static/index.html]

2022-03-10 21:09:54,831 INFO Creating filter chain: Ant [pattern='/**'], []

2022-03-10 21:09:56,595 INFO Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@6d2dc9d2, org.springframework.security.web.context.SecurityContextPersistenceFilter@2eaef76d, org.springframework.security.web.header.HeaderWriterFilter@22590e3e, org.springframework.security.web.csrf.CsrfFilter@3491e86e, org.springframework.security.web.authentication.logout.LogoutFilter@56681eaf, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@34819867, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@771d1ffb, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@1da4b6b3, org.springframework.security.web.session.SessionManagementFilter@5f780a86, org.springframework.security.web.access.ExceptionTranslationFilter@409986fe]

2022-03-10 21:10:01,146 INFO Initializing ExecutorService 'taskScheduler'

2022-03-10 21:10:02,258 INFO Exposing 16 endpoint(s) beneath base path '/actuator'

2022-03-10 21:10:07,529 INFO Tomcat started on port(s): 8848 (http) with context path '/nacos'

2022-03-10 21:10:07,871 INFO Nacos started successfully in stand alone mode. use external storage

2022-03-11 09:39:19,192 INFO Initializing Servlet 'dispatcherServlet'

2022-03-11 09:39:19,706 INFO Completed initialization in 514 ms

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值