cloudstack-users-cn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "WXR" <474745...@qq.com>
Subject 回复:答复: 请问主存储的大小最大可以为多少?
Date Thu, 05 Sep 2013 15:23:43 GMT
由于我今天测试的环境不在我们自己公司,也没办法详细地查找问题原因。
今天我试了添加9T的主存储出现了这个问题,后来改为2T以后能够正常添加。
测试的环境中cloudstack版本是4.1.0,hypervisor是kvm。请问这是cloudstack的bug吗,一般在什么情况下会出现?是否有人成功添加过更大容量的主存储呢?




------------------ 原始邮件 ------------------
发件人: "陈珂";<chenke@ourfuture.cn>;
发送时间: 2013年9月5日(星期四) 下午3:50
收件人: "users-cn"<users-cn@cloudstack.apache.org>; 

主题: 答复: 请问主存储的大小最大可以为多少?



看着像是因为,程序内部是通过int数据类型保存的,当一个long长度的数据被强制转
换为int类型,而这个数值又大于int的最大值时,系统自动截取了低位,成为了负值。
如下程序
		long i=9829107105792l;
		System.out.println( (int)i);
		System.out.println(Long.toBinaryString(i));
		System.out.println(Integer.toBinaryString((int)i));
	
System.out.println(Integer.toBinaryString(Integer.MAX_VALUE));
------------------------------------
-2073034752
10001111000010000100011100000000000000000000
            10000100011100000000000000000000
             1111111111111111111111111111111
------------------------------------
这应该属于程序的问题,不是数据库的问题。




-----邮件原件-----
发件人: Bo Wang [mailto:brito.wang@gmail.com] 
发送时间: 2013年9月5日 14:37
收件人: users-cn@cloudstack.apache.org
主题: Re: 请问主存储的大小最大可以为多少?

我认为问题出在这里:

更新存储的时候 available_bytes=-184549376
注意后面是一个负数,字面理解应该是存储的“有效字节数”不应该是一个负数啊!况
且按照表结构的定义也是这样,该字段是无符号的bigint,其范围是0~
18446744073709551615




2013/9/5 WXR <474745079@qq.com>

>
> 今天我在添加一个9T(9829107105792)大小主存储时,出现报错,看提示是操作的
数字超过了storage_pool表的availab
> le_bytes字段的范围。
> 不过我看数据库里这个字段的类型是bigint,应该是能够表示足够大的范围。
> 请问cloudstack可以添加的主存储大小范围在多少呢,我遇到的这个问题是不是容量
大小超过限制导致的?
>
> --------------------------------
>
> 具体的日志内容如下:
> 2013-09-05 10:02:02,042 DEBUG [cloud.storage.StorageManagerImpl]
> (catalina-exec-10:null) Adding pool data to  host 11
> 2013-09-05 10:02:02,045 DEBUG [agent.transport.Request]
> (catalina-exec-10:null) Seq 11-926745485: Sending  { Cmd , MgmtId:
> 196039272834978, via: 11, Ver: v1, Flags: 100011, 
> [{"ModifyStoragePoolCommand":{"add":true,"pool":{"id":202,"uuid":"c9ce
> 60bb-6cb2-3531-b36a-ca122f3ef3db","host":"192.168.183.2","path":"/data
> ","port":2049,"type":"NetworkFilesystem"},"localPath":"/mnt//c9ce60bb-
> 6cb2-3531-b36a-ca122f3ef3db","wait":0}}]
> }
> 2013-09-05 10:02:02,350 DEBUG [agent.transport.Request]
> (AgentManager-Handler-12:null) Seq 11-926745485: Processing:  { Ans: ,
> MgmtId: 196039272834978, via: 11, Ver: v1, Flags: 10, 
> [{"ModifyStoragePoolAnswer":{"poolInfo":{"host":"192.168.183.2","local
> Path":"/mnt//c9ce60bb-6cb2-3531-b36a-ca122f3ef3db","hostPath":"/data",
> "poolType":"NetworkFilesystem","capacityBytes":9829107105792,"availabl
> eBytes":-184549376},"templateInfo":{},"result":true,"wait":0}}]
> }
> 2013-09-05 10:02:02,350 DEBUG [agent.transport.Request]
> (catalina-exec-10:null) Seq 11-926745485: Received:  { Ans: , MgmtId:
> 196039272834978, via: 11, Ver: v1, Flags: 10, { 
> ModifyStoragePoolAnswer } }
> 2013-09-05 10:02:02,399 DEBUG [db.Transaction.Transaction]
> (catalina-exec-10:null) Rolling back the transaction: Time = 2 Name =  
> update; called by
> -Transaction.rollback:890-Transaction.removeUpTo:833-Transaction.close
> :657-TransactionContextBuilder.interceptException:63-ComponentInstanti
> ationPostProcessor$InterceptorDispatcher.intercept:133-GenericDaoBase.
> update:775-ComponentInstantiationPostProcessor$InterceptorDispatcher.i
> ntercept:125-GenericDaoBase.update:1256-ComponentInstantiationPostProc
> essor$InterceptorDispatcher.intercept:125-StorageManagerImpl.connectHo
> stToSharedPool:1652-StorageManagerImpl.createPool:1402-StorageManagerI
> mpl.createPool:147
> 2013-09-05 10:02:02,400 WARN  [cloud.storage.StorageManagerImpl]
> (catalina-exec-10:null) Unable to establish a connection between 
> Host[-11-Routing] and Pool[202|NetworkFilesystem]
> com.cloud.utils.exception.CloudRuntimeException: DB Exception on:
> com.mysql.jdbc.JDBC4PreparedStatement@4bdade88: UPDATE storage_pool 
> SET storage_pool.available_bytes=-184549376,
> storage_pool.capacity_bytes=9829107105792 WHERE storage_pool.id = 202
>     at com.cloud.utils.db.GenericDaoBase.update(GenericDaoBase.java:822)
>     at
>
com.cloud.utils.component.ComponentInstantiationPostProcessor$InterceptorDis
patcher.intercept(ComponentInstantiationPostProcessor.java:125)
>     at com.cloud.utils.db.GenericDaoBase.update(GenericDaoBase.java:775)
>     at
>
com.cloud.utils.component.ComponentInstantiationPostProcessor$InterceptorDis
patcher.intercept(ComponentInstantiationPostProcessor.java:125)
>     at com.cloud.utils.db.GenericDaoBase.update(GenericDaoBase.java:1256)
>     at
>
com.cloud.utils.component.ComponentInstantiationPostProcessor$InterceptorDis
patcher.intercept(ComponentInstantiationPostProcessor.java:125)
>     at
>
com.cloud.storage.StorageManagerImpl.connectHostToSharedPool(StorageManagerI
mpl.java:1652)
>     at
>
com.cloud.storage.StorageManagerImpl.createPool(StorageManagerImpl.java:1402
)
>     at
>
com.cloud.storage.StorageManagerImpl.createPool(StorageManagerImpl.java:147)
>     at
>
org.apache.cloudstack.api.command.admin.storage.CreateStoragePoolCmd.execute
(CreateStoragePoolCmd.java:123)
>     at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:162)
>     at com.cloud.api.ApiServer.queueCommand(ApiServer.java:505)
>     at com.cloud.api.ApiServer.handleRequest(ApiServer.java:355)
>     at com.cloud.api.ApiServlet.processRequest(ApiServlet.java:302)
>     at com.cloud.api.ApiServlet.doGet(ApiServlet.java:66)
>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>     at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:290)
>     at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:206)
>     at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.
java:233)
>     at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.
java:191)
>     at
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127
)
>     at
>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102
)
>     at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:555)
>     at
>
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:109)
>     at
>
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
>     at
>
org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:
889)
>     at
>
org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(H
ttp11NioProtocol.java:721)
>     at
>
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:
2266)
>     at
>
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:11
10)
>     at
>
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:6
03)
>     at java.lang.Thread.run(Thread.java:679)
> Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Out of 
> range value for column 'available_bytes' at row 1
>     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4072)
>     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4006)
>     at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2468)
>     at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2629)
>     at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2719)
>     at
>
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155
)
>     at
>
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2450)
>     at
>
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2371)
>     at
>
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2355)
>     at
>
org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(Delegating
PreparedStatement.java:105)
>     at
>
org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(Delegating
PreparedStatement.java:105)
>     at com.cloud.utils.db.GenericDaoBase.update(GenericDaoBase.java:814)
>     ... 44 more
> 2013-09-05 10:02:02,402 WARN  [cloud.storage.StorageManagerImpl]
> (catalina-exec-10:null) No host can access storage pool 
> Pool[202|NetworkFilesystem] on cluster 1
> 2013-09-05 10:02:02,448 INFO  [cloud.api.ApiServer]
> (catalina-exec-10:null) Failed to add storage pool

.
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message