Giriş
Şu satırı dahil ederiz
import com.hazelcast.config.KubernetesConfig;setProperty metodu
namespace ve service-name değerlerini atamak gerekir
Örnek
Şöyle yaparız
Config config = getCommonConfig(); JoinConfig joinConfig = config.getNetworkConfig().getJoin(); joinConfig.getMulticastConfig().setEnabled(false); joinConfig.getKubernetesConfig().setEnabled(true) .setProperty("namespace", namespace) .setProperty("service-name", service);
Örnek
Şöyle yaparız
Config config = new Config(); JoinConfig joinConfig = config.getNetworkConfig().getJoin(); joinConfig.getTcpIpConfig().setEnabled(false); joinConfig.getMulticastConfig().setEnabled(false); config .setClusterName("hz-example") .getNetworkConfig() .setPort(5701) .addOutboundPortDefinition("20000-30000") .getJoin() .getKubernetesConfig() .setEnabled(true) .setProperty("namespace", "example_ns") .setProperty("service-name", "example_service") .setProperty("service-port", "5701");
Hiç yorum yok:
Yorum Gönder