use of org.mobicents.tools.sip.balancer.BalancerRunner in project load-balancer by RestComm.
the class HttpsBalancerWithHttpsServerTest method initialization.
@BeforeClass
public static void initialization() {
balancerRunner = new BalancerRunner();
LoadBalancerConfiguration lbConfig = new LoadBalancerConfiguration();
lbConfig.getSipConfiguration().getInternalLegConfiguration().setUdpPort(5065);
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 < serverArray.length; i++) {
serverArray[i] = new HttpServer(7080 + i, 4444 + i, 2222 + i);
serverArray[i].start();
Helper.sleep(1000);
}
Helper.sleep(5000);
}
use of org.mobicents.tools.sip.balancer.BalancerRunner in project load-balancer by RestComm.
the class InstanceIdAlgorithmTest 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++) {
String id = null;
if (i == 1)
id = "ID1f2a2222772f4195948d040a2ccc648c";
else
id = "ID1f2a2222772f4195948d040a2ccc648" + i;
serverArray[i] = new HttpServer(7080 + i, 4444 + i, id, 2222 + i);
serverArray[i].start();
Helper.sleep(1000);
}
Helper.sleep(5000);
}
use of org.mobicents.tools.sip.balancer.BalancerRunner in project load-balancer by RestComm.
the class UrlRewriteTest method initialization.
@BeforeClass
public static void initialization() {
serverArray = new HttpServer[numberNodes];
for (int i = 0; i < numberNodes; i++) {
serverArray[i] = new HttpServer(8080 + i, 4444 + i, "ID1f2a2222772f4195948d040a2ccc648c", 2222);
serverArray[i].start();
}
balancerRunner = new BalancerRunner();
String pathToConfig = UrlRewriteTest.class.getClassLoader().getResource("lb-configuration.xml").getFile();
balancerRunner.start(pathToConfig);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
use of org.mobicents.tools.sip.balancer.BalancerRunner in project load-balancer by RestComm.
the class WithandWithoutInstanseIdTest method initialization.
@BeforeClass
public static void initialization() {
serverArray = new HttpServer[numberNodes];
for (int i = 0; i < numberNodes; i++) {
serverArray[i] = new HttpServer(7080 + i, 4444 + i, instanceId, 2222);
serverArray[i].start();
}
balancerRunner = new BalancerRunner();
LoadBalancerConfiguration lbConfig = new LoadBalancerConfiguration();
lbConfig.getSipConfiguration().getInternalLegConfiguration().setUdpPort(5065);
lbConfig.getSipConfiguration().getAlgorithmConfiguration().setAlgorithmClass(UserBasedAlgorithm.class.getName());
lbConfig.getSipConfiguration().getAlgorithmConfiguration().setSipHeaderAffinityKey("From");
balancerRunner.start(lbConfig);
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
use of org.mobicents.tools.sip.balancer.BalancerRunner in project load-balancer by RestComm.
the class HeaderConsistentHashAlgorithmTest method setUp.
@Before
public void setUp() throws Exception {
shootist = new Shootist();
balancer = new BalancerRunner();
LoadBalancerConfiguration lbConfig = new LoadBalancerConfiguration();
lbConfig.getSipConfiguration().getInternalLegConfiguration().setUdpPort(5065);
lbConfig.getSipConfiguration().getAlgorithmConfiguration().setAlgorithmClass(HeaderConsistentHashBalancerAlgorithm.class.getName());
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.UDP, 2222 + q);
servers[q].start();
}
Thread.sleep(5000);
}
Aggregations