Docker Cookbook


DATA: Building an S3-Compatible Object Store with Cassandra on Kubernetes | 315



Download 6,31 Mb.
Pdf ko'rish
bet245/260
Sana21.04.2022
Hajmi6,31 Mb.
#570749
1   ...   241   242   243   244   245   246   247   248   ...   260
Bog'liq
Docker Cookbook

10.4 DATA: Building an S3-Compatible Object Store with Cassandra on Kubernetes | 315


$ git clone https://github.com/how2dock/dockbook.git
$ cd ch05/examples
Since Kubernetes is a fast evolving software, the API is changing
quickly. The 
pod

replication controller
, and 
service
specification
files may need to be adapted to the latest API version.
Then launch the Cassandra replication controller, increase the number of replicas,
and launch the service:
$ kubectl create -f ./cassandra/cassandra-controller.yaml
$ kubectl scale --replicas=4 rc cassandra
$ kubectl create -f ./cassandra/cassandra-service.yaml
Once the image is downloaded, you will have your Kubernetes pods in a running
state. Note that the image currently used comes from the Google registry. That’s
because this image contains a discovery class specified in the Cassandra configura‐
tion. You could use the Cassandra image from Docker Hub but would have to put
that Java class in there to allow all Cassandra nodes to discover each other. Changing
the number of replicas allows you to scale your Cassandra cluster, and starting a ser‐
vice allows you to expose a DNS endpoint for it.
Check that the specified number of pods is running:
$ kubectl get pods --selector="name=cassandra"
Once Cassandra discovers all nodes and rebalances the database storage, you will get
something like this (it will depend on the number of replicas you set, and the IDs will
change):
$ ./kubectl exec cassandra-5f709 -c cassandra nodetool status
Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address Load Tokens Owns (effective) Host ID Rack
UN 10.16.2.4 84.32 KB 256 46.0% 8a0c8663-074f-4987... rack1
UN 10.16.1.3 67.81 KB 256 53.7% 784c8f4d-7722-4d16... rack1
UN 10.16.0.3 51.37 KB 256 49.7% 2f551b3e-9314-4f12... rack1
UN 10.16.3.3 65.67 KB 256 50.6% a746b8b3-984f-4b1e... rack1
You can access the logs of a container in a pod with the handy
kubectl logs
command.

Download 6,31 Mb.

Do'stlaringiz bilan baham:
1   ...   241   242   243   244   245   246   247   248   ...   260




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish