Make reverse proxy displaying more logs
This commit is contained in:
parent
9c3f901119
commit
ca589883d5
3 changed files with 47 additions and 230 deletions
|
|
@ -2,10 +2,10 @@ version: "3"
|
||||||
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
drools-network:
|
drools-network-dev:
|
||||||
ipam:
|
ipam:
|
||||||
config:
|
config:
|
||||||
- subnet: 172.27.0.0/24
|
- subnet: 172.27.1.0/24
|
||||||
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
@ -17,8 +17,8 @@ services:
|
||||||
- gitdata:/home/niodir
|
- gitdata:/home/niodir
|
||||||
- lucenedata:/home/lucene
|
- lucenedata:/home/lucene
|
||||||
networks:
|
networks:
|
||||||
drools-network:
|
drools-network-dev:
|
||||||
ipv4_address: 172.27.0.5
|
ipv4_address: 172.27.1.5
|
||||||
ports:
|
ports:
|
||||||
- 8080:8080
|
- 8080:8080
|
||||||
- 8001:8001
|
- 8001:8001
|
||||||
|
|
@ -30,8 +30,8 @@ services:
|
||||||
image: runtime-admin-console
|
image: runtime-admin-console
|
||||||
container_name: "admin-console"
|
container_name: "admin-console"
|
||||||
networks:
|
networks:
|
||||||
drools-network:
|
drools-network-dev:
|
||||||
ipv4_address: 172.27.0.6
|
ipv4_address: 172.27.1.6
|
||||||
ports:
|
ports:
|
||||||
- 8200:8200
|
- 8200:8200
|
||||||
links:
|
links:
|
||||||
|
|
@ -48,8 +48,8 @@ services:
|
||||||
image: runtime-proxy
|
image: runtime-proxy
|
||||||
container_name: "runtime-proxy-1"
|
container_name: "runtime-proxy-1"
|
||||||
networks:
|
networks:
|
||||||
drools-network:
|
drools-network-dev:
|
||||||
ipv4_address: 172.27.0.22
|
ipv4_address: 172.27.1.22
|
||||||
ports:
|
ports:
|
||||||
- 8090
|
- 8090
|
||||||
- 9080
|
- 9080
|
||||||
|
|
@ -65,8 +65,8 @@ services:
|
||||||
image: runtime-proxy
|
image: runtime-proxy
|
||||||
container_name: "runtime-proxy-2"
|
container_name: "runtime-proxy-2"
|
||||||
networks:
|
networks:
|
||||||
drools-network:
|
drools-network-dev:
|
||||||
ipv4_address: 172.27.0.32
|
ipv4_address: 172.27.1.32
|
||||||
ports:
|
ports:
|
||||||
- 8090
|
- 8090
|
||||||
- 9080
|
- 9080
|
||||||
|
|
@ -82,8 +82,8 @@ services:
|
||||||
image: runtime-proxy
|
image: runtime-proxy
|
||||||
container_name: "runtime-proxy-3"
|
container_name: "runtime-proxy-3"
|
||||||
networks:
|
networks:
|
||||||
drools-network:
|
drools-network-dev:
|
||||||
ipv4_address: 172.27.0.42
|
ipv4_address: 172.27.1.42
|
||||||
ports:
|
ports:
|
||||||
- 8090
|
- 8090
|
||||||
- 9080
|
- 9080
|
||||||
|
|
@ -99,8 +99,8 @@ services:
|
||||||
image: runtime-proxy
|
image: runtime-proxy
|
||||||
container_name: "runtime-proxy-4"
|
container_name: "runtime-proxy-4"
|
||||||
networks:
|
networks:
|
||||||
drools-network:
|
drools-network-dev:
|
||||||
ipv4_address: 172.27.0.52
|
ipv4_address: 172.27.1.52
|
||||||
ports:
|
ports:
|
||||||
- 8090
|
- 8090
|
||||||
- 9080
|
- 9080
|
||||||
|
|
@ -116,8 +116,8 @@ services:
|
||||||
image: runtime-proxy
|
image: runtime-proxy
|
||||||
container_name: "runtime-proxy-5"
|
container_name: "runtime-proxy-5"
|
||||||
networks:
|
networks:
|
||||||
drools-network:
|
drools-network-dev:
|
||||||
ipv4_address: 172.27.0.62
|
ipv4_address: 172.27.1.62
|
||||||
ports:
|
ports:
|
||||||
- 8090
|
- 8090
|
||||||
- 9080
|
- 9080
|
||||||
|
|
@ -134,8 +134,8 @@ services:
|
||||||
image: runtime-indexer
|
image: runtime-indexer
|
||||||
container_name: "runtime-indexer"
|
container_name: "runtime-indexer"
|
||||||
networks:
|
networks:
|
||||||
drools-network:
|
drools-network-dev:
|
||||||
ipv4_address: 172.27.0.23
|
ipv4_address: 172.27.1.23
|
||||||
links:
|
links:
|
||||||
- businessProxyDB:mongodb
|
- businessProxyDB:mongodb
|
||||||
- elasticsearchhost
|
- elasticsearchhost
|
||||||
|
|
@ -148,8 +148,8 @@ services:
|
||||||
image: runtime-reverse-proxy
|
image: runtime-reverse-proxy
|
||||||
container_name: "runtime-reverse-proxy"
|
container_name: "runtime-reverse-proxy"
|
||||||
networks:
|
networks:
|
||||||
drools-network:
|
drools-network-dev:
|
||||||
ipv4_address: 172.27.0.25
|
ipv4_address: 172.27.1.25
|
||||||
|
|
||||||
links:
|
links:
|
||||||
- businessProxyDB:mongodb
|
- businessProxyDB:mongodb
|
||||||
|
|
@ -174,8 +174,8 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- esdata2:/usr/share/elasticsearch/data
|
- esdata2:/usr/share/elasticsearch/data
|
||||||
networks:
|
networks:
|
||||||
drools-network:
|
drools-network-dev:
|
||||||
ipv4_address: 172.27.0.7
|
ipv4_address: 172.27.1.7
|
||||||
ports:
|
ports:
|
||||||
- 9300:9300
|
- 9300:9300
|
||||||
restart: always
|
restart: always
|
||||||
|
|
@ -187,8 +187,8 @@ services:
|
||||||
- mongodb:/data/db
|
- mongodb:/data/db
|
||||||
- mongodb_config:/data/configdb
|
- mongodb_config:/data/configdb
|
||||||
networks:
|
networks:
|
||||||
drools-network:
|
drools-network-dev:
|
||||||
ipv4_address: 172.27.0.3
|
ipv4_address: 172.27.1.3
|
||||||
ports:
|
ports:
|
||||||
- 28017:27017
|
- 28017:27017
|
||||||
command: mongod
|
command: mongod
|
||||||
|
|
|
||||||
|
|
@ -1,203 +0,0 @@
|
||||||
version: "3"
|
|
||||||
|
|
||||||
|
|
||||||
networks:
|
|
||||||
drools-network:
|
|
||||||
ipam:
|
|
||||||
config:
|
|
||||||
- subnet: 172.27.0.0/24
|
|
||||||
|
|
||||||
|
|
||||||
services:
|
|
||||||
|
|
||||||
kie-wb:
|
|
||||||
image: kie-wb
|
|
||||||
container_name: "businessCentral"
|
|
||||||
volumes:
|
|
||||||
- gitdata:/home/niodir
|
|
||||||
- lucenedata:/home/lucene
|
|
||||||
networks:
|
|
||||||
drools-network:
|
|
||||||
ipv4_address: 172.27.0.5
|
|
||||||
ports:
|
|
||||||
- 8080:8080
|
|
||||||
- 8001:8001
|
|
||||||
|
|
||||||
restart: always
|
|
||||||
|
|
||||||
|
|
||||||
admin-console:
|
|
||||||
image: runtime-admin-console
|
|
||||||
container_name: "admin-console"
|
|
||||||
networks:
|
|
||||||
drools-network:
|
|
||||||
ipv4_address: 172.27.0.6
|
|
||||||
ports:
|
|
||||||
- 8200:8200
|
|
||||||
links:
|
|
||||||
- businessProxyDB:mongodb
|
|
||||||
- elasticsearchhost
|
|
||||||
- kie-wb
|
|
||||||
depends_on:
|
|
||||||
- businessProxyDB
|
|
||||||
- elasticsearchhost
|
|
||||||
- kie-wb
|
|
||||||
restart: always
|
|
||||||
|
|
||||||
runtime-proxy-1:
|
|
||||||
image: runtime-proxy
|
|
||||||
container_name: "runtime-proxy-1"
|
|
||||||
networks:
|
|
||||||
drools-network:
|
|
||||||
ipv4_address: 172.27.0.22
|
|
||||||
ports:
|
|
||||||
- 8090
|
|
||||||
- 9080
|
|
||||||
links:
|
|
||||||
- businessProxyDB:mongodb
|
|
||||||
- kie-wb:kie-wb
|
|
||||||
depends_on:
|
|
||||||
- businessProxyDB
|
|
||||||
- kie-wb
|
|
||||||
restart: always
|
|
||||||
|
|
||||||
runtime-proxy-2:
|
|
||||||
image: runtime-proxy
|
|
||||||
container_name: "runtime-proxy-2"
|
|
||||||
networks:
|
|
||||||
drools-network:
|
|
||||||
ipv4_address: 172.27.0.32
|
|
||||||
ports:
|
|
||||||
- 8090
|
|
||||||
- 9080
|
|
||||||
links:
|
|
||||||
- businessProxyDB:mongodb
|
|
||||||
- kie-wb:kie-wb
|
|
||||||
depends_on:
|
|
||||||
- businessProxyDB
|
|
||||||
- kie-wb
|
|
||||||
restart: always
|
|
||||||
|
|
||||||
runtime-proxy-3:
|
|
||||||
image: runtime-proxy
|
|
||||||
container_name: "runtime-proxy-3"
|
|
||||||
networks:
|
|
||||||
drools-network:
|
|
||||||
ipv4_address: 172.27.0.42
|
|
||||||
ports:
|
|
||||||
- 8090
|
|
||||||
- 9080
|
|
||||||
links:
|
|
||||||
- businessProxyDB:mongodb
|
|
||||||
- kie-wb:kie-wb
|
|
||||||
depends_on:
|
|
||||||
- businessProxyDB
|
|
||||||
- kie-wb
|
|
||||||
restart: always
|
|
||||||
|
|
||||||
runtime-proxy-4:
|
|
||||||
image: runtime-proxy
|
|
||||||
container_name: "runtime-proxy-4"
|
|
||||||
networks:
|
|
||||||
drools-network:
|
|
||||||
ipv4_address: 172.27.0.52
|
|
||||||
ports:
|
|
||||||
- 8090
|
|
||||||
- 9080
|
|
||||||
links:
|
|
||||||
- businessProxyDB:mongodb
|
|
||||||
- kie-wb:kie-wb
|
|
||||||
depends_on:
|
|
||||||
- businessProxyDB
|
|
||||||
- kie-wb
|
|
||||||
restart: always
|
|
||||||
|
|
||||||
runtime-proxy-5:
|
|
||||||
image: runtime-proxy
|
|
||||||
container_name: "runtime-proxy-5"
|
|
||||||
networks:
|
|
||||||
drools-network:
|
|
||||||
ipv4_address: 172.27.0.62
|
|
||||||
ports:
|
|
||||||
- 8090
|
|
||||||
- 9080
|
|
||||||
links:
|
|
||||||
- businessProxyDB:mongodb
|
|
||||||
- kie-wb:kie-wb
|
|
||||||
depends_on:
|
|
||||||
- businessProxyDB
|
|
||||||
- kie-wb
|
|
||||||
restart: always
|
|
||||||
|
|
||||||
|
|
||||||
runtime-indexer:
|
|
||||||
image: runtime-indexer
|
|
||||||
container_name: "runtime-indexer"
|
|
||||||
networks:
|
|
||||||
drools-network:
|
|
||||||
ipv4_address: 172.27.0.23
|
|
||||||
links:
|
|
||||||
- businessProxyDB:mongodb
|
|
||||||
- elasticsearchhost
|
|
||||||
depends_on:
|
|
||||||
- businessProxyDB
|
|
||||||
- elasticsearchhost
|
|
||||||
restart: always
|
|
||||||
|
|
||||||
runtime-reverse-proxy:
|
|
||||||
image: runtime-reverse-proxy
|
|
||||||
container_name: "runtime-reverse-proxy"
|
|
||||||
networks:
|
|
||||||
drools-network:
|
|
||||||
ipv4_address: 172.27.0.25
|
|
||||||
|
|
||||||
links:
|
|
||||||
- businessProxyDB:mongodb
|
|
||||||
depends_on:
|
|
||||||
- businessProxyDB
|
|
||||||
ports:
|
|
||||||
- 9500:9500
|
|
||||||
|
|
||||||
restart: always
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
elasticsearchhost:
|
|
||||||
image: docker.elastic.co/elasticsearch/elasticsearch:6.6.1
|
|
||||||
container_name: "elasticsearchhost"
|
|
||||||
ulimits:
|
|
||||||
memlock:
|
|
||||||
soft: -1
|
|
||||||
hard: -1
|
|
||||||
volumes:
|
|
||||||
- esdata2:/usr/share/elasticsearch/data
|
|
||||||
networks:
|
|
||||||
drools-network:
|
|
||||||
ipv4_address: 172.27.0.7
|
|
||||||
ports:
|
|
||||||
- 9300:9300
|
|
||||||
restart: always
|
|
||||||
|
|
||||||
businessProxyDB:
|
|
||||||
image: mongo
|
|
||||||
container_name: "businessProxyDB"
|
|
||||||
volumes:
|
|
||||||
- mongodb:/data/db
|
|
||||||
- mongodb_config:/data/configdb
|
|
||||||
networks:
|
|
||||||
drools-network:
|
|
||||||
ipv4_address: 172.27.0.3
|
|
||||||
ports:
|
|
||||||
- 28017:27017
|
|
||||||
command: mongod
|
|
||||||
restart: always
|
|
||||||
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
mongodb:
|
|
||||||
mongodb_config:
|
|
||||||
gitdata:
|
|
||||||
lucenedata:
|
|
||||||
esdata2:
|
|
||||||
|
|
@ -5,6 +5,8 @@ import org.chtijbug.drools.proxy.persistence.model.ProjectPersist;
|
||||||
import org.chtijbug.drools.proxy.persistence.model.RuntimePersist;
|
import org.chtijbug.drools.proxy.persistence.model.RuntimePersist;
|
||||||
import org.chtijbug.drools.proxy.persistence.repository.ProjectRepository;
|
import org.chtijbug.drools.proxy.persistence.repository.ProjectRepository;
|
||||||
import org.chtijbug.drools.proxy.persistence.repository.RuntimeRepository;
|
import org.chtijbug.drools.proxy.persistence.repository.RuntimeRepository;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
@ -13,6 +15,7 @@ import java.util.*;
|
||||||
|
|
||||||
@Service("updateService")
|
@Service("updateService")
|
||||||
public class UpdateService {
|
public class UpdateService {
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(UpdateService.class);
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ProjectRepository projectRepository;
|
private ProjectRepository projectRepository;
|
||||||
|
|
@ -93,17 +96,34 @@ public class UpdateService {
|
||||||
if (projectPersist.getServerNames().size() > 0) {
|
if (projectPersist.getServerNames().size() > 0) {
|
||||||
projects.put(projectPersist.getContainerID(), projectPersist.duplicate());
|
projects.put(projectPersist.getContainerID(), projectPersist.duplicate());
|
||||||
MappingProperties mappingProperties2 = new MappingProperties();
|
MappingProperties mappingProperties2 = new MappingProperties();
|
||||||
|
String servList=null;
|
||||||
for (String serverName : projectPersist.getServerNames()) {
|
for (String serverName : projectPersist.getServerNames()) {
|
||||||
RuntimePersist runtimePersist = runtimes.get(serverName);
|
RuntimePersist runtimePersist = runtimes.get(serverName);
|
||||||
|
if (runtimePersist!= null) {
|
||||||
String hostName = runtimePersist.getHostname() + "/api/" + projectPersist.getContainerID();
|
String hostName = runtimePersist.getHostname() + "/api/" + projectPersist.getContainerID();
|
||||||
mappingProperties2.getDestinations().add(hostName);
|
mappingProperties2.getDestinations().add(hostName);
|
||||||
|
if (servList==null){
|
||||||
|
servList=serverName;
|
||||||
|
}else{
|
||||||
|
servList=servList+":"+serverName;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
paths.add(mappingProperties2);
|
|
||||||
mappingProperties2.setName(projectPersist.getContainerID());
|
mappingProperties2.setName(projectPersist.getContainerID());
|
||||||
mappingProperties2.setPath("/" + projectPersist.getContainerID());
|
mappingProperties2.setPath("/" + projectPersist.getContainerID());
|
||||||
mappingProperties2.getCustomConfiguration().put("connect", 2000);
|
mappingProperties2.getCustomConfiguration().put("connect", 2000);
|
||||||
mappingProperties2.getCustomConfiguration().put("read", 2000);
|
mappingProperties2.getCustomConfiguration().put("read", 2000);
|
||||||
mappingProperties2.setStripPath(true);
|
mappingProperties2.setStripPath(true);
|
||||||
|
if ( mappingProperties2.getDestinations().size()>0) {
|
||||||
|
paths.add(mappingProperties2);
|
||||||
|
logger.info("Project "+projectPersist.getContainerID()+" defined on servers - "+servList);
|
||||||
|
|
||||||
|
}else{
|
||||||
|
logger.error("Project "+projectPersist.getContainerID()+" defined on non existing server");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
editor.link_modal.header
Reference in a new issue