cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alireza Eskandari <astro.alir...@gmail.com>
Subject Re: No database selected for the transaction
Date Tue, 21 Nov 2017 09:58:19 GMT
I should say that I'm using a cluster of MariaDB on Galera with 3
nodes. All of them are master but I'm using one node at a time by
assign a virtual IP to it.
Here is db.properties on node1:

# management server clustering parameters, change cluster.node.IP to
the machine IP address
# in which the management server(Tomcat) is running
cluster.node.IP=172.17.60.31
cluster.servlet.port=9090
region.id=1

# CloudStack database settings
db.cloud.username=cloud
db.cloud.password=ENC(<db.cloud.password>)
db.cloud.host=csdb-cltr01.cloud.local
db.cloud.driver=jdbc:mysql
db.cloud.port=3306
db.cloud.name=cloud

# CloudStack database tuning parameters
db.cloud.maxActive=250
db.cloud.maxIdle=30
db.cloud.maxWait=10000
db.cloud.validationQuery=SELECT 1
db.cloud.testOnBorrow=true
db.cloud.testWhileIdle=true
db.cloud.timeBetweenEvictionRunsMillis=40000
db.cloud.minEvictableIdleTimeMillis=240000
db.cloud.poolPreparedStatements=false
db.cloud.url.params=prepStmtCacheSize=517&cachePrepStmts=true&sessionVariables=sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'

# CloudStack database SSL settings
db.cloud.useSSL=true
db.cloud.keyStore=/etc/ssl/certs/mariadb/clst01.keystore
db.cloud.keyStorePassword=<keyStorePassword>
db.cloud.trustStore=/etc/ssl/certs/mariadb/clst.truststore
db.cloud.trustStorePassword=<trustStorePassword>
db.cloud.keyStorePassphrase=vmops.com

# Encryption Settings
db.cloud.encryption.type=file
db.cloud.encrypt.secret=ENC(<db.cloud.encrypt.secret>)

# usage database settings
db.usage.username=cloud
db.usage.password=ENC(<db.usage.password>)
db.usage.host=csdb-cltr01.cloud.local
db.usage.driver=jdbc:mysql
db.usage.port=3306
db.usage.name=cloud_usage

# usage database tuning parameters
db.usage.maxActive=100
db.usage.maxIdle=30
db.usage.maxWait=10000
db.usage.url.params=

# Simulator database settings
db.simulator.username=cloud
db.simulator.password=cloud
db.simulator.host=localhost
db.simulator.driver=jdbc:mysql
db.simulator.port=3306
db.simulator.name=simulator
db.simulator.maxActive=250
db.simulator.maxIdle=30
db.simulator.maxWait=10000
db.simulator.autoReconnect=true


# High Availability And Cluster Properties
db.ha.enabled=false
db.ha.loadBalanceStrategy=com.cloud.utils.db.StaticStrategy
# cloud stack Database
db.cloud.slaves=localhost,localhost
db.cloud.autoReconnect=true
db.cloud.failOverReadOnly=false
db.cloud.reconnectAtTxEnd=true
db.cloud.autoReconnectForPools=true
db.cloud.secondsBeforeRetryMaster=3600
db.cloud.queriesBeforeRetryMaster=5000
db.cloud.initialTimeout=3600

#usage Database
db.usage.slaves=localhost,localhost
db.usage.autoReconnect=true
db.usage.failOverReadOnly=false
db.usage.reconnectAtTxEnd=true
db.usage.autoReconnectForPools=true
db.usage.secondsBeforeRetryMaster=3600
db.usage.queriesBeforeRetryMaster=5000
db.usage.initialTimeout=3600

On Tue, Nov 21, 2017 at 12:46 PM, Rohit Yadav <rohit.yadav@shapeblue.com> wrote:
> Alireza,
>
>
> Can you share your db.properties file (you may replace password/ips with dummy ones)?
>
>
> - Rohit
>
> ________________________________
> From: Ivan Kudryavtsev <kudryavtsev_ia@bw-sw.com>
> Sent: Tuesday, November 21, 2017 2:32:50 PM
> To: dev@cloudstack.apache.org
> Subject: Re: No database selected for the transaction
>
> Also, have seen that with 4.10 with two management servers on one of them.
>
> 21 нояб. 2017 г. 3:36 ПП пользователь "Alireza Eskandari" <
> astro.alireza@gmail.com> написал:
>
>> Hi all,
>> I'm using a cluster of CS 4.9.3 with 2 nodes.
>> After couple of weeks, I get "No database selected for the
>> transaction" error in logs and I have to restart the CS services to
>> resolve the issue.
>> Could you help me about it?
>>
>> Here is the logs:
>>
>> 2017-11-21 10:37:35,641 WARN  [c.c.c.d.ManagementServerHostDaoImpl]
>> (Cluster-Heartbeat-1:ctx-a32c78be) (logid:c9227f75) Unexpected
>> exception,
>> com.cloud.utils.exception.CloudRuntimeException: No database selected
>> for the transaction
>>         at com.cloud.utils.db.TransactionLegacy.getConnection(
>> TransactionLegacy.java:580)
>>         at com.cloud.utils.db.TransactionLegacy.prepareStatement(
>> TransactionLegacy.java:467)
>>         at com.cloud.utils.db.TransactionLegacy.prepareAutoCloseStatement(
>> TransactionLegacy.java:460)
>>         at com.cloud.cluster.dao.ManagementServerHostDaoImpl.update(
>> ManagementServerHostDaoImpl.java:134)
>>         at sun.reflect.GeneratedMethodAccessor76.invoke(Unknown Source)
>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(
>> DelegatingMethodAccessorImpl.java:43)
>>         at java.lang.reflect.Method.invoke(Method.java:606)
>>         at org.springframework.aop.support.AopUtils.
>> invokeJoinpointUsingReflection(AopUtils.java:317)
>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.
>> invokeJoinpoint(ReflectiveMethodInvocation.java:183)
>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.
>> proceed(ReflectiveMethodInvocation.java:150)
>>         at com.cloud.utils.db.TransactionContextInterceptor.invoke(
>> TransactionContextInterceptor.java:34)
>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.
>> proceed(ReflectiveMethodInvocation.java:161)
>>         at org.springframework.aop.interceptor.
>> ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.
>> proceed(ReflectiveMethodInvocation.java:172)
>>         at org.springframework.aop.framework.JdkDynamicAopProxy.
>> invoke(JdkDynamicAopProxy.java:204)
>>         at com.sun.proxy.$Proxy201.update(Unknown Source)
>>         at com.cloud.cluster.ClusterManagerImpl$4.runInContext(
>> ClusterManagerImpl.java:554)
>>         at org.apache.cloudstack.managed.context.
>> ManagedContextRunnable$1.run(ManagedContextRunnable.java:49)
>>         at org.apache.cloudstack.managed.context.impl.
>> DefaultManagedContext$1.call(DefaultManagedContext.java:56)
>>         at org.apache.cloudstack.managed.context.impl.
>> DefaultManagedContext.callWithContext(DefaultManagedContext.java:103)
>>         at org.apache.cloudstack.managed.context.impl.
>> DefaultManagedContext.runWithContext(DefaultManagedContext.java:53)
>>         at org.apache.cloudstack.managed.context.
>> ManagedContextRunnable.run(ManagedContextRunnable.java:46)
>>         at java.util.concurrent.Executors$RunnableAdapter.
>> call(Executors.java:473)
>>         at java.util.concurrent.FutureTask.runAndReset(
>> FutureTask.java:304)
>>         at java.util.concurrent.ScheduledThreadPoolExecutor$
>> ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
>>         at java.util.concurrent.ScheduledThreadPoolExecutor$
>> ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
>>         at java.util.concurrent.ThreadPoolExecutor.runWorker(
>> ThreadPoolExecutor.java:1152)
>>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(
>> ThreadPoolExecutor.java:622)
>>         at java.lang.Thread.run(Thread.java:748)
>> 2017-11-21 10:37:35,641 ERROR [c.c.c.ClusterManagerImpl]
>> (Cluster-Heartbeat-1:ctx-a32c78be) (logid:c9227f75) Unexpected
>> exception in cluster heartbeat
>> java.lang.RuntimeException: No database selected for the transaction
>>         at com.cloud.cluster.dao.ManagementServerHostDaoImpl.update(
>> ManagementServerHostDaoImpl.java:148)
>>         at sun.reflect.GeneratedMethodAccessor76.invoke(Unknown Source)
>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(
>> DelegatingMethodAccessorImpl.java:43)
>>         at java.lang.reflect.Method.invoke(Method.java:606)
>>         at org.springframework.aop.support.AopUtils.
>> invokeJoinpointUsingReflection(AopUtils.java:317)
>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.
>> invokeJoinpoint(ReflectiveMethodInvocation.java:183)
>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.
>> proceed(ReflectiveMethodInvocation.java:150)
>>         at com.cloud.utils.db.TransactionContextInterceptor.invoke(
>> TransactionContextInterceptor.java:34)
>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.
>> proceed(ReflectiveMethodInvocation.java:161)
>>         at org.springframework.aop.interceptor.
>> ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
>>         at org.springframework.aop.framework.ReflectiveMethodInvocation.
>> proceed(ReflectiveMethodInvocation.java:172)
>>         at org.springframework.aop.framework.JdkDynamicAopProxy.
>> invoke(JdkDynamicAopProxy.java:204)
>>         at com.sun.proxy.$Proxy201.update(Unknown Source)
>>         at com.cloud.cluster.ClusterManagerImpl$4.runInContext(
>> ClusterManagerImpl.java:554)
>>         at org.apache.cloudstack.managed.context.
>> ManagedContextRunnable$1.run(ManagedContextRunnable.java:49)
>>         at org.apache.cloudstack.managed.context.impl.
>> DefaultManagedContext$1.call(DefaultManagedContext.java:56)
>>         at org.apache.cloudstack.managed.context.impl.
>> DefaultManagedContext.callWithContext(DefaultManagedContext.java:103)
>>         at org.apache.cloudstack.managed.context.impl.
>> DefaultManagedContext.runWithContext(DefaultManagedContext.java:53)
>>         at org.apache.cloudstack.managed.context.
>> ManagedContextRunnable.run(ManagedContextRunnable.java:46)
>>         at java.util.concurrent.Executors$RunnableAdapter.
>> call(Executors.java:473)
>>         at java.util.concurrent.FutureTask.runAndReset(
>> FutureTask.java:304)
>>         at java.util.concurrent.ScheduledThreadPoolExecutor$
>> ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
>>         at java.util.concurrent.ScheduledThreadPoolExecutor$
>> ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
>>         at java.util.concurrent.ThreadPoolExecutor.runWorker(
>> ThreadPoolExecutor.java:1152)
>>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(
>> ThreadPoolExecutor.java:622)
>>         at java.lang.Thread.run(Thread.java:748)
>> Caused by: com.cloud.utils.exception.CloudRuntimeException: No
>> database selected for the transaction
>>         at com.cloud.utils.db.TransactionLegacy.getConnection(
>> TransactionLegacy.java:580)
>>         at com.cloud.utils.db.TransactionLegacy.prepareStatement(
>> TransactionLegacy.java:467)
>>         at com.cloud.utils.db.TransactionLegacy.prepareAutoCloseStatement(
>> TransactionLegacy.java:460)
>>         ... 26 more
>>
>
> rohit.yadav@shapeblue.com
> www.shapeblue.com
> 53 Chandos Place, Covent Garden, London  WC2N 4HSUK
> @shapeblue
>
>
>

Mime
View raw message