Rolling upgrade from 1.2.4 to 2.2.1:
The upgraded 2.2.1 node comes up and is listed in cat/nodes from the non-upgraded (1.2.4) nodes, but any API call on the upgrade node fails with
{
"error" : {
"root_cause" : [
{
"type" : "class_not_found_exception",
"reason" : "class_not_found_exception: com.amazon.opendistroforelasticsearch.security.user.User"
}
],
"type" : "exception",
"reason" : "java.lang.ClassNotFoundException: com.amazon.opendistroforelasticsearch.security.user.User",
"caused_by" : {
"type" : "class_not_found_exception",
"reason" : "class_not_found_exception: com.amazon.opendistroforelasticsearch.security.user.User"
}
},
"status" : 500
}
Next tried rolling upgrade from 1.2.4 → 1.3.5 → 2.21 (Based on OS upgrade from 1.0.0 to 2.2 )
The upgrade to 1.3.5 worked fine. Once the entire cluster was upgraded to 1.3.5, started rolling upgrade to 2.2.1. The first node once upgraded starts up with this error
2022-09-23T22:11:54,777 Thread-8 [E] ope.sec.con.ConfigurationRepository - [UID=] - Cannot apply default config (this is maybe not an error!)
com.fasterxml.jackson.core.JsonGenerationException: No current event to copy
at com.fasterxml.jackson.core.JsonGenerator._reportError(JsonGenerator.java:2710) ~[jackson-core-2.13.3.jar:2.13.3]
at com.fasterxml.jackson.core.JsonGenerator.copyCurrentEvent(JsonGenerator.java:2433) ~[jackson-core-2.13.3.jar:2.13.3]
at com.fasterxml.jackson.core.JsonGenerator.copyCurrentStructure(JsonGenerator.java:2555) ~[jackson-core-2.13.3.jar:2.13.3]
at org.opensearch.common.xcontent.json.JsonXContentGenerator.copyCurrentStructure(JsonXContentGenerator.java:418) ~[opensearch-x-content-2.2.1.jar:2.2.1]
at org.opensearch.common.xcontent.XContentBuilder.copyCurrentStructure(XContentBuilder.java:1013) ~[opensearch-x-content-2.2.1.jar:2.2.1]
at org.opensearch.security.support.ConfigHelper.readXContent(ConfigHelper.java:125) ~[opensearch-security-2.2.1.0.jar:2.2.1.0]
at org.opensearch.security.support.ConfigHelper.uploadFile(ConfigHelper.java:78) ~[opensearch-security-2.2.1.0.jar:2.2.1.0]
at org.opensearch.security.configuration.ConfigurationRepository$1.run(ConfigurationRepository.java:144) [opensearch-security-2.2.1.0.jar:2.2.1.0]
at java.lang.Thread.run(Thread.java:887) [?:?]
After adding an empty allowlist.yml security config file (as per [BUG] AccessControlException: access denied on start · Issue #2065 · opensearch-project/security · GitHub ) the error changes to
2022-09-23T22:15:44,803 worker][T#1] [E] org.ope.sec.aut.BackendRegistry - [UID=] - Not yet initialized (you may need to run securityadmin)
Updated opensearch.yml to use
- cluster.initial_cluster_manager_nodes instead of cluster.initial_master_nodes
- node.roles: [“cluster_manager”] instead of node.master: true
With this the upgraded node starts up fine without any error in the logs. It is also listed in the _cat/nodes invokes from any of the 1.3.5 nodes. The cluster health is also green. But any API calls to the upgraded 2.2.1 node gives the following error.
{
"error" : {
"root_cause" : [
{
"type" : "security_exception",
"reason" : "no permissions for [cluster:monitor/state] and User [name=admin, backend_roles=[], requestedTenant=null]"
}
],
"type" : "security_exception",
"reason" : "no permissions for [cluster:monitor/state] and User [name=admin, backend_roles=[], requestedTenant=null]"
},
"status" : 403
}
Upgrading a data node to 2.2.1 makes its data unavailable to the cluster and the cluster start goes into yellow based in the shard unavailability.
NOTE: cluster upgrade from 1.2.4 to 2.2.1 was successful with a full cluster restart instead of rolling restart without any config changes to opensearch.yml.
What is the recommended way to for a rolling restart upgrade from 1.2.4 to 2.2.1? Is that even possible?