Dmitriy Pavlov created CLOUDSTACK-9284:
------------------------------------------
Summary: CloudStack usage service tries to get access to
"cloud.event_usage" table only via IP from cloud.usage.host field in
db.properties
Key: CLOUDSTACK-9284
URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9284
Project: CloudStack
Issue Type: Bug
Security Level: Public (Anyone can view this level - this is the default.)
Components: Usage
Affects Versions: 4.5.2, 4.2.1
Environment: OS - centos6
Reporter: Dmitriy Pavlov
Have tried to separate cloud and cloud_usage databases on two different
servers. db.properties file was updated in following way:
db.usage.host=IP_of_remote_server1
db.cloud.host=localhost
Database of cloud_usage was dumped from localhost and imported to the remote
mysql server. After that both services cloudstack-usage and
cloudstack-management were restarted. Both services started properly, but
during next usage running logs shown following error message:
com.cloud.utils.exception.CloudRuntimeException: SELECT command denied to user
'cloud'@'XX.XX.XX.XX' for table 'usage_event'
at
com.cloud.event.dao.UsageEventDaoImpl.getMaxEventId(UsageEventDaoImpl.java:209)
at
com.cloud.event.dao.UsageEventDaoImpl.getRecentEvents(UsageEventDaoImpl.java:101)
at
com.cloud.event.dao.UsageEventDaoImpl_EnhancerByCloudStack_c0063fe7.CGLIB$getRecentEvents$3(<generated>)
at
com.cloud.event.dao.UsageEventDaoImpl_EnhancerByCloudStack_c0063fe7_FastClassByCloudStack_48924ead.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at
com.cloud.utils.component.ComponentInstantiationPostProcessor$InterceptorDispatcher.intercept(ComponentInstantiationPostProcessor.java:122)
at
com.cloud.event.dao.UsageEventDaoImpl_EnhancerByCloudStack_c0063fe7.getRecentEvents(<generated>)
at com.cloud.usage.UsageManagerImpl.parse(UsageManagerImpl.java:582)
at
com.cloud.usage.UsageManagerImpl.runInContextInternal(UsageManagerImpl.java:376)
at
com.cloud.usage.UsageManagerImpl$1.runInContext(UsageManagerImpl.java:318)
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 com.cloud.usage.UsageManagerImpl.run(UsageManagerImpl.java:315)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
After mysql query logging was enabled I found that usage service was trying to
access cloud.usage_event table (from 'cloud' database, not cloud_usage) on the
remote mysql server where I want to keep only one database 'cloud_usage'. Same
error was reproduce on CS 4.2.1 and CS 4.5.2 versions.
The main question is why usage service tries to get information from 'cloud'
database using IP address which was configured in db.usage.host field in place
of db.cloud.host ?
Have posted this issue to user's mail list, but got only suggestion to place a
bug
http://mail-archives.apache.org/mod_mbox/cloudstack-users/201601.mbox/browser
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)