2015-08-24 32 views

回答

0

請查看遠程安裝中的啓動腳本,例如$ GEMFIRE_HOME/bin /'gemfire'。看起來您可以將jar複製到每個緩存服務器可訪問的位置,並將CLASSPATH環境變量設置爲包含jar。話雖如此,使用gfsh可能更簡單也更可靠,特別是如果您有多個緩存服務器。

+0

我不知道它是如何完成的'gfsh'和是否可以在代碼中使用... – Vic

1

如果您想避免在本地安裝gfsh,可以使用REST協議與定位器通話。

gfsh可以配置爲將REST交談定位器。對於這一點,你必須使用的GemFire財產http-service-port: 8080啓動定位器,然後在連接到定位器從gfsh使用:

gfsh>connect --use-http 

現在,而不是gfsh,你可以捲曲你的罐子定位器(將隨後發送給所有的服務器)。

curl --fail -s [email protected]/path/to/your.jar http://locatorhost:port/gemfire/v1/deployed 

由於端點可能會發生變化,所以有關易碎的常見說明。

1

你可以找到所有github上的GemFire /的Geode源代碼:

https://github.com/apache/incubator-geode

參與了GFSH部署罐子類是:

  • com.gemstone.gemfire.management。 internal.cli.commands.DeployCommands
  • com.gemstone.gemfire.management.internal.cli.functions.DeployFunction
  • com.gems tone.gemfire.management.internal.cli.functions.UndeployFunction
  • com.gemstone.gemfire.management.internal.cli.functions.ListDeployedFunction

上述功能使用的做實際工作的情況如下:

  • com.gemstone.gemfire.internal.JarDeployer
  • com.gemstone.gemfire.internal.JarClassLoader

所以,喲理論上你可以使用JarDeployer和JarClassLoader編寫一些代碼。它們是內部類,因此它們是a)不是官方用戶/開發者API,b)可能會更改或被刪除。

相關問題