0Pricing
gRPC & High Performance APIs · Ders

Durum Denetimi ve Hazırlık Yoklamaları

Yük dengeleyicilerin ve orkestratörlerin bir hizmetin trafiğe hazır olduğunu anlayabilmesi için standart gRPC durum denetimi protokolünü kullanın.

Durum Denetimi ve Hazırlık Yoklamaları, CoddyKit'te ücretsiz bir gRPC & High Performance APIs dersidir. Bu, 4 dersinin 4. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, gRPC & High Performance APIs öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. gRPC & High Performance APIs kursu toplamda 4 dersten oluşur.

Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.

Why Health Checks Matter

An orchestrator must know whether a service instance can handle requests. Sending traffic to a starting, overloaded, or broken instance causes errors.

The gRPC health checking protocol answers: is this service healthy?

The Standard Health Service

gRPC defines grpc.health.v1.Health with two methods:

  • Check — a one-shot status query
  • Watch — a stream of status updates

Status is SERVING, NOT_SERVING, or UNKNOWN.

Per-Service Status

A health request names a service. An empty name asks about the whole server; a specific name asks about one service, so you can report each independently.

Registering the Health Server (Go)

The health package provides a ready implementation you register on your server.

import 'google.golang.org/grpc/health'
import hpb 'google.golang.org/grpc/health/grpc_health_v1'

hs := health.NewServer()
hpb.RegisterHealthServer(s, hs)

Setting Status

Update status as your service transitions. Mark NOT_SERVING during startup or shutdown, then SERVING when ready.

hs.SetServingStatus('', hpb.HealthCheckResponse_SERVING)
hs.SetServingStatus('my.pkg.Orders', hpb.HealthCheckResponse_SERVING)

Readiness vs Liveness

Two distinct ideas:

  • Liveness: is the process alive? Restart if not.
  • Readiness: can it serve now? Remove from rotation if not, but do not restart.

Health status maps cleanly to readiness.

Kubernetes gRPC Probes

Kubernetes supports native gRPC probes. Point them at your health service.

readinessProbe:
  grpc:
    port: 9090
    service: my.pkg.Orders

Probing with grpc_health_probe

The grpc_health_probe binary lets you check health from a shell or older Kubernetes versions.

grpc_health_probe -addr=localhost:9090 -service=my.pkg.Orders

Watch for Live Updates

Smart load balancers use Watch to receive a stream of status changes, reacting instantly when an instance flips to NOT_SERVING instead of polling.

Graceful Shutdown

Before stopping, set status to NOT_SERVING and wait. Load balancers drain you out, in-flight requests finish, and clients avoid hitting a dying instance.

Tying Health to Dependencies

Report NOT_SERVING when a critical dependency (database, cache) is unreachable, so traffic routes only to instances that can actually do work.

Quick Check

Test your health-check knowledge.

Recap

You learned gRPC health checking:

  • The standard Health service offers Check and Watch
  • Status is per-service: SERVING, NOT_SERVING, UNKNOWN
  • Map health to readiness; pair with liveness probes
  • Kubernetes and grpc_health_probe consume it
  • Flip to NOT_SERVING for graceful drain and failed dependencies

Sıkça Sorulan Sorular

“Durum Denetimi ve Hazırlık Yoklamaları” dersi ücretsiz mi?

Evet — “Durum Denetimi ve Hazırlık Yoklamaları” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve gRPC & High Performance APIs kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. gRPC & High Performance APIs kursu toplamda 4 dersten oluşur.

“Durum Denetimi ve Hazırlık Yoklamaları” dersinde ne öğreneceğim?

Yük dengeleyicilerin ve orkestratörlerin bir hizmetin trafiğe hazır olduğunu anlayabilmesi için standart gRPC durum denetimi protokolünü kullanın. gRPC & High Performance APIs ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.

gRPC & High Performance APIs öğrenmeye başlamak için deneyim gerekli mi?

Önceden deneyim gerekmez. CoddyKit'te gRPC & High Performance APIs, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 4. dersidir.

“Durum Denetimi ve Hazırlık Yoklamaları” dersi ne kadar sürer?

Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.

Bu gRPC & High Performance APIs dersinde kod yazıp çalıştırabilir miyim?

Evet. Her gRPC & High Performance APIs dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.

Bu kursun tüm dersleri

  1. gRPC Etkileşimlerinde Günlük Kaydı
  2. OpenTelemetry ile İzleme
  3. gRPC Ölçümlerini İzleme
  4. Durum Denetimi ve Hazırlık Yoklamaları
← gRPC & High Performance APIs Sayfasına Dön