Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Commit 4fe28b9

Browse files
shimamotohaginot
authored andcommitted
Add document for upgrading to 0.14.0
closes #466
1 parent fe94516 commit 4fe28b9

File tree

2 files changed

+95
-11
lines changed

2 files changed

+95
-11
lines changed

bin/pio-start-all

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ if [ `echo $SOURCE_TYPE | grep -i elasticsearch | wc -l` != 0 ] ; then
3434
echo "Starting Elasticsearch..."
3535
if [ -n "$PIO_STORAGE_SOURCES_ELASTICSEARCH_HOME" ]; then
3636
ELASTICSEARCH_HOME=$PIO_STORAGE_SOURCES_ELASTICSEARCH_HOME
37-
elif [ -n "$PIO_STORAGE_SOURCES_ELASTICSEARCH5_HOME" ]; then
38-
ELASTICSEARCH_HOME=$PIO_STORAGE_SOURCES_ELASTICSEARCH5_HOME
3937
fi
4038
if [ -n "$ELASTICSEARCH_HOME" ]; then
4139
if [ -n "$JAVA_HOME" ]; then

docs/manual/source/resources/upgrade.html.md

Lines changed: 95 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,104 @@ This page highlights major changes in each version and upgrade tools.
2323

2424
# How to Upgrade
2525

26-
To upgrade and use new version of PredictionIO, do the following:
26+
## Upgrade to 0.14.0
2727

28-
- Download and build the new PredictionIO binary
29-
[(instructions)](/install/install-sourcecode/).
30-
- Retain the setting from current `PredictionIO/conf/pio-env.sh` to the new
31-
`PredictionIO/conf/pio-env.sh`.
32-
- If you have added `PredictionIO/bin` to your `PATH` environment variable before,
33-
change it to the new `PredictionIO/bin` as well.
28+
This release adds Elasticsearch 6 support. See [pull request](https://github.com/apache/predictionio/pull/466) for details.
29+
Consequently, you must reindex your data.
3430

35-
# Additional Notes for Specific Versions Upgrade
31+
1. Access your old cluster to check existing indices
3632

37-
In addition, please take notes of the following for specific version upgrade.
33+
```
34+
$ curl -XGET 'http://localhost:9200/_cat/indices?v'
35+
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
36+
yellow open pio_event 6BAPz-DfQ2e9bICdVRr03g 5 1 1501 0 321.3kb 321.3kb
37+
yellow open pio_meta oxDMU1mGRn-vnXtAjmifSw 5 1 4 0 32.4kb 32.4kb
38+
39+
$ curl -XGET "http://localhost:9200/pio_meta/_search" -d'
40+
{
41+
"aggs": {
42+
"typesAgg": {
43+
"terms": {
44+
"field": "_type",
45+
"size": 200
46+
}
47+
}
48+
},
49+
"size": 0
50+
}'
51+
{"took":3,"timed_out":false,"_shards":{"total":5,"successful":5,"skipped":0,"failed":0},"hits":{"total":4,"max_score":0.0,"hits":[]},"aggregations":{"typesAgg":{"doc_count_error_upper_bound":0,"sum_other_doc_count":0,"buckets":[{"key":"accesskeys","doc_count":1},{"key":"apps","doc_count":1},{"key":"engine_instances","doc_count":1},{"key":"sequences","doc_count":1}]}}}
52+
53+
$ curl -XGET "http://localhost:9200/pio_event/_search" -d'
54+
{
55+
"aggs": {
56+
"typesAgg": {
57+
"terms": {
58+
"field": "_type",
59+
"size": 200
60+
}
61+
}
62+
},
63+
"size": 0
64+
}'
65+
{"took":2,"timed_out":false,"_shards":{"total":5,"successful":5,"skipped":0,"failed":0},"hits":{"total":1501,"max_score":0.0,"hits":[]},"aggregations":{"typesAgg":{"doc_count_error_upper_bound":0,"sum_other_doc_count":0,"buckets":[{"key":"1","doc_count":1501}]}}}
66+
```
67+
68+
2. (Optional) Settings for new indices
69+
70+
If you want to add specific settings associated with each index, we would recommend defining [Index Templates](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html).
71+
72+
For example,
73+
74+
```
75+
$ curl -H "Content-Type: application/json" -XPUT "http://localhost:9600/_template/pio_meta" -d'
76+
{
77+
"index_patterns": ["pio_meta_*"],
78+
"settings": {
79+
"number_of_shards": 1,
80+
"number_of_replicas": 1
81+
}
82+
}'
83+
$ curl -H "Content-Type: application/json" -XPUT "http://localhost:9600/_template/pio_event" -d'
84+
{
85+
"index_patterns": ["pio_event_*"],
86+
"settings": {
87+
"number_of_shards": 1,
88+
"number_of_replicas": 1
89+
}
90+
}'
91+
```
92+
93+
3. [Reindex](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/reindex-upgrade-remote.html)
94+
95+
According to the following conversion table, you run the reindex every index that you need to migrate to your new cluster.
96+
97+
| Old Cluster | New Cluster |
98+
| --------------- | ---------------- |
99+
| index: `pio_meta` type: `accesskeys` | index: `pio_meta_accesskeys` |
100+
| index: `pio_meta` type: `apps` | index: `pio_meta_apps` |
101+
| index: `pio_meta` type: `channels` | index: `pio_meta_channels` |
102+
| index: `pio_meta` type: `engine_instances` | index: `pio_meta_engine_instances` |
103+
| index: `pio_meta` type: `evaluation_instances` | index: `pio_meta_evaluation_instances` |
104+
| index: `pio_meta` type: `sequences` | index: `pio_meta_sequences` |
105+
| index: `pio_event` type: It depends on your use case. (e.g. `1`) | index: pio_event_<old_type> (e.g. `pio_event_1`) |
106+
107+
For example,
108+
109+
```
110+
$ curl -H "Content-Type: application/json" -XPOST "http://localhost:9600/_reindex" -d'
111+
{
112+
"source": {
113+
"remote": {
114+
"host": "http://localhost:9200"
115+
},
116+
"index": "pio_meta",
117+
"type": "accesskeys"
118+
},
119+
"dest": {
120+
"index": "pio_meta_accesskeys"
121+
}
122+
}'
123+
```
38124

39125
## Upgrade to 0.12.0
40126

0 commit comments

Comments
 (0)