apache-ignite

Форк
0
97 строк · 2.5 Кб
1
// Licensed to the Apache Software Foundation (ASF) under one or more
2
// contributor license agreements.  See the NOTICE file distributed with
3
// this work for additional information regarding copyright ownership.
4
// The ASF licenses this file to You under the Apache License, Version 2.0
5
// (the "License"); you may not use this file except in compliance with
6
// the License.  You may obtain a copy of the License at
7
//
8
// http://www.apache.org/licenses/LICENSE-2.0
9
//
10
// Unless required by applicable law or agreed to in writing, software
11
// distributed under the License is distributed on an "AS IS" BASIS,
12
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
// See the License for the specific language governing permissions and
14
// limitations under the License.
15
= Cluster States
16

17
:javaFile: {javaCodeDir}/ClusterAPI.java
18

19
== Overview
20

21
An Ignite cluster can be in one of the three states: `ACTIVE`, `ACTIVE_READ_ONLY`, and `INACTIVE`.
22

23
When you start a pure in-memory cluster (no persistent data regions) for the first time, the cluster is in the `ACTIVE` state.
24
When you start a cluster with persistent data regions for the first time, the cluster is `INACTIVE`.
25

26

27
* `INACTIVE`: All operations are prohibited.
28
+
29
--
30
When you change the cluster state from active to `INACTIVE` (deactivation), the cluster deallocates all memory resources.
31

32
include::includes/note-on-deactivation.adoc[]
33

34
--
35
* `ACTIVE`: This is the normal mode of the cluster. You can execute any operation.
36

37
* `ACTIVE_READ_ONLY`: The read-only mode. Only read operations are allowed.
38
+
39
--
40
Any attempt to create a cache or modify the data in an existing cache results in an `IgniteClusterReadOnlyException` exception.
41
DDL or DML statements that modify the data are prohibited as well.
42
--
43

44

45
== Changing Cluster State
46

47
You can change the cluster state in multiple ways:
48

49
* link:control-script#getting-cluster-state[Control script]:
50
+
51
[source, shell]
52
----
53
control.sh --set-state ACTIVE_READ_ONLY
54
----
55

56
* link:restapi#change-cluster-state[REST command]:
57
+
58
--
59

60
[source, url]
61
----
62
http://localhost:8080/ignite?cmd=setstate&state=ACTIVE_READ_ONLY
63
----
64

65
--
66
* Programmatically:
67
+
68
[tabs]
69
--
70
tab:Java[]
71

72
[source, java]
73
----
74
include::{javaFile}[tags=change-state, indent=0]
75
----
76

77

78
tab:C#/.NET[]
79
tab:C++[]
80
--
81

82
* JMX Bean:
83
+
84
--
85

86
Mbean's Object Name: ::
87
----
88
group="Kernal",name=IgniteKernal
89
----
90
[cols="1,4",opts="header"]
91
|===
92
|Operation | Description
93

94
| `clusterState()` | Get the current cluster state.
95
| `clusterState(String, boolean)` | Set the cluster state.
96
|===
97
--
98

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.