You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@predictionio.apache.org by ha...@apache.org on 2019/02/20 14:43:23 UTC

[predictionio] branch develop updated: Add document for upgrading to 0.14.0

This is an automated email from the ASF dual-hosted git repository.

hagino pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/predictionio.git


The following commit(s) were added to refs/heads/develop by this push:
     new a9cc6b9  Add document for upgrading to 0.14.0
a9cc6b9 is described below

commit a9cc6b95d9ed729a43ac829c94e1d19f0d3be102
Author: takako shimamoto <ch...@gmail.com>
AuthorDate: Wed Feb 20 23:42:35 2019 +0900

    Add document for upgrading to 0.14.0
    
    closes apache/predictionio#466
---
 bin/pio-start-all                            |   2 -
 docs/manual/source/resources/upgrade.html.md | 104 ++++++++++++++++++++++++---
 2 files changed, 95 insertions(+), 11 deletions(-)

diff --git a/bin/pio-start-all b/bin/pio-start-all
index 15ac1a6..8eade0b 100755
--- a/bin/pio-start-all
+++ b/bin/pio-start-all
@@ -34,8 +34,6 @@ if [ `echo $SOURCE_TYPE | grep -i elasticsearch | wc -l` != 0 ] ; then
   echo "Starting Elasticsearch..."
   if [ -n "$PIO_STORAGE_SOURCES_ELASTICSEARCH_HOME" ]; then
     ELASTICSEARCH_HOME=$PIO_STORAGE_SOURCES_ELASTICSEARCH_HOME
-  elif [ -n "$PIO_STORAGE_SOURCES_ELASTICSEARCH5_HOME" ]; then
-    ELASTICSEARCH_HOME=$PIO_STORAGE_SOURCES_ELASTICSEARCH5_HOME
   fi
   if [ -n "$ELASTICSEARCH_HOME" ]; then
     if [ -n "$JAVA_HOME" ]; then
diff --git a/docs/manual/source/resources/upgrade.html.md b/docs/manual/source/resources/upgrade.html.md
index 075ff55..7c79f2b 100644
--- a/docs/manual/source/resources/upgrade.html.md
+++ b/docs/manual/source/resources/upgrade.html.md
@@ -23,18 +23,104 @@ This page highlights major changes in each version and upgrade tools.
 
 # How to Upgrade
 
-To upgrade and use new version of PredictionIO, do the following:
+## Upgrade to 0.14.0
 
-- Download and build the new PredictionIO binary
-  [(instructions)](/install/install-sourcecode/).
-- Retain the setting from current `PredictionIO/conf/pio-env.sh` to the new
-  `PredictionIO/conf/pio-env.sh`.
-- If you have added `PredictionIO/bin` to your `PATH` environment variable before,
-  change it to the new `PredictionIO/bin` as well.
+This release adds Elasticsearch 6 support. See [pull request](https://github.com/apache/predictionio/pull/466) for details.
+Consequently, you must reindex your data.
 
-# Additional Notes for Specific Versions Upgrade
+1. Access your old cluster to check existing indices
 
-In addition, please take notes of the following for specific version upgrade.
+```
+$ curl -XGET 'http://localhost:9200/_cat/indices?v'
+health status index     uuid                   pri rep docs.count docs.deleted store.size pri.store.size
+yellow open   pio_event 6BAPz-DfQ2e9bICdVRr03g   5   1       1501            0    321.3kb        321.3kb
+yellow open   pio_meta  oxDMU1mGRn-vnXtAjmifSw   5   1          4            0     32.4kb         32.4kb
+
+$ curl -XGET "http://localhost:9200/pio_meta/_search" -d'
+{
+  "aggs": {
+    "typesAgg": {
+      "terms": {
+        "field": "_type",
+        "size": 200
+      }
+    }
+  },
+  "size": 0
+}'
+{"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}]}}}
+
+$ curl -XGET "http://localhost:9200/pio_event/_search" -d'
+{
+  "aggs": {
+    "typesAgg": {
+      "terms": {
+        "field": "_type",
+        "size": 200
+      }
+    }
+  },
+  "size": 0
+}'
+{"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}]}}}
+```
+
+2. (Optional) Settings for new indices
+
+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).
+
+For example,
+
+```
+$ curl -H "Content-Type: application/json" -XPUT "http://localhost:9600/_template/pio_meta" -d'
+{
+  "index_patterns": ["pio_meta_*"],
+  "settings": {
+    "number_of_shards": 1,
+    "number_of_replicas": 1
+  }
+}'
+$ curl -H "Content-Type: application/json" -XPUT "http://localhost:9600/_template/pio_event" -d'
+{
+  "index_patterns": ["pio_event_*"],
+  "settings": {
+    "number_of_shards": 1,
+    "number_of_replicas": 1
+  }
+}'
+```
+
+3. [Reindex](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/reindex-upgrade-remote.html)
+
+According to the following conversion table, you run the reindex every index that you need to migrate to your new cluster.
+
+| Old Cluster | New Cluster |
+| --------------- | ---------------- |
+| index: `pio_meta` type: `accesskeys` | index: `pio_meta_accesskeys` |
+| index: `pio_meta` type: `apps` | index: `pio_meta_apps` |
+| index: `pio_meta` type: `channels` | index: `pio_meta_channels` |
+| index: `pio_meta` type: `engine_instances` | index: `pio_meta_engine_instances` |
+| index: `pio_meta` type: `evaluation_instances` | index: `pio_meta_evaluation_instances` |
+| index: `pio_meta` type: `sequences` | index: `pio_meta_sequences` |
+| index: `pio_event` type: It depends on your use case. (e.g. `1`) | index: pio_event_<old_type> (e.g. `pio_event_1`) |
+
+For example,
+
+```
+$ curl -H "Content-Type: application/json" -XPOST "http://localhost:9600/_reindex" -d'
+{
+  "source": {
+    "remote": {
+      "host": "http://localhost:9200"
+    },
+    "index": "pio_meta",
+    "type": "accesskeys"
+  },
+  "dest": {
+    "index": "pio_meta_accesskeys"
+  }
+}'
+```
 
 ## Upgrade to 0.12.0