【发布时间】:2018-09-13 00:42:15
【问题描述】:
我正在使用 Ignite 2.5 并且已经部署了几个这样的服务器:
- 一台计算机充当启用持久性的 DB 服务器。
- 其他三台计算机是计算服务器,具有与 DB 服务器上相同的缓存,但没有持久性。
我有这样的课程:
public class Address implements Serializable
{
String streetName;
String houseNumber;
String cityName;
String countryName;
}
public class Person implements Serializable
{
@QuerySqlField
String firstName;
@QuerySqlField
String lastName;
@QuerySqlField
Address homeAddress;
}
在所有服务器上都使用此 XML 配置缓存:
<bean class="org.apache.ignite.configuration.CacheConfiguration">
<property name="name" value="Persons" />
<property name="cacheMode" value="PARTITIONED" />
<property name="backups" value="0" />
<property name="storeKeepBinary" value="true" />
<property name="atomicityMode" value="TRANSACTIONAL"/>
<property name="writeSynchronizationMode" value="FULL_SYNC"/>
<property name="indexedTypes">
<list>
<value>java.lang.String</value>
<value>Person</value>
</list>
</property>
</bean>
在数据库服务器上,另外还有这样启用的持久性:
<property name="dataStorageConfiguration">
<bean class="org.apache.ignite.configuration.DataStorageConfiguration">
<property name="storagePath" value="/data/Storage" />
<property name="walPath" value="/data/Wal" />
<property name="walArchivePath" value="/data/WalArchive" />
<property name="defaultDataRegionConfiguration">
<bean class="org.apache.ignite.configuration.DataRegionConfiguration">
<property name="initialSize" value="536870912" />
<property name="maxSize" value="1073741824" />
<property name="persistenceEnabled" value="true" />
</bean>
</property>
</bean>
</property>
<property name="binaryConfiguration">
<bean class="org.apache.ignite.configuration.BinaryConfiguration">
<property name="compactFooter" value="false" />
</bean>
</property>
缓存与 put/get 一起使用,但也与 SqlQuery 和 SqlFieldsQuery 一起使用。
有时我必须更新类定义,即添加另一个字段左右。我可以关闭整个集群以更新类,因为它无论如何都需要更新应用程序。
- 我相信上述配置通常可以用于 Ignite?
- 我是否正确理解了另一个问题 (Apache Ignite persistent store recommended way for class versions),即在数据库服务器上,类路径中不应包含 Person 类?那么 XML 配置不会因为缺少索引类而失败吗?
- 在计算服务器上,我也不应该使用 Person 类,而是从缓存中读取到 BinaryObject?是否可以从 BinaryObject 手动填充我的 Person 类?
目前,当我更新 Person 类中的字段时,会出现以下奇怪的错误:
未知对 [platformId=0, typeId=1968448811]
对不起,如果这里有多个问题,我不知何故迷失了“未知对”问题,现在我质疑我的完整设置是否正确。
感谢您的建议。
【问题讨论】:
标签: ignite