Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nacos启动derby异常连接超时 #4170

Closed
MarkBellCN opened this issue Nov 9, 2020 · 0 comments
Closed

nacos启动derby异常连接超时 #4170

MarkBellCN opened this issue Nov 9, 2020 · 0 comments
Labels
kind/enhancement Category issues or prs related to enhancement.
Milestone

Comments

@MarkBellCN
Copy link

MarkBellCN commented Nov 9, 2020

version 1.3.2
nacos与influxDB在一台服务器运行时,启动时infulxDB占用磁盘、服务器资源较高的情况下,nacos derby初始化数据文件会有失败的情况。失败之后只能删除nacos\data\derby。
建议增加容错机制或者将初始化连接时间可配置。
private synchronized void initialize(String jdbcUrl) {

HikariDataSource ds = new HikariDataSource();

ds.setDriverClassName(jdbcDriverName);

ds.setJdbcUrl(jdbcUrl);

ds.setUsername(userName);

ds.setPassword(password);

ds.setIdleTimeout(30_000L);

ds.setMaximumPoolSize(80);

ds.setConnectionTimeout(10000L);

DataSourceTransactionManager tm = new DataSourceTransactionManager();

tm.setDataSource(ds);

if (jdbcTemplateInit) {

jt.setDataSource(ds);

tjt.setTransactionManager(tm);

} else {

jt = new JdbcTemplate();

jt.setMaxRows(50000);

jt.setQueryTimeout(5000);

jt.setDataSource(ds);

tjt = new TransactionTemplate(tm);

tjt.setTimeout(5000);

jdbcTemplateInit = true;

}

reload();

}

@KomachiSion KomachiSion added the kind/enhancement Category issues or prs related to enhancement. label Nov 9, 2020
@KomachiSion KomachiSion added this to the 1.4.1 milestone Nov 9, 2020
KomachiSion added a commit to KomachiSion/nacos that referenced this issue Nov 9, 2020
KomachiSion added a commit that referenced this issue Nov 9, 2020
…red. (#4178)

* For #3607, #4078, #4170, Datasource pool configuration.

* Fix ci error.
penghao03 pushed a commit to penghao03/nacos that referenced this issue Nov 14, 2020
…ration can be configured. (alibaba#4178)

* For alibaba#3607, alibaba#4078, alibaba#4170, Datasource pool configuration.

* Fix ci error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Category issues or prs related to enhancement.
Projects
None yet
Development

No branches or pull requests

2 participants