You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: "Example: Deploying Cassandra with a StatefulSet"
3
-
reviewers:
4
-
- ahmetb
2
+
title: "例: StatefulSetを使用したCassandraのデプロイ"
5
3
content_type: tutorial
6
4
weight: 30
7
5
---
8
6
9
7
<!-- overview -->
10
-
This tutorial shows you how to run [Apache Cassandra](http://cassandra.apache.org/) on Kubernetes. Cassandra, a database, needs persistent storage to provide data durability (application _state_). In this example, a custom Cassandra seed provider lets the database discover new Cassandra instances as they join the Cassandra cluster.
*StatefulSets* make it easier to deploy stateful applications into your Kubernetes cluster. For more information on the features used in this tutorial, see [StatefulSet](/docs/concepts/workloads/controllers/statefulset/).
To complete this tutorial, you should already have a basic familiarity with {{< glossary_tooltip text="Pods" term_id="pod" >}}, {{< glossary_tooltip text="Services" term_id="service" >}}, and {{< glossary_tooltip text="StatefulSets" term_id="StatefulSet" >}}.
[Minikube](/docs/getting-started-guides/minikube/) defaults to 1024MiB of memory and 1 CPU. Running Minikube with the default resource configuration results in insufficient resource errors during this tutorial. To avoid these errors, start Minikube with the following settings:
In Kubernetes, a {{< glossary_tooltip text="Service" term_id="service" >}} describes a set of {{< glossary_tooltip text="Pods" term_id="pod" >}} that perform the same task.
If you don't see a Service named `cassandra`, that means creation failed. Read [Debug Services](/docs/tasks/debug-application-cluster/debug-service/) for help troubleshooting common issues.
This command opens an editor in your terminal. The line you need to change is the `replicas` field. The following sample is an excerpt of the StatefulSet file:
# Please edit the object below. Lines beginning with a '#' will be ignored,
189
178
# and an empty file will abort the edit. If an error occurs while saving this file will be
190
-
#reopened with the relevant failures.
179
+
#reopenedTranslate tutorials/stateful-application/cassandra/ into Japanese with the relevant failures.
191
180
#
192
181
apiVersion: apps/v1
193
182
kind: StatefulSet
@@ -204,17 +193,17 @@ Use `kubectl edit` to modify the size of a Cassandra StatefulSet.
204
193
replicas: 3
205
194
```
206
195
207
-
1. Change the number of replicas to 4, and then save the manifest.
196
+
1. レプリカ数を4に変更し、マニフェストを保存します。
208
197
209
-
The StatefulSet now scales to run with 4 Pods.
198
+
これで、StatefulSetが4つのPodを実行するようにスケールされました。
210
199
211
-
1. Get the Cassandra StatefulSet to verify your change:
200
+
1. CassandraのStatefulSetを取得して、変更を確かめます。
212
201
213
202
```shell
214
203
kubectl get statefulset cassandra
215
204
```
216
205
217
-
The response should be similar to:
206
+
結果は次のようになるはずです。
218
207
219
208
```
220
209
NAME DESIRED CURRENT AGE
@@ -225,13 +214,13 @@ Use `kubectl edit` to modify the size of a Cassandra StatefulSet.
225
214
226
215
## {{% heading "cleanup" %}}
227
216
228
-
Deleting or scaling a StatefulSet down does not delete the volumes associated with the StatefulSet. This setting is for your safety because your data is more valuable than automatically purging all related StatefulSet resources.
Depending on the storage class and reclaim policy, deleting the *PersistentVolumeClaims* may cause the associated volumes to also be deleted. Never assume you’ll be able to access data if its volume claims are deleted.
1. Run the following command to delete the Service you set up for Cassandra:
233
+
1. 次のコマンドを実行して、CassandraをセットアップしたServiceを削除します。
245
234
246
235
```shell
247
236
kubectl delete service -l app=cassandra
248
237
```
249
238
250
-
## Cassandra container environment variables
239
+
## Cassandraコンテナの環境変数
251
240
252
-
The Pods in this tutorial use the [`gcr.io/google-samples/cassandra:v13`](https://github.com/kubernetes/examples/blob/master/cassandra/image/Dockerfile)
253
-
image from Google's [container registry](https://cloud.google.com/container-registry/docs/).
254
-
The Docker image above is based on [debian-base](https://github.com/kubernetes/kubernetes/tree/master/build/debian-base)
@@ -268,9 +253,9 @@ By using environment variables you can change values that are inserted into `cas
268
253
## {{% heading "whatsnext" %}}
269
254
270
255
271
-
* Learn how to [Scale a StatefulSet](/docs/tasks/run-application/scale-stateful-set/).
272
-
* Learn more about the [*KubernetesSeedProvider*](https://github.com/kubernetes/examples/blob/master/cassandra/java/src/main/java/io/k8s/cassandra/KubernetesSeedProvider.java)
273
-
* See more custom [Seed Provider Configurations](https://git.k8s.io/examples/cassandra/java/README.md)
0 commit comments