- Go to start.spring.io
- Add service discovery, eureka or similar
- Eureka client in .Net - https://steeltoe.io/docs/steeltoe-discovery/
-
- EnableDiscoverClient
- Change the port
- Give the application a name - because service discovery happens by name
- Circuit Breaker - Hystrix, Resilience4J, https://steeltoe.io/docs/steeltoe-circuitbreaker
- Chaos Engineering
- Log Analysis - ELK
- Metrics - Prometheus, InfluxDB (Time series database)
| docker build -t order-service:latest . | |
| docker run -p 9910:8080 order-service:latest | |
| docker images | |
| docker ps # This will give the container id | |
| docker exec -it <container id> /bin/sh |
| @Bean | |
| public ClientHttpRequestFactory createRequestFactory(@Value("${connection.timeout}") String maxConn) { | |
| PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(); | |
| connectionManager.setMaxTotal(maxTotalConn); | |
| connectionManager.setDefaultMaxPerRoute(maxPerChannel); | |
| RequestConfig config = RequestConfig.custom().setConnectTimeout(100000).build(); | |
| CloseableHttpClient httpClient = HttpClientBuilder.create().setConnectionManager(connectionManager) | |
| .setDefaultRequestConfig(config).build(); | |
| return new HttpComponentsClientHttpRequestFactory(httpClient); |
| /** | |
| * Created by rg3 on 10/17/17. | |
| */ | |
| import java.util.ArrayList; | |
| public class NoOfStories { | |
| static int small=1; | |
| static int large=2; |
| import java.util.*; | |
| /** | |
| * Created by rg3 on 10/17/17. | |
| */ | |
| public class UniqueStringTask { | |
| private static String findFirstUnique(String ...names){ | |
| if (names.length ==0) { // Check for empty array |
We ran in to a lot of space issues with storing docker images in Azure cloud VMs. Because by default docker images, layers and containers are stored in the
/var/lib/docker
It is the same with the Amazon AWS as well.
The problem with this is most of the virtual machines have a very limited space in the OS Disk and the space can run out very soon. It is wise to save the docker images and attach your data containers to point a mount volume.
When we were trying to create a docker image for our Node JS based application, we chose to use the official Node docker image (~700MB). On top of that we need to add the node modules, business logic, etc and so on. The final image size was staggering (~1.2GB). It was not what we wanted. Secondly, the average build time to do NPM install and run a grunt task totally took 15 minutes for every build. I am not even talking about the pain of configuring this for different CI/CD pipelines and environments.
The initial docker file was looking something like this:
FROM node:6.10.1-alpine