This page contains information on basic tasks that are used throughout the Steeltoe Samples. Use this page to quickly get your local development environment up and running.
The Steeltoe team has built a docker image of a basic Config server for an easy experience getting started
To start a config server backed by a folder on your local disk, start the docker image like this:
# Note: Ensure Docker is configured to share host drive/volume so the mount below will work correctly!
docker run --rm -ti -p 8888:8888 -v $PWD/steeltoe/config-repo:/config --name steeltoe-config steeltoeoss/configserver --spring.profiles.active=native
To start a config server backed by the spring cloud samples repo:
docker run --rm -ti -p 8888:8888 --name steeltoe-config steeltoeoss/config-server
To run a Spring Cloud Config Server without Docker:
- Install Java 8 JDK.
- Install Maven 3.x.
- Clone the Spring Cloud Config Server repository:
git clone https://github.com/spring-cloud/spring-cloud-config
- Change to the directory the server is located in:
cd spring-cloud-config/spring-cloud-config-server
- Start the server:
mvn spring-boot:run
The default configuration of the Config Server uses this github repo for its source of configuration data.
Use the cf cli to create a Spring Cloud Config Server in a org/space, backed by a given git repo. Many of the Steeltoe samples use the spring-cloud-samples
repo, but you may need to alter the parameter used.
cf target -o myorg -s myspace
- Use the correct escaping for your shell:
- bash:
cf create-service p-config-server standard myConfigServerInstanceName -c '{"git":{"uri": "https://github.com/spring-cloud-samples/config-repo"}}'
- CMD:
cf create-service p-config-server standard myConfigServerInstanceName -c "{\"git\":{\"uri\":\"https://github.com/spring-cloud-samples/config-repo\"}}"
- PowerShell:
cf create-service p-config-server standard myConfigServerInstanceName -c '{\"git\":{\"uri\":\"https://github.com/spring-cloud-samples/config-repo\"}}'
- bash:
- Wait for service to be ready. (use
cf services
to check the status)
The Steeltoe team has built a docker image of a basic Eureka server for an easy experience getting started:
docker run --rm -ti -p 8761:8761 --name steeltoe-eureka steeltoeoss/eureka-server
Use the cf cli to create a Service Registry service in a org/space.
- cf target -o myorg -s myspace
- cf create-service p-service-registry standard myDiscoveryServiceInstanceName
- Wait for service to be ready. (use
cf services
to check the status)
This command starts a RabbitMQ server with the management plugin enabled with no credentials and default ports:
docker run --rm -ti -p 5672:5672 -p 15672:15672 --name rabbitmq rabbitmq:3-management
docker run --rm -ti -p 8500:8500 --name=steeltoe-consul hashicorp/consul
There are multiple Spring Boot Admin images to choose from, this is only one option:
docker run --rm -it -p 8080:8080 --name steeltoe-springbootadmin steeltoeoss/spring-boot-admin
docker run --rm -ti -p 6379:6379 --name redis redis
docker run --rm -ti -p 3306:3306 --name steeltoe-mysql -e MYSQL_ROOT_PASSWORD=steeltoe -e MYSQL_DATABASE=steeltoe -e MYSQL_USER=steeltoe -e MYSQL_PASSWORD=steeltoe mysql
docker run --rm -ti -p 1433:1433 --name steeltoe-sqlserver -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=St33ltoeR0cks!' mcr.microsoft.com/mssql/server
docker run --rm -ti -p 5432:5432 --name steeltoe-postgres -e POSTGRES_DB=steeltoe -e POSTGRES_USER=steeltoe -e POSTGRES_PASSWORD=steeltoe postgres:alpine
docker run --rm -ti -p 27017:27017 --name mongoserver mongo
docker run --rm -ti -p 9411:9411 --name zipkin openzipkin/zipkin
There are a few images available on Docker Hub that provide basic Hystrix Dashboard functionality. This example has been tested:
docker run --rm -ti -p 7979:7979 --name steeltoe-hystrix steeltoeoss/hystrix-dashboard
Once this image is up and running, you should be able to browse to your local dashboard and provide the address of the Hystrix stream(s) you wish to monitor.
NOTE: This image may be running on a separate network than your application. Remember to provide a stream address that is accessible from within the Docker network. This may require using the external IP address of your workstation or the name of the machine instead of 127.0.0.1 or localhost.
To run a Hystrix Dashboard without Docker:
- Install Java 8 JDK.
- Install Maven 3.x.
- Clone the Spring Cloud Samples Hystrix dashboard:
cd https://github.com/spring-cloud-samples/hystrix-dashboard
- Change to the hystrix dashboard directory:
cd hystix-dashboard
- Start the server
mvn spring-boot:run
- Open a browser window and connect to the dashboard: http://localhost:7979
- In the first field, enter the endpoint that is exposing the hystrix metrics (eg: http://localhost:5555/hystrix/hystrix.stream)
- Click the monitor button.
- Interact with the application to trigger usage of the circuits. Observe the values changing in the Hystrix dashboard.
Use the cf cli to create a Circuit Breaker service in a org/space.
- cf target -o myorg -s development
- cf create-service p-circuit-breaker-dashboard standard myHystrixServiceInstanceName
- Wait for the service to become ready! (use
cf services
to check the status)