Monday, December 28, 2015
Saturday, December 26, 2015
Vagrant Commands
What is Vagrant ?
- Vagrant is a tool that uses Oracle's VirtualBox to dynamically build configurable, lightweight, and portable virtual machines.
- Vagrant supports the use of either Puppet or Chef for managing the configuration.
vagrant up, halt
- up is used to create & configure your guest environment/machines based on your vagrantfile.
- halt bring down the environment Vagrant is managing.
vagrant status
- status of the Vagrant managed machines.
vagrant reload
- apply Vagrant configuration changes (like port forwarding) without rebuilding the VM.
vagrant suspend, resume
- saves the state of the current VM.- resume will load up the suspended VM.
vagrant init, destroy
- init initializes a project to use Vagrant
- Beware. This command will bring down the environment if running and then destroys
all of the resources that were created along with the initial creation.
vagrant push
- Vagrant can be configured to deploy code !
vagrant ssh
- SSH into your Vagrant running machines.
vagrant login
- log into Vagrant cloud (Atlas).
vagrant share
- Do form folder with vagrantfile
vagrant global-status
- List all VMs status anywhere on the system.
vagrant gem
- install Vagrant plugins via RubyGems
vagrant box (add, list, remove)
- vagrant box add, allows you to install a box (or VM) to the local machine
- vagrant box remove, a box from the local machine
- vagrant box list, the locally installed Vagrant boxes
vagrant -help
- That will provide man pages for a Vagrant command.
Configuration Management Tool : Puppet, Chef, Ansible, Salt, Docker
vagrant provision, reload --provision
- provisioning runs on up only
Create own boxes with vagrant or packer
vagrant package
- To create a distribution of the vm you have running.
Vagrant plugin list : click here
vagrant plugin install vagrant-berkshelf
vagrant plugin install vagrant-hostmanager
vagrant plugin install vagrant-omnibus
Vagrant Boxes List : click here
Vagrant Example :
vagrant box add precise32 http:
//files
.vagrantup.com
/precise32
.box
vagrant init precise32
vagrant up
vagrant
ssh
vagrant reload
vagrant provision
Saturday, December 19, 2015
Microservices Architecture – Spring Boot, Spring Cloud and Netflix OSS Infrastructure
What is "Microservices"?
Patterns in Micro services Architecture
Microservices Architecture using Netflix Components :
We have used the Netflix components to accomplish the above microservices architecture patterns.
Major Components of Netflix :
You can view on PDF, Please click here: www.optisolbusiness.com/Micro-Services-Architecture-Spring-Boot-and-Netflix-Infrastructure.pdf
- A suite of small services that use lightweight mechanism like REST to communicate with each other.
- These services are built around business capabilities and independently deployable by fully automated deployment machinery.
Why Micro Services Architecture?
We chose micro services architecture to write each functionality as a
separate service for core and API functionality and it helps us to
achieve the continuous delivery and integration.
Frameworks
There are couple of frameworks available in different software
ecosystems that make it easy to create distributed applications using
microservices architecture.- Java – Spring Cloud using Netflix OSS
- Node.js – Seneca
- The reference architecture developed by us builds on the Spring Cloud ecosystem.
- There are number of components available within the Spring Cloud and
Netflix OSS ecosystem that solve common problems for distributed
applications
(e.g. configuration management, service discovery, circuit breakers, intelligent routing etc).
Patterns in Micro Services Architecture :
- API Gateway
- Service Registry
- Service Discovery
API Gateway |
|
Service Registry |
|
Service Discovery |
|
Microservices Architecture using Netflix Components :
We have used the Netflix components to accomplish the above microservices architecture patterns.
Operations Component | Spring Cloud, Netflix OSS |
Service Discovery Server | Netflix Eureka |
Edge Server | Netflix Zuul |
Central Configuration Server | Spring Cloud Config Server |
Dynamic Routing and Load Balancer | Netflix Ribbon |
OAuth 2.0 protected API’s | Spring Cloud + Spring Security OAuth2 |
Circuit Breaker | Netflix Hystrix |
Monitoring | Netflix Hystrix Dashboard and Turbine |
Centralized Log Analysis | ELK (Elasticsearch,Logstash,Kibana) |
Major Components of Netflix :
Netflix Eureka – Service Discovery Server
Netflix Eureka allows micro services to register themselves at runtime as they appear in the system landscape.
Netflix Ribbon – Dynamic Routing & Load Balancer
Netflix Ribbon can be used by service consumers to look up services
at runtime. Ribbon uses the information available in Eureka to locate
appropriate service instances. If more than one instance is found,
Ribbon will apply load balancing to spread the requests over the
available instances. Ribbon does not run as a separate service but
instead as an embedded component in each service consumer.
Netflix Zuul – Edge Server & API gatewayer
Zuul is (of course) our gatekeeper to the outside world, not allowing
any unauthorized external requests pass through. Zulu also provides a
well-known entry point to the micro services in the system landscape.
Using dynamically allocated ports is convenient to avoid port conflicts
and to minimize administration but it makes it of course harder for any
given service consumer. Zuul uses Ribbon to look up available services
and routes the external request to an appropriate service instance.
Spring Boot & Spring Cloud Netflix OSS – Micro Service Architecture
Micro Services with Spring Boot :
Spring Boot is a brand new framework from the team at Pivotal,
designed to simplify the bootstrapping and development of a new spring
application. The framework takes an opinionated approach to
configuration, freeing developers from the need to define boilerplate
configuration.
Spring Cloud Netflix :
Spring cloud Netflix provides Netflix OSS integrations for spring
boot apps through auto configuration and binding to the spring
environment and other spring programming models. With a few simple
annotations we can quickly enable and configure common patterns inside
application and to build large distributed systems with Netflix
components. There are lot of features available with spring cloud
Netflix. Here, we have listed some of the common features we have
implemented with micro services with spring boot and Netflix,Service Discovery |
|
Service Creation |
|
External Configuration |
|
Router and Filter |
|
Saturday, December 12, 2015
Spring Cloud and Netflix OSS
How do services find each other?
How do I configure many instances of each service?
How do I see what’s going on with my services?
Some answers using Spring Cloud and Netflix OSS to create microservices that are robust, discoverable, scalable and configurable.
How do I configure many instances of each service?
How do I see what’s going on with my services?
Some answers using Spring Cloud and Netflix OSS to create microservices that are robust, discoverable, scalable and configurable.
- Spring Cloud Config Server (distributed configuration)
- Eureka (service registration and discovery)
- Hystrix (circuit breaker/fault tolerance library)
- Hystrix Dashboard (service health dashboard)
- Ribbon (client side load balancing, including RestTemplate integration)
- Feign (easy rest clients)
- Zuul (routing)
- Spring Cloud Bus (distributed Spring Boot actuator)
- Spring Cloud Security
- Reactive programming patterns
Sunday, December 6, 2015
Microservices Design Pattern
The patterns
- Monolithic architecture
- Microservices architecture
- API gateway
- Client-side discovery
- Server-side discovery
- Service registry
- Self registration
- 3rd party registration
- Multiple service instances per host
- Single service instance per host
- Service instance per VM
- Service instance per Container
- Database per Service
- Microservice chassis
Saturday, December 5, 2015
Microservice database challenges
- Private-tables-per-service : each service owns a set of tables that must only be accessed by that service
- Schema-per-service : each service has a database schema that’s private to that service
- Database-server-per-service : each service has it’s own database server.
- It might also make sense to have a polyglot persistence
architecture. For each service you choose the type of database that is
best suited to that service’s requirements. For example, a service that
does text searches could use ElasticSearch. A service that manipulates a
social graph could use Neo4j. It might not make sense to use a
relational database for every service.
- Most notably, it can be challenging to implement business transactions that update data owned by multiple services. Rather than using distributed transaction, you typically must use an eventually consistent, event-driven approach to maintain database consistency.
- Another problem, is that it is difficult to implement some queries because you can’t do database joins across the data owned by multiple services. Sometimes, you can join the data within a service. In other situations, you will need to use Command Query Responsibility Segregation (CQRS) and maintain denormalizes views.
- Another challenge is that services sometimes need to share data. For example, let’s imagine that several services need access to user profile data. One option is to encapsulate the user profile data with a service, that’s then called by other services. Another option is to use an event-driven mechanism to replicate data to each service that needs it.
Subscribe to:
Posts (Atom)