Showing posts with label upgrade. Show all posts
Showing posts with label upgrade. Show all posts

Saturday, June 4, 2022

Setup ACS-7.2.x with Elasticsearch and Transformation Service Step by Step

  

As part of the step by step series, I outlined the steps to install Alfresco Content Services 7.x and Solr6 (Alfresco Search Services 2.x) using distribution package in my previous posts.

You can take a look at the steps here
 

I am here with another part of step by step series on ACS installation. We will try to setup Alfresco Content Services-7.2.x Enterprise with Elasticsearch (Search Enterprise-3.x) and all other components. This post will set the background for those who are looking to upgrade from Solr6 (Alfresco search service 2.x) to Elasticsearch (Search Enterprise-3.x) and evaluating. 

Let me know in the comments as to why should you upgrade to Elasticsearch from Solr 6.

*** Updated this post to install ACS 7.2.1.3 that contains the patch for a memory leak issue. You can find more details here *** 


What we need before we start doing setup?

  1. ACS-7.2.x package (alfresco-content-services-distribution-7.2.1.3)
  2. ASE-3.x package (alfresco-elasticsearch-connector-distribution-3.1.1)
  3. Alfresco Transform 1.5.x package (alfresco-transform-service-distribution-1.5.3)
  4. Java: Oracle jdk-11.0.13 or later/Open JDK 11.0.13 or later (I will use Oracle jdk-11.0.15 for this post)
  5. Elasticsearch 7.10
  6. Tomcat: Tomcat 9.0.62
  7. ActiveMQ: ActiveMQ v5.16.2.
  8. DB: PostgreSQL 13
  9. ImageMagick: ImageMagick v7.1.0
  10. Libreoffice: LibreOffice v7.0.6

Checkout the documentation for additional details on ACS Supported Platforms and Search Enterprise Supported Platforms


Platform:

  • Windows 10 x64

Type of deployment:

  • ACS, Share, Elasticsearch (Search Enterprise-3.x), and Transformation Service on same machine

Let’s download all the required packages that we need for the setup.

  • Download Alfresco Content Services Enterprise 7.2.x package from Support Portal. If you have an enterprise license, you can also download the package from alfresco artifacts repository.
  • Download Alfresco Transform Service 1.5 package from Support Portal. If you have an enterprise license, you can also download the package from alfresco artifacts repository.
Checkout this GitHub repo for more info on transform core all-in-one project
  • Download Alfresco Search Enterprise 3.1.0 package from Support Portal. If you have an enterprise license, you can also download the package from alfresco artifacts repository.
  • Download Alfresco model namespace map generator add-on, it can be used for setting up elastic search indexing app.

https://www.oracle.com/java/technologies/javase/jdk11-archive-downloads.html

https://download.oracle.com/otn/java/jdk/11.0.15+8/c4e1848573124815b77d6f1843afccb5/jdk-11.0.15_windows-x64_bin.exe

Note: Make sure you set the JAVA_HOME environment variable (on windows). It is the installation path of jdk. E.g. JAVA_HOME=C:\Program Files\Java\jdk-11.0.15

https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.62/bin/apache-tomcat-9.0.62-windows-x64.zip

Note: Make sure ports 8005, 8080, 8443, AJP port 8009 are open and not in use already. These are default ports used for tomcat. If you have these ports already in use, make sure you change the ports accordingly in <TOMCAT_INSTALLATION>/conf/server.xml.

Download ActiveMQ v5.16.2 binary package (used for transformation service):





https://artifacts.alfresco.com/nexus/content/groups/public/org/exiftool/image-exiftool/12.25/image-exiftool-12.25.tgz

Download and Install PostgreSQL 13.x:

Alternatively you can also download the binary package and extract it. No installation needed. It is useful if you have trouble doing installation on Windows 10.

Download PostgreSQL 13.x binary

Note: Make sure port 5432 is open and not already in use. Port 5432 is default for postgres to get db connection. If you have this port already in use, make sure you select a different port and use the same while configuring alfresco-global.properties.

Optional Alfresco module packages (amps)-Useful for admins/developers:

Friday, June 11, 2021

Solr 6 Java version upgrade from Jdk1.8.0_161 to Jdk-11.0.11 on centos platform

 

Follow the steps given below to upgrade the SOLR 6.x Java version:

  • Stop Solr instance if running already

$ sudo systemctl stop solr

 

# If system service is not configured then use following command:

 

$ sudo /opt/solr/bin/solr stop -all

  • Take backups in case something happens after upgrade, so you have a copy of previous setup
    • Take backup of /opt/solr/bin directory into a backup directory. E.g. ‘/home/alfweb/solrbackups’

# Create a backup directory if not already available.

 

$ sudo mkdir /home/alfweb/solrbackups

 

# Create a zip package of ‘/opt/solr/bin’ directory and move to solr backup directory

 

$ sudo zip -r /home/alfweb/solrbackups/solr-bin-dir-backup.zip /opt/solr/bin

 

    • Take backup of /opt/solr/server/solr directory which contains configs and indexes for cores created under ‘solr’ directory. If this directory contains indexes then they will also be backed up.

# Create a zip package of ‘/opt/solr/server/solr’ directory and move to solr backup directory

 

$ sudo zip -r /home/alfweb/solrbackups/solr-server-solr-dir-backup.zip /opt/solr/server/solr

 

    • Take backup of index data directory, If data directory is mounted at some different location other than ‘/opt/solr/server/solr’ directory which is usually default directory for configs and indexes.

# For example if solr index data directory is in ‘/var/solr/data’ directory then :

 

$ sudo zip -r /home/alfweb/solrbackups/var-solr-data-dir-backup.zip /var/solr/data

 

  • Install Java 11 (this is open jdk version of java 11 installation) using repository if server can connect to internet
    • Update packages, it is a best practice to start with an updated operating system before installing a package. If you have not done so, use the following command to update OS and reboot:


$ sudo yum update -y

$ sudo reboot 


    • Update packages, it is a best practice to start with an updated operating system before installing a package. If you have not done so, use the following command to update OS and reboot:


$ sudo yum install java-11-openjdk-devel


    • This will install java11 in following directory: /usr/lib/jvm/java-11
    • Run following command to check what is the default java version 

 

$ sudo yum java -version

 

If you see java version other than java-11, then you can switch and set the default version as java-11. Run the following command: 


 $ sudo alternatives --config java


This will prompt you to select the version you want to set as default. Select a number from the list, e.g. if java-11 is at number 2, then type '2' and press enter. Revalidate the java version again.

  • Go to Solr installation directory i.e. “/opt/solr” and take a backup of “solr.in.sh” file. 

$ sudo cp /opt/solr/bin/solr.in.sh /opt/solr/bin/solr.in.sh.bak

# If you used “install_solr_service.sh” script to install solr, then it will create a default ‘solr.in.sh’ file under ‘/etc/default/’ directory. In order to update the JVM parameter, you have to edit ‘/etc/default/solr.in.sh’ file. Take the backup of default solr.in.sh file:

$ sudo cp /etc/default/solr.in.sh /etc/default/solr.in.sh.bak


  • Open the “solr.in.sh” file in edit mode and update the following:

$ sudo vim /opt/solr/bin/solr.in.sh

# If you used “install_solr_service.sh” script to install solr, then it will create a default ‘solr.in.sh’ file under ‘/etc/default/’ directory. In order to update the JVM parameter, you have to edit ‘/etc/default/solr.in.sh’ file.

$ sudo vim /etc/default/solr.in.sh


 

#Comment out SOLR_HEAP variable

#SOLR_HEAP="512m"

 

#Uncomment SOLR_JAVA_MEM variable and set the value accordingly based on data/indexes and available memory. Note that, set the memory as per your need.

SOLR_JAVA_MEM="-Xms4g -Xmx4g"

 

#Comment out existing GC_LOG_OPTS and GC_TUNE variables and add new variable with same name and new values

################################ SOLR 6.1 Java 11 Upgrade GC_LOG_OPTS settings [Start] ################

#Comment out existing settings and set the variable with updated parameters per java11. 

GC_LOG_OPTS="-Xlog:gc*,safepoint,age*,ergo*:file=/var/solr/logs/solr_gc-%p-%t.log:tags,uptime,time,level:filecount=10,filesize=50m"

#Make sure logs directory is present and correct, some setups specially production setup doesn’t keep logs under ‘/opt/solr/server/logs directory’ (this is default directory for logs), instead logs are configured to be written under ‘/var/solr/logs’ directory. In this case update the path for GC_LOG_OPTS file parameter.

################################ SOLR 6.1 Java 11 Upgrade GC_LOG_OPTS settings [End] ##################

################################ SOLR 6.1 Java 11 Upgrade GC_TUNE settings [Start] ################

# Comment out existing setting and set the variable with updated parameters per java11. The below params are optimized for the system I worked with, you can set the params as per your need if planning to use G1GC

GC_TUNE="-XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:+UseLargePages -XX:G1HeapRegionSize=2m -XX:MaxGCPauseMillis=200 -XX:InitiatingHeapOccupancyPercent=70 -XX:+UseStringDeduplication -XX:+DisableExplicitGC"

 

Instructions for G1HeapRegionSize:


Heap Size

G1HeapRegionSize

< 4GB

1MB

4-8GB

2MB

8-16GB

4MB

16-32GB

8MB

32-64GB

16MB

>64GB

32MB


################################ SOLR 6.1 Java 11 Upgrade GC_TUNE settings [End] ##################

 

  • Save the file and Restart the solr

$ sudo systemctl restart solr 

# If system service is not configured then use following command:

$ sudo -u solr /opt/solr/bin/solr restart -all

  • Validate the java version in SOLR Admin.


Setup solr as a service (If not already setup):

  • Create a service named solr.service under /etc/systemd/system directory
  • Follow the below given instructions to create and start the service.

$ sudo vim /etc/systemd/system/solr.service

# Add the below instructions to solr.service unit

[Unit]

Description=Sitecore8 search service

After=syslog.target network.target

[Service]

Type=forking

ExecStart=/opt/solr/bin/solr start -all

PIDFile=/opt/solr/bin/solr-8983.pid

ExecStop=/opt/solr/bin/solr stop -all

SuccessExitStatus=0

Restart=always

User=solr

Group=Solr

[Install]

WantedBy=multi-user.target

# Reload daemon

$ sudo systemctl daemon-reload

# Start and enable solr to automatically start at boot time

$ sudo systemctl start solr

$ sudo systemctl enable solr

# Check status

$ sudo systemctl status solr




Useful resources: