private void startViewManagers(Integer viewManagerInstances) { Integer instancesPerNode = (viewManagerInstances / NetworkConfig.VIEWMANAGERS.size()) + 1; if (instancesPerNode == 0) instancesPerNode = 1; // log.info(this.getClass(), "viewmanager nodes: "+NetworkConfig.VIEWMANAGERS.size()); log.info(this.getClass(), "viewManagerInstances: " + viewManagerInstances); log.info(this.getClass(), "instancesPerNode: " + instancesPerNode); log.info(this.getClass(), ""); int x = 0; // int messagePort = vmMessagePort; while (x < viewManagerInstances) { Node node = NetworkConfig.VIEWMANAGERS.get(x % NetworkConfig.VIEWMANAGERS.size()); int updatePort = node.getUpdatePort() + (x / NetworkConfig.VIEWMANAGERS.size()); int messagePort = node.getMessagePort() + (x / NetworkConfig.VIEWMANAGERS.size()); List<String> startupCommand = new ArrayList<String>(); startupCommand.add("cd /"); startupCommand.add("cd " + SystemConfig.DIRECTORY_VMSYSTEM); startupCommand.add( "java -Xmx1000m -cp vmsystem.jar de.webdataplatform.viewmanager.TestViewManager vm" + (x + 1) + " " + node.getIpAddress() + " " + updatePort + " " + messagePort); log.info( this.getClass(), "starting viewmanager vm" + (x + 1) + " on node: " + node.getIpAddress() + " udpatePort:" + updatePort + ", messagePort:" + messagePort); List<String> result = SSHService.sendCommand(log, node.getSshConnection(), startupCommand); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } x++; } log.info(this.getClass(), "\n"); }
private void startRegionServers(int numOfRs) { log.info(this.getClass(), ""); log.info(this.getClass(), "region server nodes: " + numOfRs); log.info(this.getClass(), ""); int x = 0; while (x < numOfRs) { Node node = NetworkConfig.REGIONSERVERS.get(x % NetworkConfig.REGIONSERVERS.size()); List<String> startupCommand = new ArrayList<String>(); startupCommand.add("cd /"); startupCommand.add("cd " + SystemConfig.DIRECTORY_VMSYSTEM); startupCommand.add( "java -Xmx1000m -cp vmsystem.jar de.webdataplatform.regionserver.TestRegionServer rs" + (x + 1) + " " + node.getIpAddress() + " " + node.getMessagePort()); log.info(this.getClass(), "starting region server:" + node); List<String> result = SSHService.sendCommand(log, node.getSshConnection(), startupCommand); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } x++; } log.info(this.getClass(), "\n"); }