我找到了問題的根源,通過內部AbstractCloudBeanPostprocessor的Cloud Foundry的插件的源代碼拖網後。用於填充指南針連接的方法不會檢查它是否是RAM索引,而是將其盲目地設置到磁盤上的某個位置。
/**
* Update the location of the Searchable Lucene index.
* @param beanFactory the Spring bean factory
* @param appConfig the application config
*/
protected void fixCompass(ConfigurableListableBeanFactory beanFactory, ConfigObject appConfig) {
def compassBean = beanFactory.getBeanDefinition('compass')
String indexLocation = getCompassIndexRootLocation(appConfig) + '/searchable-index'
appConfig.searchable.compassConnection = indexLocation
compassBean.propertyValues.addPropertyValue 'compassConnection', indexLocation
log.debug "Updated Compass connection details: $indexLocation"
}
我認爲這應該確實檢查是否存在RAM索引,並將其設置爲磁盤位置。一種可能的解決方法是創建我自己的BeanDefinitionRegistryPostProcessor並撤消雲代工插件的功能。
我不認爲CF可定製的搜索插件的配置。這只是一個上傳的圖書館。它會自動重新配置CF服務的數據源,比如MongoDB,MySQL,PostgreSQL等。你是否綁定了任何這樣的服務? –
那麼在雲代工插件文檔中有一些說它配置了Lucene索引(http://goo.gl/vRO5l-搜索'Searchable')。它可能是Cloud Foundry插件,也可能是Cloud Foundry本身。稍後我會通過刪除該插件來測試,因爲我不使用它。 – Olly
啊不等 - 我當然需要插件來做Mysql自動配置。所以我認爲這個問題出現在CloudFoundry Grails插件中。有任何想法嗎? – Olly