SlideShare ist ein Scribd-Unternehmen logo
Scaling Search Clusters
with Apache Solr &
Kubernetes
Amrit Sarkar
Engineer, Cloud Operations
Lucidworks Inc
3
SOLR
AUTOSCALING
LUCENE
HIGHLIGHTING
TEXT
SEARCH
CDCR
DISTRIBUTED
GROUPING &
FACETS
LEARNING
TO RANK
STREAMING
PLENTY MORE..
4
referred from: https://cloud.google.com/kubernetes-engine/kubernetes-comic/
5
Kubernetes (K8s)
System for running and coordinating containerized applications across a cluster of machines
referred from: https://cloud.google.com/kubernetes-engine/kubernetes-comic/
6
Run Solr Cloud within Kubernetes
Load Balancer / Ingress
(external IPs / custom route names)
Headless Service
for internal
communication
Service
IP is exposed
solr-0 solr-1 solr-2
…more solr pods
Service
IP is exposed
Headless Service
for internal
communication
zk-0 zk-1 zk-2
pv-0 pv-1 pv-2
pv-0 pv-1 pv-2
Stateful Set Stateful Set
HTTP Traffic
pv
persistent volume
7
Solr Cloud Clusters Within Kubernetes
Namespace A Namespace B Namespace C
Namespace D Namespace E
Single
Kubernetes
Cluster
Solr Cloud
Cluster
Solr Cloud
Cluster
Solr Cloud
Cluster
Solr Cloud
Cluster
Solr Cloud
Cluster
8
9
10
K8s Horizontal Pod Autoscaling
N1 N2 …...
User Traffic
Metrics Monitoring System
Custom Metric API
( Queries Per Sec )
External Layer
Solr Autoscaling
R1 R2 …...
Scaling Solr Clusters w/o Manual Intervention
11
Monitoring with Prometheus & Grafana
Prometheus helm chart: https://github.com/helm/charts/tree/master/stable/prometheus
apiVersion:
monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: solr
spec:
selector:
matchLabels:
app: solr
● Prometheus Operator:
Uses Custom Resource Definition (CRD), named ServiceMonitor,
to abstract configuration to target.
K8s Services
Monitor
Prometheus AlertManager
Manage
K8s Deployment
Grafana
12
Monitoring with Prometheus & Grafana
Kubernetes State Metrics
13
Monitoring with Prometheus & Grafana
Solr Metrics
14
Custom Metrics via Prometheus Adapter
Prometheus helm chart: https://github.com/helm/charts/tree/master/stable/prometheus
apiVersion: v1
kind: ConfigMap
metadata:
name: adapter-config
namespace: monitoring
data:
config.yaml: |
rules:
- seriesQuery: solr_requests
resources:
overrides:
kubernetes_namespace:
resource: namespace
kubernetes_pod_name:
resource: pod
name:
matches: "^(.*)_requests"
as: "${1}_requests"
metricsQuery: (<<.Series>>{<<.LabelMatchers>>})
● Prometheus Adapter:
Pull custom metrics from Prometheus installation.
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: custom-metrics-apiserver
name: custom-metrics-apiserver
namespace: monitoring
spec:
replicas: 1
selector:
matchLabels:
app: custom-metrics-apiserver
template:
metadata:
labels:
app: custom-metrics-apiserver
name: custom-metrics-apiserver
……..
……..
15
Custom Metrics via Prometheus Adapter
Prometheus helm chart: https://github.com/helm/charts/tree/master/stable/prometheus
● Register custom metrics as external to K8s.
apiVersion: v1
kind: Service
metadata:
name: custom-metrics-apiserver
namespace: monitoring
spec:
ports:
- port: 443
targetPort: 6443
selector:
app: custom-metrics-apiserver
---
apiVersion: apiregistration.k8s.io/v1beta1
kind: APIService
metadata:
name: v1beta1.custom.metrics.k8s.io
spec:
service:
name: custom-metrics-apiserver
namespace: monitoring
root$ kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta1"
| jq .
{
"kind": "APIResourceList",
"apiVersion": "v1",
"groupVersion": "custom.metrics.k8s.io/v1beta1",
"resources": [
{
"name": "pods/queries_requests",
"singularName": "",
"namespaced": true,
"kind": "MetricValueList",
"verbs": [
"get"
]
},
{
"name": "namespaces/queries_requests,
"singularName": "",
"namespaced": false,
16
Custom Metrics via Commercial Monitoring Applications
17
K8s Horizontal Pod Autoscaling
solr-0 solr-1 solr-2
Stateful Set
Horizontal Pod Autoscaling
(HPA) on metric ‘M’
If metric ‘M’ value > X,
Add more pods
avg metric ‘M’ value < X
solr-0 solr-1 solr-2
Stateful Set
solr-3
until avg metric ‘M’ value < X
18
K8s Horizontal Pod Autoscaling
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: solr-hpa
namespace: solr
spec:
scaleTargetRef:
apiVersion: extensions/v1beta1
kind: Statefulset
name: solr-statefulset
minReplicas: 3
maxReplicas: 10
metrics:
- type: Pods
pods:
metricName: pods/query_requests
targetAverageValue: 2000
root$ kubectl describe hpa
Name: solr-hpa
Namespace: solr
Labels: <none>
Annotations: autoscaling.alpha.kubernetes.io/metrics:
[{"type":"Pods","pods":{"metricName":"pods/query_requests","targetAverageValue":"500"}}]
kubectl.kubernetes.io/last-applied-configuration:
{"apiVersion":"autoscaling/v2beta1","kind":"HorizontalPodAutoscaler","metadata":{"annotations":{},"nam
e":"solr-hpa","namespace":"s...
CreationTimestamp: Thu, 14 Aug 2020 11:11:05 -0800
Reference: Statefulset/solr-statefulset
Min replicas: 3
Max replicas: 10
Deployment pods: 0 current / 0 desired
Events: <none>
19
Solr Autoscaling
• Autoscaling in Solr provide balanced and stable cluster for various cluster change events.
• Achieved by satisfying a set of rules and sorting preferences
to select the target of cluster management operations.
S - A
S - B
R - 1
R - 1
R - 2
C
R - 2
Set solr-autoscaling policy and trigger
such that -
Add one replica to each shard of
collection
● if new Node is added
C - collection
S - shard
R - replica
20
Solr Autoscaling
Set solr-autoscaling policy and trigger such that -
Add one replica to each shard of collection
● if new Node is added "node_added_trigger":{
"event":"nodeAdded",
"waitFor":60,
"preferredOperation":"ADDREPLICA",
"actions":[
{
"name":"compute_plan",
"class":"solr.ComputePlanAction"},
{
"name":"execute_plan",
"class":"solr.ExecutePlanAction"}],
}
Trigger Policy
{
"cluster-policy":[
{
"node":"#ANY",
"replica":"<2",
"shard":"#EACH"}
]
}
Cluster Policy
21
Handling Special Cases
● What happens when nodes are removed due to scaling?
Is there a potential of losing data?
○ All replicas of collection gets hosted on scaled nodes.
● Do we need to scale on each collection on the entire cluster?
How to configure scaling on specific collection or set of collections with
common attribute?
● How does the Node Added Trigger behaves when a node gets restarted?
Replicas will be added to each shard of each collection where it was
previously not.
22
Lucidworks Managed Search
23
References
● Lucidworks Managed Search - https://lucidworks.com/products/managed-search/
● Docker - https://www.docker.com/
● Kubernetes - https://kubernetes.io/
● Run Solr on Kubernetes - https://lucidworks.com/post/running-solr-on-kubernetes-part-1/
● Monitoring Apache Solr Ecosystem on K8s -
https://www.youtube.com/watch?v=UI9mh4gSIsw
● Custom Metrics via Prometheus on K8s -
https://towardsdatascience.com/kubernetes-hpa-with-custom-metrics-from-prometheus-9f
fc201991e
● K8s HPA -https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/
● Solr Autoscaling -
https://lucene.apache.org/solr/guide/8_5/solrcloud-autoscaling-policy-preferences.html
Thank You
@sarkaramrit2

Weitere ähnliche Inhalte

Was ist angesagt?

DevOps Fest 2019. Alex Casalboni. Configuration management and service discov...
DevOps Fest 2019. Alex Casalboni. Configuration management and service discov...DevOps Fest 2019. Alex Casalboni. Configuration management and service discov...
DevOps Fest 2019. Alex Casalboni. Configuration management and service discov...
DevOps_Fest
 
NEW LAUNCH! Advanced Task Scheduling with Amazon ECS and Blox
NEW LAUNCH! Advanced Task Scheduling with Amazon ECS and BloxNEW LAUNCH! Advanced Task Scheduling with Amazon ECS and Blox
NEW LAUNCH! Advanced Task Scheduling with Amazon ECS and Blox
Amazon Web Services
 
Alex Casalboni - Configuration management and service discovery - Codemotion ...
Alex Casalboni - Configuration management and service discovery - Codemotion ...Alex Casalboni - Configuration management and service discovery - Codemotion ...
Alex Casalboni - Configuration management and service discovery - Codemotion ...
Codemotion
 
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
Amazon Web Services
 
Heat and its resources
Heat and its resourcesHeat and its resources
Heat and its resources
Sangeeth Kumar
 
Heat up your stack
Heat up your stackHeat up your stack
Heat up your stack
Rico Lin
 
AWS Presents: Infrastructure as Code on AWS - ChefConf 2015
AWS Presents: Infrastructure as Code on AWS - ChefConf 2015AWS Presents: Infrastructure as Code on AWS - ChefConf 2015
AWS Presents: Infrastructure as Code on AWS - ChefConf 2015
Chef
 
Azure Service Bus Queue Scala API
Azure Service Bus Queue Scala APIAzure Service Bus Queue Scala API
Azure Service Bus Queue Scala API
Braja Krishna Das
 
Orchestrating the Cloud
Orchestrating the CloudOrchestrating the Cloud
Orchestrating the Cloud
Amazon Web Services
 
From Big to Fast Data. How #kafka and #kafka-connect can redefine you ETL and...
From Big to Fast Data. How #kafka and #kafka-connect can redefine you ETL and...From Big to Fast Data. How #kafka and #kafka-connect can redefine you ETL and...
From Big to Fast Data. How #kafka and #kafka-connect can redefine you ETL and...
Landoop Ltd
 
Refactoring terraform
Refactoring terraformRefactoring terraform
Refactoring terraform
Nell Shamrell-Harrington
 
Robust Operations of Kafka Streams
Robust Operations of Kafka StreamsRobust Operations of Kafka Streams
Robust Operations of Kafka Streams
confluent
 
Cron in der Cloud - Die Top 10 Hitparade
Cron in der Cloud - Die Top 10 HitparadeCron in der Cloud - Die Top 10 Hitparade
Cron in der Cloud - Die Top 10 Hitparade
QAware GmbH
 
AWS CloudFormation Intrinsic Functions and Mappings
AWS CloudFormation Intrinsic Functions and Mappings AWS CloudFormation Intrinsic Functions and Mappings
AWS CloudFormation Intrinsic Functions and Mappings
Adam Book
 
Basics Of Servlet
Basics Of ServletBasics Of Servlet
Basics Of Servlet
Shubhani Jain
 
AWS CloudFormation Masterclass
AWS CloudFormation MasterclassAWS CloudFormation Masterclass
AWS CloudFormation Masterclass
Amazon Web Services
 
Deploying a Kubernetes App with Amazon EKS
Deploying a Kubernetes App with Amazon EKSDeploying a Kubernetes App with Amazon EKS
Deploying a Kubernetes App with Amazon EKS
Laura Frank Tacho
 
(APP306) Using AWS CloudFormation for Deployment and Management at Scale | AW...
(APP306) Using AWS CloudFormation for Deployment and Management at Scale | AW...(APP306) Using AWS CloudFormation for Deployment and Management at Scale | AW...
(APP306) Using AWS CloudFormation for Deployment and Management at Scale | AW...
Amazon Web Services
 
CON420 Infrastructure as code for containers
CON420 Infrastructure as code for containersCON420 Infrastructure as code for containers
CON420 Infrastructure as code for containers
Nathan Peck
 
Disaster Recovery Site on AWS - Minimal Cost Maximum Efficiency (STG305) | AW...
Disaster Recovery Site on AWS - Minimal Cost Maximum Efficiency (STG305) | AW...Disaster Recovery Site on AWS - Minimal Cost Maximum Efficiency (STG305) | AW...
Disaster Recovery Site on AWS - Minimal Cost Maximum Efficiency (STG305) | AW...
Amazon Web Services
 

Was ist angesagt? (20)

DevOps Fest 2019. Alex Casalboni. Configuration management and service discov...
DevOps Fest 2019. Alex Casalboni. Configuration management and service discov...DevOps Fest 2019. Alex Casalboni. Configuration management and service discov...
DevOps Fest 2019. Alex Casalboni. Configuration management and service discov...
 
NEW LAUNCH! Advanced Task Scheduling with Amazon ECS and Blox
NEW LAUNCH! Advanced Task Scheduling with Amazon ECS and BloxNEW LAUNCH! Advanced Task Scheduling with Amazon ECS and Blox
NEW LAUNCH! Advanced Task Scheduling with Amazon ECS and Blox
 
Alex Casalboni - Configuration management and service discovery - Codemotion ...
Alex Casalboni - Configuration management and service discovery - Codemotion ...Alex Casalboni - Configuration management and service discovery - Codemotion ...
Alex Casalboni - Configuration management and service discovery - Codemotion ...
 
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
 
Heat and its resources
Heat and its resourcesHeat and its resources
Heat and its resources
 
Heat up your stack
Heat up your stackHeat up your stack
Heat up your stack
 
AWS Presents: Infrastructure as Code on AWS - ChefConf 2015
AWS Presents: Infrastructure as Code on AWS - ChefConf 2015AWS Presents: Infrastructure as Code on AWS - ChefConf 2015
AWS Presents: Infrastructure as Code on AWS - ChefConf 2015
 
Azure Service Bus Queue Scala API
Azure Service Bus Queue Scala APIAzure Service Bus Queue Scala API
Azure Service Bus Queue Scala API
 
Orchestrating the Cloud
Orchestrating the CloudOrchestrating the Cloud
Orchestrating the Cloud
 
From Big to Fast Data. How #kafka and #kafka-connect can redefine you ETL and...
From Big to Fast Data. How #kafka and #kafka-connect can redefine you ETL and...From Big to Fast Data. How #kafka and #kafka-connect can redefine you ETL and...
From Big to Fast Data. How #kafka and #kafka-connect can redefine you ETL and...
 
Refactoring terraform
Refactoring terraformRefactoring terraform
Refactoring terraform
 
Robust Operations of Kafka Streams
Robust Operations of Kafka StreamsRobust Operations of Kafka Streams
Robust Operations of Kafka Streams
 
Cron in der Cloud - Die Top 10 Hitparade
Cron in der Cloud - Die Top 10 HitparadeCron in der Cloud - Die Top 10 Hitparade
Cron in der Cloud - Die Top 10 Hitparade
 
AWS CloudFormation Intrinsic Functions and Mappings
AWS CloudFormation Intrinsic Functions and Mappings AWS CloudFormation Intrinsic Functions and Mappings
AWS CloudFormation Intrinsic Functions and Mappings
 
Basics Of Servlet
Basics Of ServletBasics Of Servlet
Basics Of Servlet
 
AWS CloudFormation Masterclass
AWS CloudFormation MasterclassAWS CloudFormation Masterclass
AWS CloudFormation Masterclass
 
Deploying a Kubernetes App with Amazon EKS
Deploying a Kubernetes App with Amazon EKSDeploying a Kubernetes App with Amazon EKS
Deploying a Kubernetes App with Amazon EKS
 
(APP306) Using AWS CloudFormation for Deployment and Management at Scale | AW...
(APP306) Using AWS CloudFormation for Deployment and Management at Scale | AW...(APP306) Using AWS CloudFormation for Deployment and Management at Scale | AW...
(APP306) Using AWS CloudFormation for Deployment and Management at Scale | AW...
 
CON420 Infrastructure as code for containers
CON420 Infrastructure as code for containersCON420 Infrastructure as code for containers
CON420 Infrastructure as code for containers
 
Disaster Recovery Site on AWS - Minimal Cost Maximum Efficiency (STG305) | AW...
Disaster Recovery Site on AWS - Minimal Cost Maximum Efficiency (STG305) | AW...Disaster Recovery Site on AWS - Minimal Cost Maximum Efficiency (STG305) | AW...
Disaster Recovery Site on AWS - Minimal Cost Maximum Efficiency (STG305) | AW...
 

Ähnlich wie Scaling search-clusters-solr-k8s-2020-amrit-sarkar

Introduction to Kubernetes RBAC
Introduction to Kubernetes RBACIntroduction to Kubernetes RBAC
Introduction to Kubernetes RBAC
Kublr
 
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB
 
Securing & Monitoring Your K8s Cluster with RBAC and Prometheus”.
Securing & Monitoring Your K8s Cluster with RBAC and Prometheus”.Securing & Monitoring Your K8s Cluster with RBAC and Prometheus”.
Securing & Monitoring Your K8s Cluster with RBAC and Prometheus”.
Opcito Technologies
 
Kubernetes Cluster API - managing the infrastructure of multi clusters (k8s ...
Kubernetes Cluster API - managing the infrastructure of  multi clusters (k8s ...Kubernetes Cluster API - managing the infrastructure of  multi clusters (k8s ...
Kubernetes Cluster API - managing the infrastructure of multi clusters (k8s ...
Tobias Schneck
 
Openstack days sv building highly available services using kubernetes (preso)
Openstack days sv   building highly available services using kubernetes (preso)Openstack days sv   building highly available services using kubernetes (preso)
Openstack days sv building highly available services using kubernetes (preso)
Allan Naim
 
Consolidating Infrastructure with Azure Kubernetes Service - MS Online Tech F...
Consolidating Infrastructure with Azure Kubernetes Service - MS Online Tech F...Consolidating Infrastructure with Azure Kubernetes Service - MS Online Tech F...
Consolidating Infrastructure with Azure Kubernetes Service - MS Online Tech F...
Davide Benvegnù
 
Deploying deep learning models with Kubernetes and Kubeflow
Deploying deep learning models with Kubernetes and KubeflowDeploying deep learning models with Kubernetes and Kubeflow
Deploying deep learning models with Kubernetes and Kubeflow
DataPhoenix
 
Building the TribefireOperator
Building the TribefireOperatorBuilding the TribefireOperator
Building the TribefireOperator
Oliver Moser
 
Kuryr-Kubernetes: The perfect match for networking cloud native workloads - I...
Kuryr-Kubernetes: The perfect match for networking cloud native workloads - I...Kuryr-Kubernetes: The perfect match for networking cloud native workloads - I...
Kuryr-Kubernetes: The perfect match for networking cloud native workloads - I...
Cloud Native Day Tel Aviv
 
Container orchestration k8s azure kubernetes services
Container orchestration  k8s azure kubernetes servicesContainer orchestration  k8s azure kubernetes services
Container orchestration k8s azure kubernetes services
Rajesh Kolla
 
Appsecco Kubernetes Hacking Masterclass Presentation Slides
Appsecco Kubernetes Hacking Masterclass Presentation SlidesAppsecco Kubernetes Hacking Masterclass Presentation Slides
Appsecco Kubernetes Hacking Masterclass Presentation Slides
Appsecco
 
Kubernetes @ Nanit by Chen Fisher
Kubernetes @ Nanit by Chen FisherKubernetes @ Nanit by Chen Fisher
Kubernetes @ Nanit by Chen Fisher
DoiT International
 
Meetup 12-12-2017 - Application Isolation on Kubernetes
Meetup 12-12-2017 - Application Isolation on KubernetesMeetup 12-12-2017 - Application Isolation on Kubernetes
Meetup 12-12-2017 - Application Isolation on Kubernetes
dtoledo67
 
Deploy an Elastic, Resilient, Load-Balanced Cluster in 5 Minutes with Senlin
Deploy an Elastic, Resilient, Load-Balanced Cluster in 5 Minutes with SenlinDeploy an Elastic, Resilient, Load-Balanced Cluster in 5 Minutes with Senlin
Deploy an Elastic, Resilient, Load-Balanced Cluster in 5 Minutes with Senlin
Qiming Teng
 
Kubernetes @ Nanit
Kubernetes @ NanitKubernetes @ Nanit
Kubernetes @ Nanit
Chen Fisher
 
Serverless Machine Learning Model Inference on Kubernetes with KServe.pdf
Serverless Machine Learning Model Inference on Kubernetes with KServe.pdfServerless Machine Learning Model Inference on Kubernetes with KServe.pdf
Serverless Machine Learning Model Inference on Kubernetes with KServe.pdf
Stavros Kontopoulos
 
Node Interactive: Node.js Performance and Highly Scalable Micro-Services
Node Interactive: Node.js Performance and Highly Scalable Micro-ServicesNode Interactive: Node.js Performance and Highly Scalable Micro-Services
Node Interactive: Node.js Performance and Highly Scalable Micro-Services
Chris Bailey
 
Deploying Kafka Streams Applications with Docker and Kubernetes
Deploying Kafka Streams Applications with Docker and KubernetesDeploying Kafka Streams Applications with Docker and Kubernetes
Deploying Kafka Streams Applications with Docker and Kubernetes
confluent
 
Aplicaciones distribuidas con Dapr
Aplicaciones distribuidas con DaprAplicaciones distribuidas con Dapr
Aplicaciones distribuidas con Dapr
César Jesús Angulo Gasco
 
Operator SDK for K8s using Go
Operator SDK for K8s using GoOperator SDK for K8s using Go
Operator SDK for K8s using Go
CloudOps2005
 

Ähnlich wie Scaling search-clusters-solr-k8s-2020-amrit-sarkar (20)

Introduction to Kubernetes RBAC
Introduction to Kubernetes RBACIntroduction to Kubernetes RBAC
Introduction to Kubernetes RBAC
 
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
 
Securing & Monitoring Your K8s Cluster with RBAC and Prometheus”.
Securing & Monitoring Your K8s Cluster with RBAC and Prometheus”.Securing & Monitoring Your K8s Cluster with RBAC and Prometheus”.
Securing & Monitoring Your K8s Cluster with RBAC and Prometheus”.
 
Kubernetes Cluster API - managing the infrastructure of multi clusters (k8s ...
Kubernetes Cluster API - managing the infrastructure of  multi clusters (k8s ...Kubernetes Cluster API - managing the infrastructure of  multi clusters (k8s ...
Kubernetes Cluster API - managing the infrastructure of multi clusters (k8s ...
 
Openstack days sv building highly available services using kubernetes (preso)
Openstack days sv   building highly available services using kubernetes (preso)Openstack days sv   building highly available services using kubernetes (preso)
Openstack days sv building highly available services using kubernetes (preso)
 
Consolidating Infrastructure with Azure Kubernetes Service - MS Online Tech F...
Consolidating Infrastructure with Azure Kubernetes Service - MS Online Tech F...Consolidating Infrastructure with Azure Kubernetes Service - MS Online Tech F...
Consolidating Infrastructure with Azure Kubernetes Service - MS Online Tech F...
 
Deploying deep learning models with Kubernetes and Kubeflow
Deploying deep learning models with Kubernetes and KubeflowDeploying deep learning models with Kubernetes and Kubeflow
Deploying deep learning models with Kubernetes and Kubeflow
 
Building the TribefireOperator
Building the TribefireOperatorBuilding the TribefireOperator
Building the TribefireOperator
 
Kuryr-Kubernetes: The perfect match for networking cloud native workloads - I...
Kuryr-Kubernetes: The perfect match for networking cloud native workloads - I...Kuryr-Kubernetes: The perfect match for networking cloud native workloads - I...
Kuryr-Kubernetes: The perfect match for networking cloud native workloads - I...
 
Container orchestration k8s azure kubernetes services
Container orchestration  k8s azure kubernetes servicesContainer orchestration  k8s azure kubernetes services
Container orchestration k8s azure kubernetes services
 
Appsecco Kubernetes Hacking Masterclass Presentation Slides
Appsecco Kubernetes Hacking Masterclass Presentation SlidesAppsecco Kubernetes Hacking Masterclass Presentation Slides
Appsecco Kubernetes Hacking Masterclass Presentation Slides
 
Kubernetes @ Nanit by Chen Fisher
Kubernetes @ Nanit by Chen FisherKubernetes @ Nanit by Chen Fisher
Kubernetes @ Nanit by Chen Fisher
 
Meetup 12-12-2017 - Application Isolation on Kubernetes
Meetup 12-12-2017 - Application Isolation on KubernetesMeetup 12-12-2017 - Application Isolation on Kubernetes
Meetup 12-12-2017 - Application Isolation on Kubernetes
 
Deploy an Elastic, Resilient, Load-Balanced Cluster in 5 Minutes with Senlin
Deploy an Elastic, Resilient, Load-Balanced Cluster in 5 Minutes with SenlinDeploy an Elastic, Resilient, Load-Balanced Cluster in 5 Minutes with Senlin
Deploy an Elastic, Resilient, Load-Balanced Cluster in 5 Minutes with Senlin
 
Kubernetes @ Nanit
Kubernetes @ NanitKubernetes @ Nanit
Kubernetes @ Nanit
 
Serverless Machine Learning Model Inference on Kubernetes with KServe.pdf
Serverless Machine Learning Model Inference on Kubernetes with KServe.pdfServerless Machine Learning Model Inference on Kubernetes with KServe.pdf
Serverless Machine Learning Model Inference on Kubernetes with KServe.pdf
 
Node Interactive: Node.js Performance and Highly Scalable Micro-Services
Node Interactive: Node.js Performance and Highly Scalable Micro-ServicesNode Interactive: Node.js Performance and Highly Scalable Micro-Services
Node Interactive: Node.js Performance and Highly Scalable Micro-Services
 
Deploying Kafka Streams Applications with Docker and Kubernetes
Deploying Kafka Streams Applications with Docker and KubernetesDeploying Kafka Streams Applications with Docker and Kubernetes
Deploying Kafka Streams Applications with Docker and Kubernetes
 
Aplicaciones distribuidas con Dapr
Aplicaciones distribuidas con DaprAplicaciones distribuidas con Dapr
Aplicaciones distribuidas con Dapr
 
Operator SDK for K8s using Go
Operator SDK for K8s using GoOperator SDK for K8s using Go
Operator SDK for K8s using Go
 

Kürzlich hochgeladen

Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Sinan KOZAK
 
Data Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason WebinarData Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason Webinar
UReason
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
Madan Karki
 
Welding Metallurgy Ferrous Materials.pdf
Welding Metallurgy Ferrous Materials.pdfWelding Metallurgy Ferrous Materials.pdf
Welding Metallurgy Ferrous Materials.pdf
AjmalKhan50578
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
Atif Razi
 
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.pptUnit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
KrishnaveniKrishnara1
 
ITSM Integration with MuleSoft.pptx
ITSM  Integration with MuleSoft.pptxITSM  Integration with MuleSoft.pptx
ITSM Integration with MuleSoft.pptx
VANDANAMOHANGOUDA
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
IJECEIAES
 
artificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptxartificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptx
GauravCar
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
IJECEIAES
 
Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...
bijceesjournal
 
Software Quality Assurance-se412-v11.ppt
Software Quality Assurance-se412-v11.pptSoftware Quality Assurance-se412-v11.ppt
Software Quality Assurance-se412-v11.ppt
TaghreedAltamimi
 
Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
Nada Hikmah
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
171ticu
 
People as resource Grade IX.pdf minimala
People as resource Grade IX.pdf minimalaPeople as resource Grade IX.pdf minimala
People as resource Grade IX.pdf minimala
riddhimaagrawal986
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
Yasser Mahgoub
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
VICTOR MAESTRE RAMIREZ
 

Kürzlich hochgeladen (20)

Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
 
Data Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason WebinarData Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason Webinar
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
 
Welding Metallurgy Ferrous Materials.pdf
Welding Metallurgy Ferrous Materials.pdfWelding Metallurgy Ferrous Materials.pdf
Welding Metallurgy Ferrous Materials.pdf
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
 
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.pptUnit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
 
ITSM Integration with MuleSoft.pptx
ITSM  Integration with MuleSoft.pptxITSM  Integration with MuleSoft.pptx
ITSM Integration with MuleSoft.pptx
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
 
artificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptxartificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptx
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
 
Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...Rainfall intensity duration frequency curve statistical analysis and modeling...
Rainfall intensity duration frequency curve statistical analysis and modeling...
 
Software Quality Assurance-se412-v11.ppt
Software Quality Assurance-se412-v11.pptSoftware Quality Assurance-se412-v11.ppt
Software Quality Assurance-se412-v11.ppt
 
Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
 
People as resource Grade IX.pdf minimala
People as resource Grade IX.pdf minimalaPeople as resource Grade IX.pdf minimala
People as resource Grade IX.pdf minimala
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
 

Scaling search-clusters-solr-k8s-2020-amrit-sarkar

  • 1. Scaling Search Clusters with Apache Solr & Kubernetes Amrit Sarkar Engineer, Cloud Operations Lucidworks Inc
  • 2.
  • 5. 5 Kubernetes (K8s) System for running and coordinating containerized applications across a cluster of machines referred from: https://cloud.google.com/kubernetes-engine/kubernetes-comic/
  • 6. 6 Run Solr Cloud within Kubernetes Load Balancer / Ingress (external IPs / custom route names) Headless Service for internal communication Service IP is exposed solr-0 solr-1 solr-2 …more solr pods Service IP is exposed Headless Service for internal communication zk-0 zk-1 zk-2 pv-0 pv-1 pv-2 pv-0 pv-1 pv-2 Stateful Set Stateful Set HTTP Traffic pv persistent volume
  • 7. 7 Solr Cloud Clusters Within Kubernetes Namespace A Namespace B Namespace C Namespace D Namespace E Single Kubernetes Cluster Solr Cloud Cluster Solr Cloud Cluster Solr Cloud Cluster Solr Cloud Cluster Solr Cloud Cluster
  • 8. 8
  • 9. 9
  • 10. 10 K8s Horizontal Pod Autoscaling N1 N2 …... User Traffic Metrics Monitoring System Custom Metric API ( Queries Per Sec ) External Layer Solr Autoscaling R1 R2 …... Scaling Solr Clusters w/o Manual Intervention
  • 11. 11 Monitoring with Prometheus & Grafana Prometheus helm chart: https://github.com/helm/charts/tree/master/stable/prometheus apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: solr spec: selector: matchLabels: app: solr ● Prometheus Operator: Uses Custom Resource Definition (CRD), named ServiceMonitor, to abstract configuration to target. K8s Services Monitor Prometheus AlertManager Manage K8s Deployment Grafana
  • 12. 12 Monitoring with Prometheus & Grafana Kubernetes State Metrics
  • 13. 13 Monitoring with Prometheus & Grafana Solr Metrics
  • 14. 14 Custom Metrics via Prometheus Adapter Prometheus helm chart: https://github.com/helm/charts/tree/master/stable/prometheus apiVersion: v1 kind: ConfigMap metadata: name: adapter-config namespace: monitoring data: config.yaml: | rules: - seriesQuery: solr_requests resources: overrides: kubernetes_namespace: resource: namespace kubernetes_pod_name: resource: pod name: matches: "^(.*)_requests" as: "${1}_requests" metricsQuery: (<<.Series>>{<<.LabelMatchers>>}) ● Prometheus Adapter: Pull custom metrics from Prometheus installation. apiVersion: apps/v1 kind: Deployment metadata: labels: app: custom-metrics-apiserver name: custom-metrics-apiserver namespace: monitoring spec: replicas: 1 selector: matchLabels: app: custom-metrics-apiserver template: metadata: labels: app: custom-metrics-apiserver name: custom-metrics-apiserver …….. ……..
  • 15. 15 Custom Metrics via Prometheus Adapter Prometheus helm chart: https://github.com/helm/charts/tree/master/stable/prometheus ● Register custom metrics as external to K8s. apiVersion: v1 kind: Service metadata: name: custom-metrics-apiserver namespace: monitoring spec: ports: - port: 443 targetPort: 6443 selector: app: custom-metrics-apiserver --- apiVersion: apiregistration.k8s.io/v1beta1 kind: APIService metadata: name: v1beta1.custom.metrics.k8s.io spec: service: name: custom-metrics-apiserver namespace: monitoring root$ kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta1" | jq . { "kind": "APIResourceList", "apiVersion": "v1", "groupVersion": "custom.metrics.k8s.io/v1beta1", "resources": [ { "name": "pods/queries_requests", "singularName": "", "namespaced": true, "kind": "MetricValueList", "verbs": [ "get" ] }, { "name": "namespaces/queries_requests, "singularName": "", "namespaced": false,
  • 16. 16 Custom Metrics via Commercial Monitoring Applications
  • 17. 17 K8s Horizontal Pod Autoscaling solr-0 solr-1 solr-2 Stateful Set Horizontal Pod Autoscaling (HPA) on metric ‘M’ If metric ‘M’ value > X, Add more pods avg metric ‘M’ value < X solr-0 solr-1 solr-2 Stateful Set solr-3 until avg metric ‘M’ value < X
  • 18. 18 K8s Horizontal Pod Autoscaling apiVersion: autoscaling/v2beta1 kind: HorizontalPodAutoscaler metadata: name: solr-hpa namespace: solr spec: scaleTargetRef: apiVersion: extensions/v1beta1 kind: Statefulset name: solr-statefulset minReplicas: 3 maxReplicas: 10 metrics: - type: Pods pods: metricName: pods/query_requests targetAverageValue: 2000 root$ kubectl describe hpa Name: solr-hpa Namespace: solr Labels: <none> Annotations: autoscaling.alpha.kubernetes.io/metrics: [{"type":"Pods","pods":{"metricName":"pods/query_requests","targetAverageValue":"500"}}] kubectl.kubernetes.io/last-applied-configuration: {"apiVersion":"autoscaling/v2beta1","kind":"HorizontalPodAutoscaler","metadata":{"annotations":{},"nam e":"solr-hpa","namespace":"s... CreationTimestamp: Thu, 14 Aug 2020 11:11:05 -0800 Reference: Statefulset/solr-statefulset Min replicas: 3 Max replicas: 10 Deployment pods: 0 current / 0 desired Events: <none>
  • 19. 19 Solr Autoscaling • Autoscaling in Solr provide balanced and stable cluster for various cluster change events. • Achieved by satisfying a set of rules and sorting preferences to select the target of cluster management operations. S - A S - B R - 1 R - 1 R - 2 C R - 2 Set solr-autoscaling policy and trigger such that - Add one replica to each shard of collection ● if new Node is added C - collection S - shard R - replica
  • 20. 20 Solr Autoscaling Set solr-autoscaling policy and trigger such that - Add one replica to each shard of collection ● if new Node is added "node_added_trigger":{ "event":"nodeAdded", "waitFor":60, "preferredOperation":"ADDREPLICA", "actions":[ { "name":"compute_plan", "class":"solr.ComputePlanAction"}, { "name":"execute_plan", "class":"solr.ExecutePlanAction"}], } Trigger Policy { "cluster-policy":[ { "node":"#ANY", "replica":"<2", "shard":"#EACH"} ] } Cluster Policy
  • 21. 21 Handling Special Cases ● What happens when nodes are removed due to scaling? Is there a potential of losing data? ○ All replicas of collection gets hosted on scaled nodes. ● Do we need to scale on each collection on the entire cluster? How to configure scaling on specific collection or set of collections with common attribute? ● How does the Node Added Trigger behaves when a node gets restarted? Replicas will be added to each shard of each collection where it was previously not.
  • 23. 23 References ● Lucidworks Managed Search - https://lucidworks.com/products/managed-search/ ● Docker - https://www.docker.com/ ● Kubernetes - https://kubernetes.io/ ● Run Solr on Kubernetes - https://lucidworks.com/post/running-solr-on-kubernetes-part-1/ ● Monitoring Apache Solr Ecosystem on K8s - https://www.youtube.com/watch?v=UI9mh4gSIsw ● Custom Metrics via Prometheus on K8s - https://towardsdatascience.com/kubernetes-hpa-with-custom-metrics-from-prometheus-9f fc201991e ● K8s HPA -https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/ ● Solr Autoscaling - https://lucene.apache.org/solr/guide/8_5/solrcloud-autoscaling-policy-preferences.html