Java架构实践- Nacos部署中一些常见问题

问题一:Ubuntu下启动Nacos报错

问题描述

使用命令sh startup.sh -m standalone启动报错:

./startup.sh: 78: ./startup.sh:[[: not found./startup.sh: 88: ./startup.sh:[[: not found./startup.sh: 90: ./startup.sh:[[: not found./startup.sh: 96: ./startup.sh:[[: not found/usr/lib/jvm/java-8-openjdk-amd64/bin/java  -server -Xms2g -Xmx2g -Xmn1g -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m -XX:-OmitStackTraceInFastThrow -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/data/soft/nacos/logs/java_heapdump.hprof -XX:-UseLargePages -Djava.ext.dirs=/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext:/usr/lib/jvm/java-8-openjdk-amd64/lib/ext:/data/soft/nacos/plugins/cmdb:/data/soft/nacos/plugins/mysql -Xloggc:/data/soft/nacos/logs/nacos_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -Dnacos.home=/data/soft/nacos -jar/data/soft/nacos/target/nacos-server.jar  --spring.config.location=classpath:/,classpath:/config/,file:./,file:./config/,file:/data/soft/nacos/conf/--logging.config=/data/soft/nacos/conf/nacos-logback.xml./startup.sh: 116: ./startup.sh:[[: not foundnacos is starting,you can check the/data/nacos/logs/start.out

解决方法

改用命令bash -f ./startup.sh -m standalone启动

问题二:Failed to create database '/data/soft/nacos/data/derby-data'

问题描述

使用命令sh startup.sh -m standalone启动的时候,出现如下报错:

Caused by: java.lang.RuntimeException:loadschema.sql error.org.apache.commons.dbcp.SQLNestedException: CannotcreatePoolableConnectionFactory (Failedtocreatedatabase'/data/nacos/data/derby-data', see thenextexceptionfordetails.)atcom.alibaba.nacos.config.server.service.LocalDataSourceServiceImpl.reload(LocalDataSourceServiceImpl.java:110)atcom.alibaba.nacos.config.server.service.LocalDataSourceServiceImpl.init(LocalDataSourceServiceImpl.java:94)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)atjava.lang.reflect.Method.invoke(Method.java:498)atorg.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:363)atorg.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:307)atorg.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:136)    ...70common frames omitted

解决方法

删除报错信息中的'/data/nacos/data/derby-data'目录,重新启动。

需要获取海量最新BATJ视频资料加群:676279635 备注()

你可能感兴趣的:(Java架构实践- Nacos部署中一些常见问题)