Search in sources :

Example 51 with LoadBalancerConfiguration

use of org.mobicents.tools.configuration.LoadBalancerConfiguration in project load-balancer by RestComm.

the class HttpRedirectionTest method initialization.

@BeforeClass
public static void initialization() {
    balancerRunner = new BalancerRunner();
    LoadBalancerConfiguration lbConfig = new LoadBalancerConfiguration();
    lbConfig.getSipConfiguration().getInternalLegConfiguration().setTcpPort(5065);
    lbConfig.getSipConfiguration().getExternalLegConfiguration().setTcpPort(5060);
    lbConfig.getHttpConfiguration().setHttpsPort(2081);
    lbConfig.getSslConfiguration().setKeyStore(HttpsBalancerWithHttpsServerTest.class.getClassLoader().getResource("keystore").getFile());
    lbConfig.getSslConfiguration().setKeyStorePassword("123456");
    lbConfig.getSslConfiguration().setTrustStore(HttpsBalancerWithHttpsServerTest.class.getClassLoader().getResource("keystore").getFile());
    lbConfig.getSslConfiguration().setTrustStorePassword("123456");
    balancerRunner.start(lbConfig);
    serverArray = new HttpServer[numberNodes];
    for (int i = 0; i < numberNodes; i++) {
        serverArray[i] = new HttpServer(7080 + i, 4444 + i, 2222 + i);
        serverArray[i].start();
        Helper.sleep(1000);
    }
    Helper.sleep(5000);
}
Also used : BalancerRunner(org.mobicents.tools.sip.balancer.BalancerRunner) LoadBalancerConfiguration(org.mobicents.tools.configuration.LoadBalancerConfiguration) BeforeClass(org.junit.BeforeClass)

Example 52 with LoadBalancerConfiguration

use of org.mobicents.tools.configuration.LoadBalancerConfiguration in project load-balancer by RestComm.

the class HttpStatisticTest method initialization.

@BeforeClass
public static void initialization() {
    balancerRunner = new BalancerRunner();
    LoadBalancerConfiguration lbConfig = new LoadBalancerConfiguration();
    lbConfig.getSipConfiguration().getInternalLegConfiguration().setUdpPort(5065);
    balancerRunner.start(lbConfig);
    serverArray = new HttpServer[numberNodes];
    for (int i = 0; i < numberNodes; i++) {
        serverArray[i] = new HttpServer(7080 + i, 4444 + i, 2222 + i);
        serverArray[i].start();
        Helper.sleep(1000);
    }
    Helper.sleep(5000);
}
Also used : BalancerRunner(org.mobicents.tools.sip.balancer.BalancerRunner) LoadBalancerConfiguration(org.mobicents.tools.configuration.LoadBalancerConfiguration) BeforeClass(org.junit.BeforeClass)

Example 53 with LoadBalancerConfiguration

use of org.mobicents.tools.configuration.LoadBalancerConfiguration in project load-balancer by RestComm.

the class HttpsBalancerWithHttpServerTest method initialization.

@BeforeClass
public static void initialization() {
    balancerRunner = new BalancerRunner();
    LoadBalancerConfiguration lbConfig = new LoadBalancerConfiguration();
    lbConfig.getSipConfiguration().getInternalLegConfiguration().setUdpPort(5065);
    lbConfig.getHttpConfiguration().setHttpsPort(2085);
    lbConfig.getSslConfiguration().setKeyStore(HttpsBalancerWithHttpsServerTest.class.getClassLoader().getResource("keystore").getFile());
    lbConfig.getSslConfiguration().setKeyStorePassword("123456");
    lbConfig.getSslConfiguration().setTrustStore(HttpsBalancerWithHttpsServerTest.class.getClassLoader().getResource("keystore").getFile());
    lbConfig.getSslConfiguration().setTrustStorePassword("123456");
    lbConfig.getSslConfiguration().setTerminateTLSTraffic(true);
    lbConfig.getSslConfiguration().setTlsClientProtocols("TLSv1,TLSv1.1,TLSv1.2");
    lbConfig.getSslConfiguration().setEnabledCipherSuites("TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA,TLS_DHE_RSA_WITH_AES_128_CBC_SHA");
    balancerRunner.start(lbConfig);
    serverArray = new HttpServer[numberNodes];
    for (int i = 0; i < serverArray.length; i++) {
        serverArray[i] = new HttpServer(7080 + i, 4444 + i, 2222 + i);
        serverArray[i].start();
        Helper.sleep(1000);
    }
    Helper.sleep(5000);
}
Also used : BalancerRunner(org.mobicents.tools.sip.balancer.BalancerRunner) LoadBalancerConfiguration(org.mobicents.tools.configuration.LoadBalancerConfiguration) BeforeClass(org.junit.BeforeClass)

Example 54 with LoadBalancerConfiguration

use of org.mobicents.tools.configuration.LoadBalancerConfiguration in project load-balancer by RestComm.

the class NodeGracefulShutdownRmiTest method setUp.

@Before
public void setUp() throws Exception {
    shootist1 = new Shootist(ListeningPoint.TCP, 5060, 5033);
    shootist2 = new Shootist(ListeningPoint.TCP, 5060, 5034);
    balancer = new BalancerRunner();
    LoadBalancerConfiguration lbConfig = new LoadBalancerConfiguration();
    lbConfig.getSipConfiguration().getExternalLegConfiguration().setUdpPort(5060);
    lbConfig.getSipConfiguration().getInternalLegConfiguration().setTcpPort(5065);
    lbConfig.getSipConfiguration().getAlgorithmConfiguration().setAlgorithmClass(UserBasedAlgorithm.class.getCanonicalName());
    lbConfig.getSipConfiguration().getAlgorithmConfiguration().setSipHeaderAffinityKey("To");
    HeartbeatConfig heartbeatConfig = new HeartbeatConfigRmi();
    lbConfig.setHeartbeatConfiguration(heartbeatConfig);
    balancer.start(lbConfig);
    for (int q = 0; q < servers.length; q++) {
        servers[q] = new AppServerWithRmi("node" + q, 4060 + q, "127.0.0.1", 2000, 5060, 5065, "0", ListeningPoint.TCP);
        servers[q].start();
    }
    Thread.sleep(2000);
}
Also used : HeartbeatConfig(org.mobicents.tools.heartbeat.api.HeartbeatConfig) HeartbeatConfigRmi(org.mobicents.tools.heartbeat.rmi.HeartbeatConfigRmi) BalancerRunner(org.mobicents.tools.sip.balancer.BalancerRunner) LoadBalancerConfiguration(org.mobicents.tools.configuration.LoadBalancerConfiguration) Shootist(org.mobicents.tools.sip.balancer.operation.Shootist) ListeningPoint(javax.sip.ListeningPoint) Before(org.junit.Before)

Example 55 with LoadBalancerConfiguration

use of org.mobicents.tools.configuration.LoadBalancerConfiguration in project load-balancer by RestComm.

the class NodeGracefulShutdownTest method setUp.

@Before
public void setUp() throws Exception {
    shootist1 = new Shootist(ListeningPoint.TCP, 5060, 5033);
    shootist2 = new Shootist(ListeningPoint.TCP, 5060, 5034);
    balancer = new BalancerRunner();
    LoadBalancerConfiguration lbConfig = new LoadBalancerConfiguration();
    lbConfig.getSipConfiguration().getExternalLegConfiguration().setUdpPort(5060);
    lbConfig.getSipConfiguration().getInternalLegConfiguration().setTcpPort(5065);
    lbConfig.getSipConfiguration().getAlgorithmConfiguration().setAlgorithmClass(UserBasedAlgorithm.class.getCanonicalName());
    lbConfig.getSipConfiguration().getAlgorithmConfiguration().setSipHeaderAffinityKey("To");
    balancer.start(lbConfig);
    for (int q = 0; q < servers.length; q++) {
        servers[q] = new AppServer("node" + q, 4060 + q, "127.0.0.1", 2000, 5060, 5065, "0", ListeningPoint.TCP, 2222 + q);
        servers[q].start();
        Thread.sleep(1000);
    }
    Thread.sleep(5000);
}
Also used : AppServer(org.mobicents.tools.sip.balancer.AppServer) BalancerRunner(org.mobicents.tools.sip.balancer.BalancerRunner) LoadBalancerConfiguration(org.mobicents.tools.configuration.LoadBalancerConfiguration) Shootist(org.mobicents.tools.sip.balancer.operation.Shootist) ListeningPoint(javax.sip.ListeningPoint) Before(org.junit.Before)

Aggregations

LoadBalancerConfiguration (org.mobicents.tools.configuration.LoadBalancerConfiguration)64 BalancerRunner (org.mobicents.tools.sip.balancer.BalancerRunner)50 ListeningPoint (javax.sip.ListeningPoint)28 Shootist (org.mobicents.tools.sip.balancer.operation.Shootist)28 Before (org.junit.Before)26 AppServer (org.mobicents.tools.sip.balancer.AppServer)24 BeforeClass (org.junit.BeforeClass)15 WorstCaseUdpTestAffinityAlgorithm (org.mobicents.tools.sip.balancer.WorstCaseUdpTestAffinityAlgorithm)8 ArrayList (java.util.ArrayList)7 UserBasedAlgorithm (org.mobicents.tools.sip.balancer.UserBasedAlgorithm)6 Test (org.junit.Test)5 HeartbeatConfigHttp (org.mobicents.tools.heartbeat.impl.HeartbeatConfigHttp)5 HeaderConsistentHashBalancerAlgorithm (org.mobicents.tools.sip.balancer.HeaderConsistentHashBalancerAlgorithm)5 SinglePointTest (org.mobicents.tools.sip.balancer.SinglePointTest)4 SmppToNodeSubmitToAllAlgorithm (org.mobicents.tools.smpp.multiplexer.SmppToNodeSubmitToAllAlgorithm)4 DefaultSmppServer (com.cloudhopper.smpp.impl.DefaultSmppServer)3 SmppChannelException (com.cloudhopper.smpp.type.SmppChannelException)3 CongestionControlMessageValve (org.mobicents.ext.javax.sip.congestion.CongestionControlMessageValve)2 HeartbeatConfig (org.mobicents.tools.heartbeat.api.HeartbeatConfig)2 Node (org.mobicents.tools.heartbeat.api.Node)2