Running BrownField services on EC2

In this section, we will set up BrownField microservices on the EC2 instances created. In this case, the build is set up in the local desktop machine, and the binaries will be deployed to AWS.

Perform the following steps to set up services on an EC2 instance:

  1. Install Git via the following command:
    sudo apt-get install git
    
  2. Create a Git repository on any folder of your choice.
  3. Change the Config server's bootstrap.properties to point to the appropriate Git repository created for this example.
  4. Change the bootstrap.properties of all the microservices to point to the config-server using the private IP address of the EC2 instance.
  5. Copy all *.properties from the local Git repository to the EC2 Git repository and perform a commit.
  6. Change the Eureka server URLs and RabbitMQ URLs in the *.properties file to match the EC2 private IP address. Commit the changes to Git once they have been completed.
  7. On the local machine, recompile all the projects and create Docker images for the search, search-apigateway, and website microservices. Push all of them to the Docker Hub registry.
  8. Copy the config-server and the Eureka-server binaries from the local machine to the EC2 instance.
  9. Set up Java 8 on the EC2 instance.
  10. Then, execute the following commands in sequence:
    java –jar config-server.jar 
    java –jar eureka-server.jar 
    docker run –net host rabbitmq:3
    docker run --net host -p 8090:8090 rajeshrv/search:1.0
    docker run --net host -p 8095:8095 rajeshrv/search-apigateway:1.0
    docker run --net host -p 8001:8001 rajeshrv/website:1.0
    
  11. Check whether all the services are working by opening the URL of the website and executing a search. Note that we will use the public IP address in this case: http://54.165.128.23:8001.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.193.108