Search in sources :

Example 66 with BalancerRunner

use of org.mobicents.tools.sip.balancer.BalancerRunner in project load-balancer by RestComm.

the class ChunkResponseTest method initialization.

@BeforeClass
public static void initialization() {
    server = new HttpServer(8080, 4444, 2222);
    server.setChunkedresponse(true);
    server.start();
    balancerRunner = new BalancerRunner();
    LoadBalancerConfiguration lbConfig = new LoadBalancerConfiguration();
    lbConfig.getSipConfiguration().getInternalLegConfiguration().setTcpPort(5065);
    lbConfig.getSipConfiguration().getExternalLegConfiguration().setTcpPort(5060);
    balancerRunner.start(lbConfig);
    try {
        Thread.sleep(1000);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
}
Also used : BalancerRunner(org.mobicents.tools.sip.balancer.BalancerRunner) LoadBalancerConfiguration(org.mobicents.tools.configuration.LoadBalancerConfiguration) BeforeClass(org.junit.BeforeClass)

Example 67 with BalancerRunner

use of org.mobicents.tools.sip.balancer.BalancerRunner 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 68 with BalancerRunner

use of org.mobicents.tools.sip.balancer.BalancerRunner 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 69 with BalancerRunner

use of org.mobicents.tools.sip.balancer.BalancerRunner 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 70 with BalancerRunner

use of org.mobicents.tools.sip.balancer.BalancerRunner 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)

Aggregations

BalancerRunner (org.mobicents.tools.sip.balancer.BalancerRunner)75 LoadBalancerConfiguration (org.mobicents.tools.configuration.LoadBalancerConfiguration)50 BeforeClass (org.junit.BeforeClass)34 ListeningPoint (javax.sip.ListeningPoint)30 Before (org.junit.Before)26 AppServer (org.mobicents.tools.sip.balancer.AppServer)26 Shootist (org.mobicents.tools.sip.balancer.operation.Shootist)25 SmppChannelException (com.cloudhopper.smpp.type.SmppChannelException)21 DefaultSmppServer (com.cloudhopper.smpp.impl.DefaultSmppServer)19 WorstCaseUdpTestAffinityAlgorithm (org.mobicents.tools.sip.balancer.WorstCaseUdpTestAffinityAlgorithm)8 ArrayList (java.util.ArrayList)7 Test (org.junit.Test)6 UserBasedAlgorithm (org.mobicents.tools.sip.balancer.UserBasedAlgorithm)6 HeartbeatConfigHttp (org.mobicents.tools.heartbeat.impl.HeartbeatConfigHttp)5 HeaderConsistentHashBalancerAlgorithm (org.mobicents.tools.sip.balancer.HeaderConsistentHashBalancerAlgorithm)5 SinglePointTest (org.mobicents.tools.sip.balancer.SinglePointTest)4 SipException (javax.sip.SipException)3 HeartbeatConfig (org.mobicents.tools.heartbeat.api.HeartbeatConfig)2 HeartbeatConfigRmi (org.mobicents.tools.heartbeat.rmi.HeartbeatConfigRmi)2 ActiveStandbyAlgorithm (org.mobicents.tools.sip.balancer.ActiveStandbyAlgorithm)2