第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

創(chuàng)建區(qū)域并將區(qū)域保留到磁盤時出現(xiàn)問題 Geode Gemfire Spring Boot

創(chuàng)建區(qū)域并將區(qū)域保留到磁盤時出現(xiàn)問題 Geode Gemfire Spring Boot

陪伴而非守候 2024-01-05 09:57:22
我觀看了 Springone Platform 和 John Blum 作為演講者的視頻,并有興趣嘗試一下 Geode/Gemfire 設(shè)置,但設(shè)置如Spring Data for Apache Geode 參考指南中所述所以我使用 Eclipse 制作 spring boot geode 客戶端、定位器和緩存服務(wù)器,并且在以下情況下遇到問題:啟動 spring locator,啟動緩存服務(wù)器,并使用 Restcontroller 啟動客戶端,以便我可以發(fā)布我的 POJO TitleContent 并獲取 TitleContent 列表。客戶給我異常原因:org.springframework.web.client.ResourceAccessException: I/O error on POST request for "https://localhost:7070/gemfire/v1/regions": Connection refused (Connection refused); nested exception is java.net.ConnectException: Connection refused (Connection refused)我注釋@EnableClusterConfiguration(useHttp=true)并再次啟動客戶端,現(xiàn)在可以運行了。現(xiàn)在我嘗試將 POJO 發(fā)布到我的 Restcontroller 并得到此異常:2019-10-29 09:43:08.193 ERROR 57276 --- [io-15050-exec-1] oaccC[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] 在上下文中path[]拋出異常[請求處理失敗;嵌套異常是 org.springframework.dao.DataAccessResourceFailureException: Remote server on 192.168.100.8(SpringBasedCacheClientApplication:57276:loner):64494:51246215:SpringBasedCacheClientApplication: : 執(zhí)行遠程放置時;嵌套異常是 org.apache.geode.cache.client.ServerOperationException: 192.168.100.8(SpringBasedCacheClientApplication:57276:loner):64494:51246215:SpringBasedCacheClientApplication: 上的遠程服務(wù)器::執(zhí)行遠程放置時],其根本原因org.apache.geode.cache.RegionDestroyedException:來自 [identity(192.168.100.8(SpringBasedCacheClientApplication:57276:loner):64494:51246215:SpringBasedCacheClientApplication,connection=1; port=64498] 的服務(wù)器連接:期間未找到名為 /TitleContent 的區(qū)域?qū)⒄埱蠓旁?org.apache.geode.internal.cache.tier.sockets.BaseCommand.writeRegionDestroyedEx(BaseCommand.java:624) ~[geode-core-1.9.1.jar:na] 處?這次我取消了 //@EnableClusterConfiguration(useHttp=true) 的注釋,但我刪除了 useHttp 并僅使用 @EnableClusterConfiguration,(因此我懷疑錯誤)。我停止 Spring Client 并再次啟動它?,F(xiàn)在它失敗了,并顯示:org.apache.geode.cache.RegionExistsException:/TitleContent。
查看完整描述

1 回答

?
慕森卡

TA貢獻1806條經(jīng)驗 獲得超8個贊

在我的例子中,我絕對不能使用@EnableClusterConfiguration(仍然想知道為什么)。根據(jù) John 的說法,我們可以使用 gfsh 創(chuàng)建區(qū)域。由此我想到在 Spring Boot CacheServer 上做同樣的事情。那么,如果我在 CacheServer 定義 POJO 并讓注釋 @EnableEntityDefinedRegions 完成在 CacheServer 端創(chuàng)建區(qū)域的工作,該怎么辦?我又借了

serverRegionShortcut = RegionShortcut.PARTITION_PERSISTENT

來自約翰,但我把它放在

@EnableEntityDefinedRegions

除此之外,我還需要保留我的 PDX 類型(如果我不在 CacheServer 端保留 Pdx 類型,Spring 和/或 Geode Gemfire 不喜歡我)。因此,我使用相同的方法從SpringData Gemfire DiskStore進行持久化,但我在 CacheServer 端實現(xiàn)它,并在 application.properties 中添加一些附加條目來告訴 spring 也持久化 Pdx 類型。

這樣,我就能夠在 CacheServer 端成功創(chuàng)建和持久化 Region,并且還能夠持久化 Pdx。

這是我借用SpringData Gemfire DiskStore的想法制作的完整代碼和 application.properties 。

如果有人能夠告訴我這個解決方法是否是一個好方法,或者是否有其他方法或更好的想法(仍然想知道為什么 @EnableClusterConfiguration 不喜歡我,而其他人對此沒有問題:= (所以,如果有人能夠告訴我我的錯誤在哪里,我真的很感激)。

客戶 :

@SpringBootApplication

@ClientCacheApplication(logLevel = "debug", locators = {@Locator(host = "localhost", port = 10334)})

@EnablePool(name="neptunusPool", servers=@Server(host="localhost", port=41414))

@EnableGemfireRepositories(basePackageClasses= {TitleContentRepository.class})

@EnableEntityDefinedRegions(basePackageClasses= {TitleContent.class

})

//@ReplicateRegion

//@EnableClusterDefinedRegions

//@EnableCachingDefinedRegions

//@EnableGemfireCaching

@EnableIndexing

//@EnableClusterConfiguration

@EnablePdx


public class CommerceHostGeodeApplication {


? ? public static void main(String[] args) {


? ? ? ? SpringApplication.run(CommerceHostGeodeApplication.class, args);


? ? }


}

在客戶端,相同的 POJO、Repository 和 RestController,除了 server.port 定義之外,application.properties 中沒有任何內(nèi)容。


緩存服務(wù)器:


@SpringBootApplication

@CacheServerApplication(locators="localhost[10334]", name="GeodeServerApplication" )

@EnableCacheServer(name="neptunus", autoStartup=true, hostnameForClients = "localhost", port = 41414)

@EnableCachingDefinedRegions

@EnableGemfireCaching

@EnablePdx

@EnableManager

@EnableHttpService

@EnableDiskStore(name = "disk_store")

@EnableEntityDefinedRegions(basePackageClasses= {TitleContent.class

}, serverRegionShortcut = RegionShortcut.PARTITION_PERSISTENT)

public class GeodeServerApplication {


? ? public static void main(String[] args) {

? ? ? ? SpringApplication.run(GeodeServerApplication.class, args);

? ? }


}

CACHESERVER application.properties :


server.port=15010

spring.data.gemfire.disk.store.name=disk_store

spring.data.gemfire.disk.store.directory.location=/Users/ars/geode/data

spring.data.gemfire.pdx.disk-store-name=disk_store

spring.data.gemfire.pdx.persistent=true

spring.data.gemfire.management.use-http=true

CacheServer 啟動后,區(qū)域?qū)⒈粍?chuàng)建并能夠持久/保存到磁盤。


查看完整回答
反對 回復(fù) 2024-01-05
  • 1 回答
  • 0 關(guān)注
  • 161 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號