public void restart() { if (dataDirectory == null) { throw new IllegalStateException("Container not restartable, please create it with restartable=true"); } LOGGER.debug("restarting etcd container {} with command: {}", endpoint, String.join(" ", container.getCommandParts())); final int port = this.container.getMappedPort(ETCD_CLIENT_PORT); this.container.stop(); this.container.withExposedPorts(ETCD_PEER_PORT); this.container.withFixedExposedPort(port, ETCD_CLIENT_PORT); this.container.start(); }
public void restart() { if (dataDirectory == null) { throw new IllegalStateException("Container not restartable, please create it with restartable=true"); } LOGGER.debug("restarting etcd container {} with command: {}", endpoint, String.join(" ", container.getCommandParts())); final int port = this.container.getMappedPort(ETCD_CLIENT_PORT); this.container.stop(); this.container.withExposedPorts(ETCD_PEER_PORT); this.container.withFixedExposedPort(port, ETCD_CLIENT_PORT); this.container.start(); }
public void restart() { if (dataDirectory == null) { throw new IllegalStateException("Container not restartable, please create it with restartable=true"); } LOGGER.debug("restarting etcd container {} with command: {}", endpoint, String.join(" ", container.getCommandParts())); final int port = this.container.getMappedPort(ETCD_CLIENT_PORT); this.container.stop(); this.container.withExposedPorts(ETCD_PEER_PORT); this.container.withFixedExposedPort(port, ETCD_CLIENT_PORT); this.container.start(); }
this.container.withExposedPorts(ETCD_CLIENT_PORT, ETCD_PEER_PORT); this.container.withNetwork(network); this.container.withNetworkAliases(name);
this.container.withExposedPorts(ETCD_CLIENT_PORT, ETCD_PEER_PORT); this.container.withNetwork(network); this.container.withNetworkAliases(name);
this.container.withExposedPorts(ETCD_CLIENT_PORT, ETCD_PEER_PORT); this.container.withNetwork(network); this.container.withNetworkAliases(name);
@Bean(name = ZOOKEEPER_BEAN_NAME, destroyMethod = "stop") public GenericContainer zookeeper(ZookeeperStatusCheck zookeeperStatusCheck, ZookeeperConfigurationProperties zookeeperProperties, ConfigurableEnvironment environment, Network network) { String currentTimestamp = LocalDateTime.now().format(DateTimeFormatter.ofPattern("HH-mm-ss-nnnnnnnnn")); String zkData = Paths.get(zookeeperProperties.getDataFileSystemBind(), currentTimestamp).toAbsolutePath().toString(); log.info("Writing zookeeper data to: {}", zkData); String zkTransactionLogs = Paths.get(zookeeperProperties.getTxnLogsFileSystemBind(), currentTimestamp).toAbsolutePath().toString(); log.info("Writing zookeeper transaction logs to: {}", zkTransactionLogs); log.info("Starting zookeeper server. Docker image: {}", zookeeperProperties.getDockerImage()); int mappingPort = zookeeperProperties.getZookeeperPort(); GenericContainer zookeeper = new FixedHostPortGenericContainer<>(zookeeperProperties.getDockerImage()) .withLogConsumer(containerLogsConsumer(log)) .withEnv("ZOOKEEPER_CLIENT_PORT", String.valueOf(mappingPort)) .withFileSystemBind(zkData, "/var/lib/zookeeper/data", BindMode.READ_WRITE) .withFileSystemBind(zkTransactionLogs, "/var/lib/zookeeper/log", BindMode.READ_WRITE) .withExposedPorts(mappingPort) .withFixedExposedPort(mappingPort, mappingPort) .withNetwork(network) .withNetworkAliases(ZOOKEEPER_HOST_NAME) .waitingFor(zookeeperStatusCheck) .withStartupTimeout(zookeeperProperties.getTimeoutDuration()); zookeeper.start(); registerZookeeperEnvironment(zookeeper, environment, zookeeperProperties); return zookeeper; }
this.container.withExposedPorts(ETCD_CLIENT_PORT, ETCD_PEER_PORT); this.container.withNetwork(network); this.container.withNetworkAliases(name);
.withEnv("KAFKA_CONTROLLER_SOCKET_TIMEOUT_MS", String.valueOf(kafkaProperties.getControllerSocketTimeoutMs())) .withFileSystemBind(kafkaData, "/var/lib/kafka/data", BindMode.READ_WRITE) .withExposedPorts(kafkaInternalPort, kafkaExternalPort) .withFixedExposedPort(kafkaInternalPort, kafkaInternalPort) .withFixedExposedPort(kafkaExternalPort, kafkaExternalPort)
static GenericContainer create(ElasticSearchProperties properties, Logger containerLogger) { return new FixedHostPortGenericContainer(properties.dockerImage) .withExposedPorts(properties.httpPort, properties.transportPort) .withEnv("cluster.name", properties.getClusterName()) .withEnv("discovery.type", "single-node") .withEnv("ES_JAVA_OPTS", getJavaOpts(properties)) .withLogConsumer(containerLogsConsumer(containerLogger)) .waitingFor(getCompositeWaitStrategy(properties)) .withStartupTimeout(properties.getTimeoutDuration()); }