So i have been experimenting with openJdk instead of oraclejdk(beacause of licence)
System is Ubuntu20.4 VirtualMachine (default installation is working fine by the way after mysql 5.32 to 5.33 change for Koa.master Tag)
I am following these docs :
I have changed the following files to change oraclejdk to openjdk
edx/app/edx_ansible/edx_ansible/playbooks/roles/oraclejdk
Below are my changes :
1. oraclejdk/default/main.yml
---
#ORACLEJDK_VERSION: "8u131"
#oraclejdk_base: "jdk1.8.0_131"
#oraclejdk_build: "b11"
#oraclejdk_platform: "linux"
#oraclejdk_arch: "x64"
#oraclejdk_file: "jdk-{{ ORACLEJDK_VERSION }}-{{ oraclejdk_platform }}-{{ oraclejdk_arch }}.tar.gz"
#oraclejdk_url: "http://download.oracle.com/otn-pub/java/jdk/{{ ORACLEJDK_VERSION }}-{{ oraclejdk_build }}/d54c1d3a095b4ff2b6607d096fa80163/{{ oraclejdk_file }}"
#oraclejdk_link: "/usr/lib/jvm/java-8-oracle"
#oraclejdk_debian_pkgs:
# - curl
openjdk_default: 8
openjdk_pkg_state: latest
oraclejdk_base: 'java-{{openjdk_default}}-openjdk-amd64'
openjdk_version:
- '{{ openjdk_default }}'
openjdk_ppa: 'ppa:openjdk-r/ppa'
oraclejdk_link: "/usr/lib/jvm/java-8-oracle"
oraclejdk_debian_pkgs:
- openjdk-{{openjdk_default}}-jre-headless
- openjdk-{{openjdk_default}}-jdk-headless
# - jre
# - jdk
2. oraclejdk/task/main.yml
---
# oraclejdk
#
# Dependencies:
#
# * common
#
# Example play:
#
# roles:
# - common
# - oraclejdk
- name: Install debian needed pkgs
apt:
name: "{{ item }}"
with_items: "{{ oraclejdk_debian_pkgs }}"
#- name: Download Oracle Java
# get_url:
# url: "{{ oraclejdk_url }}"
# headers: 'CookiCreate symlink expected by elasticsearche:oraclelicense=accept-securebackup-cookie'
# dest: "/var/tmp/{{ oraclejdk_file }}"
- name: Create jvm dir
file:
path: /usr/lib/jvm
state: directory
owner: root
group: root
#- name: Untar Oracle Java
# unarchive:
# src: "/var/tmp/{{ oraclejdk_file }}"
# dest: "/usr/lib/jvm"
# copy: no
- name: Add the openjdk ppa. To have openjdk 8/9 on precise and trusty
apt_repository: repo='{{ openjdk_ppa }}' update_cache=yes
- name: install OpenJDK JRE
apt: pkg={{ item[1] }} state={{ openjdk_pkg_state }} update_cache=yes cache_valid_time=3600
with_nested:
- '{{ openjdk_version }}'
- '{{ oraclejdk_debian_pkgs }}'
- name: Set the default OpenJDK
shell: update-java-alternatives -s java-1.{{ item }}.0-openjdk-amd64
with_items: '{{ openjdk_default }}'
- name: Create symlink expected by elasticsearch
file:
src: "/usr/lib/jvm/{{ oraclejdk_base }}"
dest: "{{ oraclejdk_link }}"
state: link
force: yes
- name: Update alternatives java
alternatives:
name: "{{ item }}"
link: "/usr/bin/{{ item }}"
path: "/usr/lib/jvm/{{ oraclejdk_base }}/bin/{{ item }}"
with_items:
- java
- javac
#- javaws
- jarsigner
- name: Add JAVA_HOME for Oracle Java
template:
src: "java.sh.j2"
dest: "/etc/profile.d/java.sh"
owner: root
group: root
mode: "0755"
3. Error i am getting is
TASK [forum : install comments service bundle] *************************************************************************************
changed: [localhost]
TASK [forum : initialize elasticsearch] ********************************************************************************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["/edx/app/forum/cs_comments_service/bin/rake", "search:initialize"], "delta": "0:00:02.073510", "end": "2021-02-11 18:14:14.883624", "msg": "non-zero return code", "rc": 1, "start": "2021-02-11 18:14:12.810114", "stderr": "/edx/app/forum/cs_comments_service/lib/tasks/flags.rake:6: warning: already initialized constant ROOT\n/edx/app/forum/cs_comments_service/lib/tasks/kpis.rake:7: warning: previous definition of ROOT was here\n/edx/app/forum/cs_comments_service/lib/tasks/deep_search.rake:7: warning: already initialized constant ROOT\n/edx/app/forum/cs_comments_service/lib/tasks/flags.rake:6: warning: previous definition of ROOT was here\n/edx/app/forum/cs_comments_service/lib/tasks/db.rake:28: warning: already initialized constant COURSE_ID\n/edx/app/forum/cs_comments_service/models/constants.rb:2: warning: previous definition of COURSE_ID was here\nrake aborted!\nElasticsearch::Transport::Transport::Errors::InternalServerError: [500] {\"error\":\"ClassCastException[java.lang.String cannot be cast to java.util.Map]\",\"status\":500}\n/edx/app/forum/.gem/ruby/2.5.0/gems/elasticsearch-transport-7.8.0/lib/elasticsearch/transport/transport/base.rb:218:in `__raise_transport_error'\n/edx/app/forum/.gem/ruby/2.5.0/gems/elasticsearch-transport-7.8.0/lib/elasticsearch/transport/transport/base.rb:346:in `perform_request'\n/edx/app/forum/.gem/ruby/2.5.0/gems/elasticsearch-transport-7.8.0/lib/elasticsearch/transport/transport/http/faraday.rb:37:in `perform_request'\n/edx/app/forum/.gem/ruby/2.5.0/gems/elasticsearch-transport-7.8.0/lib/elasticsearch/transport/client.rb:176:in `perform_request'\n/edx/app/forum/.gem/ruby/2.5.0/gems/elasticsearch-api-7.8.0/lib/elasticsearch/api/namespace/common.rb:38:in `perform_request'\n/edx/app/forum/.gem/ruby/2.5.0/gems/elasticsearch-api-7.8.0/lib/elasticsearch/api/actions/indices/create.rb:48:in `create'\n/edx/app/forum/cs_comments_service/lib/task_helpers.rb:92:in `block in create_indices'\n/edx/app/forum/cs_comments_service/lib/task_helpers.rb:89:in `each'\n/edx/app/forum/cs_comments_service/lib/task_helpers.rb:89:in `create_indices'\n/edx/app/forum/cs_comments_service/lib/task_helpers.rb:198:in `initialize_indices'\n/edx/app/forum/cs_comments_service/lib/tasks/search.rake:30:in `block (2 levels) in <top (required)>'\n/edx/app/forum/.gem/ruby/2.5.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'\nTasks: TOP => search:initialize\n(See full trace by running task with --trace)", "stderr_lines": ["/edx/app/forum/cs_comments_service/lib/tasks/flags.rake:6: warning: already initialized constant ROOT", "/edx/app/forum/cs_comments_service/lib/tasks/kpis.rake:7: warning: previous definition of ROOT was here", "/edx/app/forum/cs_comments_service/lib/tasks/deep_search.rake:7: warning: already initialized constant ROOT", "/edx/app/forum/cs_comments_service/lib/tasks/flags.rake:6: warning: previous definition of ROOT was here", "/edx/app/forum/cs_comments_service/lib/tasks/db.rake:28: warning: already initialized constant COURSE_ID", "/edx/app/forum/cs_comments_service/models/constants.rb:2: warning: previous definition of COURSE_ID was here", "rake aborted!", "Elasticsearch::Transport::Transport::Errors::InternalServerError: [500] {\"error\":\"ClassCastException[java.lang.String cannot be cast to java.util.Map]\",\"status\":500}", "/edx/app/forum/.gem/ruby/2.5.0/gems/elasticsearch-transport-7.8.0/lib/elasticsearch/transport/transport/base.rb:218:in `__raise_transport_error'", "/edx/app/forum/.gem/ruby/2.5.0/gems/elasticsearch-transport-7.8.0/lib/elasticsearch/transport/transport/base.rb:346:in `perform_request'", "/edx/app/forum/.gem/ruby/2.5.0/gems/elasticsearch-transport-7.8.0/lib/elasticsearch/transport/transport/http/faraday.rb:37:in `perform_request'", "/edx/app/forum/.gem/ruby/2.5.0/gems/elasticsearch-transport-7.8.0/lib/elasticsearch/transport/client.rb:176:in `perform_request'", "/edx/app/forum/.gem/ruby/2.5.0/gems/elasticsearch-api-7.8.0/lib/elasticsearch/api/namespace/common.rb:38:in `perform_request'", "/edx/app/forum/.gem/ruby/2.5.0/gems/elasticsearch-api-7.8.0/lib/elasticsearch/api/actions/indices/create.rb:48:in `create'", "/edx/app/forum/cs_comments_service/lib/task_helpers.rb:92:in `block in create_indices'", "/edx/app/forum/cs_comments_service/lib/task_helpers.rb:89:in `each'", "/edx/app/forum/cs_comments_service/lib/task_helpers.rb:89:in `create_indices'", "/edx/app/forum/cs_comments_service/lib/task_helpers.rb:198:in `initialize_indices'", "/edx/app/forum/cs_comments_service/lib/tasks/search.rake:30:in `block (2 levels) in <top (required)>'", "/edx/app/forum/.gem/ruby/2.5.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'", "Tasks: TOP => search:initialize", "(See full trace by running task with --trace)"], "stdout": "W, [2021-02-11T18:14:14.802735 #941223] WARN -- : Overwriting existing field _id in class User.\nW, [2021-02-11T18:14:14.823858 #941223] WARN -- : MONGODB | Unsupported client option 'max_retries'. It will be ignored.\nW, [2021-02-11T18:14:14.823904 #941223] WARN -- : MONGODB | Unsupported client option 'retry_interval'. It will be ignored.\nW, [2021-02-11T18:14:14.823920 #941223] WARN -- : MONGODB | Unsupported client option 'timeout'. It will be ignored.", "stdout_lines": ["W, [2021-02-11T18:14:14.802735 #941223] WARN -- : Overwriting existing field _id in class User.", "W, [2021-02-11T18:14:14.823858 #941223] WARN -- : MONGODB | Unsupported client option 'max_retries'. It will be ignored.", "W, [2021-02-11T18:14:14.823904 #941223] WARN -- : MONGODB | Unsupported client option 'retry_interval'. It will be ignored.", "W, [2021-02-11T18:14:14.823920 #941223] WARN -- : MONGODB | Unsupported client option 'timeout'. It will be ignored."]}
Please let me know if more information is required
Please let me know your ideas, how to go on about it