...
Step | Action |
---|
1) Update and Upgrade OS and get Oracle JDK Warning |
---|
| The current version of java-8 may vary. Please adapt the following settings to the current version |
|
Code Block |
---|
| sudo apt upgrade
sudo apt update
sudo reboot -p -f |
download Oracle JDK (Example filename jdk-8u241-linux-x64.tar.gz) and upload the file /opt/Download |
2) Creating workspace |
Code Block |
---|
| sudo mkdir /usr/lib/jvm |
|
|
Code Block |
---|
| cd /usr/lib/jvm
sudo tar xzf /opt/Download/jdk-8u241-linux-x64.tar.gz
sudo chown -R root:root jdk1.8.0_241 |
|
3) Setting up environment variables
|
Code Block |
---|
| sudo vi /etc/environment |
Code Block |
---|
language | bash |
---|
title | /etc/environnement |
---|
linenumbers | true |
---|
| PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/jdk1.8.0_241/bin:/usr/lib/jvm/jdk1.8.0_241/db/bin:/usr/lib/jvm/jdk1.8.0_241/jre/bin"
J2SDKDIR="/usr/lib/jvm/jdk1.8.0_241"
J2REDIR="/usr/lib/jvm/jdk1.8.0_241/jre"
JAVA_HOME="/usr/lib/jvm/jdk1.8.0_241"
|
|
5) Configuring the Java locationEnter the following commands to inform the system of the Java location. |
Code Block |
---|
language | bash |
---|
linenumbers | true |
---|
| sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0_241/bin/java" 0
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.8.0_241/bin/javac" 0
sudo update-alternatives --set java /usr/lib/jvm/jdk1.8.0_241/bin/java
sudo update-alternatives --set javac /usr/lib/jvm/jdk1.8.0_241/bin/javac |
|
6) To check the setup,enter the following commands and make sure they indicate the location of java and javac as shown in the previous step. |
Code Block |
---|
language | bash |
---|
linenumbers | true |
---|
| update-alternatives --list java
update-alternatives --list javac |
|
7) ValidateRestart Test the installation |
Code Block |
---|
| java -version
java -version
sudo reboot -f |
|
2- Installing Maven
Step | Action |
---|
1) Updating the OS |
Code Block |
---|
| sudo apt-get update |
|
2) Download Maven |
Code Block |
---|
| sudo wget https://www-us.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz -P /opt/Download
cd /opt/Download |
|
3) Unzip Maven |
Code Block |
---|
| sudo tar xvzf apache-maven-3.6.3-bin.tar.gz -C /opt
sudo chown -R root:root /opt/apache-maven-3.6.3 |
|
4) Configuring the Maven environmentTo make sure that Maven works properly, you need to set a few environment variables, including JAVA_HOME, M3_HOME, MAVEN_HOME, and PATH.
To make this change, create a file named maven.sh in the /etc/profile.d/ directory.
|
Code Block |
---|
| sudo vi /etc/profile.d/maven.sh |
Code Block |
---|
language | bash |
---|
title | /etc/profile.d/maven.sh |
---|
| export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_241
export M3_HOME=/opt/apache-maven-3.6.3
export MAVEN_HOME=/opt/apache-maven-3.6.3
export PATH=${M3_HOME}/bin:${PATH} |
Code Block |
---|
| sudo chmod +x /etc/profile.d/maven.sh |
|
5) Configuring environment variables
|
Code Block |
---|
| sudo vi /etc/environment |
Code Block |
---|
language | bash |
---|
title | /etc/environnement |
---|
linenumbers | true |
---|
| PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/jdk1.8.0_241/bin:/usr/lib/jvm/jdk1.8.0_241/db/bin:/usr/lib/jvm/jdk1.8.0_241/jre/bin:/opt/apache-maven-3.6.3/bin"
J2SDKDIR="/usr/lib/jvm/jdk1.8.0_241"
J2REDIR="/usr/lib/jvm/jdk1.8.0_241/jre"
JAVA_HOME="/usr/lib/jvm/jdk1.8.0_241"
MAVEN_HOME=/opt/apache-maven-3.6.3
|
|
5) Check the installation |
Code Block |
---|
| source /etc/profile.d/maven.sh
mvn -version
# Sample answer
Maven home: /opt/apache-maven-3.6.3
Java version: 1.8.0_241, vendor: Oracle Corporation, runtime: /usr/lib/jvm/jdk1.8.0_241/jre
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "5.0.0-1027-azure", arch: "amd64", family: "unix" |
|
3- Installing Solr
Ref: Apache installing-solr et Installing+VIVO 1.11.0 - section Install Solr
Step | Action |
---|
1) Download Solr and unzipping |
Code Block |
---|
| cd /opt/Download
sudo wget https://archive.apache.org/dist/lucene/solr/7.7.2/solr-7.7.2.tgz
|
|
2) Create solr user |
Code Block |
---|
| sudo mkdir -p /opt/solr
sudo groupadd solr
sudo useradd -s /bin/bash -g solr -d /opt/solr solr |
|
3) Installing the program |
Code Block |
---|
| sudo tar xzf solr-7.7.2.tgz -C /opt
sudo mv /opt/solr-7.7.2/* /opt/solr
sudo chown -R solr:solr /opt/solr
|
|
4) Installing solr as a service |
Code Block |
---|
| sudo vi /etc/systemd/system/solr.service |
Code Block |
---|
language | bash |
---|
title | /etc/systemd/system/solr.service |
---|
linenumbers | true |
---|
| [Unit]
Description=Solr 7.7.2 services
After=network.target
[Service]
Type=forking
User=solr
Group=solr
Environment="SOLR_HOME=/opt/solr/server/solr"
ExecStart=/opt/solr/bin/solr start -force
ExecStop=/opt/solr/bin/solr stop
[Install]
WantedBy=multi-user.target |
|
5) Validate the solr service |
Code Block |
---|
| sudo ufw allow 8983/tcp
sudo systemctl daemon-reload
sudo systemctl start solr
sudo systemctl status solr
● solr.service - Solr 7.7.2 services
Loaded: loaded (/etc/systemd/system/solr.service; disabled; vendor preset: enabled)
Active: active (running) since Thu 2019-11-28 12:23:23 UTC; 8s ago
Process: 116789 ExecStart=/opt/solr/bin/solr start -force (code=exited, status=0/SUCCESS)
Main PID: 116850 (java)
Tasks: 41 (limit: 9246)
CGroup: /system.slice/solr.service
└─116850 java -server -Xms512m -Xmx512m -XX:NewRatio=3 -XX:SurvivorRatio=4 -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=8 -XX
nov. 28 12:23:19 vivo-uqam solr[116789]: *** [WARN] *** Your open file limit is currently 1024.
nov. 28 12:23:19 vivo-uqam solr[116789]: It should be set to 65000 to avoid operational disruption.
nov. 28 12:23:19 vivo-uqam solr[116789]: If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in
nov. 28 12:23:19 vivo-uqam solr[116789]: *** [WARN] *** Your Max Processes Limit is currently 30823.
nov. 28 12:23:19 vivo-uqam solr[116789]: It should be set to 65000 to avoid operational disruption.
nov. 28 12:23:19 vivo-uqam solr[116789]: If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in
nov. 28 12:23:23 vivo-uqam solr[116789]: [146B blob data]
nov. 28 12:23:23 vivo-uqam solr[116789]: Started Solr server on port 8983 (pid=116850). Happy searching!
nov. 28 12:23:23 vivo-uqam solr[116789]: [14B blob data]
nov. 28 12:23:23 vivo-uqam systemd[1]: Started Solr 7.7.2 services.
lines 1-19/19 (END) |
|
6) Test the installationhttp://x.x.x.x.x is the host server address of solr
|
Code Block |
---|
| sudo systemctl enable solr
sudo reboot -f
http://x.x.x.x.x:8983/solr/ |
Image Modified |
4- Installing GIT
Step | Action |
---|
1) Installing GIT |
Code Block |
---|
| sudo apt update
sudo apt install git |
|
2) Verify the installation |
Code Block |
---|
git --version
# output
git version 2.17.1 |
|
Next
You can now proceed to the next process