Jetty 6.1 with Solr 4.4 - solr

Is it possible to run Solr 4.4 with jetty 6.1 from Ubuntus package repository? I followed this example:
http://www.kingstonlabs.com/blog/how-to-install-solr-36-on-ubuntu-1204/
And tried some other examples, but it seemed to be impossible to run run Solr 4.4 from Jetty's webapps directory.
In the example you can read in the comments, that people ended up with 404 when try to reach
http://localhost:8080/solr
I tried also the configuration steps from the Apache Solr 4 Cookbook by Rafal Kuc, page 6 "Running Solr on Jetty"
Here a summary of the steps:
tar xvfz solr-4.4.0.tgz
sudo cp ~/solr-4.4.0/example/webapps/solr.war /usr/share/jetty/webapps
sudo mkdir /usr/share/jetty/temp
sudo cp ~/solr-4.4.0/example/contexts/solr-jetty-context.xml /usr/share/jetty/contexts
#Change temp dir
sudo vi /usr/share/jetty/contexts/solr-jetty-context.xml
sudo cp ~/solr-4.4.0/example/etc/jetty.xml /usr/share/jetty/etc/
sudo cp ~/solr-4.4.0/example/etc/webdefault.xml /usr/share/jetty/etc/
sudo cp ~/solr-4.4.0/example/etc/logging.properties /usr/share/jetty/etc/
sudo mkdir /usr/share/solr
sudo cp ~/solr-4.4.0/example/solr/solr.xml /usr/share/solr/
sudo mkdir -p /usr/share/solr/collection1/conf
sudo cp ~/solr-4.4.0/example/solr/collection1/conf/schema.xml /usr/share/solr/collection1/conf/
sudo cp ~/solr-4.4.0/example/solr/collection1/conf/solrconfig.xml /usr/share/solr/collection1/conf/
# JETTY_HOME = 0.0.0.0; NO_START=0;
# JAVA_OPTIONS="-Xmx256m -Djava.awt.headless=true -Dsolr.solr.home=/usr/share/solr/"
sudo vi /etc/default/jetty
But
http://localhost:8983/solr
is not reachable afterwards. If found some error messages in the logs and i think that the jetty.xml from the Solr 4.4.0 files which substituting the Jetty 6.1 jetty.xml does not work with the rest of jetty 6.1
I remember so issues in the logs about Java/Jetty Server classes. i think tey differ.
Anybody with experiences in this case an can surely confirm my guess?

The clue is to integrate the libs from the solr example directory example/lib/ext into the solr.war.
Extract the files from the solr.war. Then put the libs into the WEB-INF/lib folder.
Create a new solr.war with the libs included.

Related

Zsh: Command Not found : mongo After trying to install mongodb 4.2 using brew

I have tried the following steps to install and setup mongodb in my mac from here https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/ but I got the following error when running the final "mongo" command in my terminal:
Error Message - Zsh: Command Not found : mongo
This error msg occurred after trying to install mongodb 4.2 using brew
sudo chown -R $(whoami) $(brew --prefix)/*
then
brew tap mongodb/brew
then
brew install mongodb-community#4.2
and
brew services start mongodb-community#4.2
or
mongod --config /usr/local/etc/mongod.conf
then
ps aux | grep -v grep | grep mongod
and
mongo
running brew services start mongodb-community#4.2 returns:
Successfully started `mongodb-community#4.2` (label: homebrew.mxcl.mongodb-community#4.2)
running ps aux | grep -v grep | grep mongod returns:
9081 0.2 0.5 5528024 41856 ?? S 3:01pm 0:01.48 /usr/local/opt/mongodb-community#4.2/bin/mongod --config /usr/local/etc/mongod.conf
7613 0.0 0.1 4298832 5600 s000 T 2:47pm 0:00.08 vim /usr/local/etc/mongod.conf
running mongod --config /usr/local/etc/mongod.conf returns:
zsh: command not found: mongod
There are also no mongo files in my /usr/local/bin directory after using these commands
I created a data/db folder in my /usr/local/bin directory using the following commands:
sudo mkdir -p /usr/local/bin/data/db
sudo chown -R `id -un` /usr/local/bin/data/db
Running "brew update" returns:
brew update
Updated 1 tap (homebrew/cask).
==> Updated Casks
brave-browser
brew install mongodb-community-shell
Fixed the problem for me.
Solved it by manually installing the mongodb community files and db tools using the website instead. Then copying them into /usr/local/bin. Then ignoring the app permissions whenever calling mongo or related commands in the terminal through System Preferences > Security & Privacy > General.
After googling I found out that mongoimport and the other features have to be installed separately: https://www.mongodb.com/try/download/database-tools
Followed by copying those bin files after extracting them into the same /usr/local/bin directory
Not sure why its' not working through homebrew though
This worked for me, I was having same issue on mongodb-community#4.4
brew reinstall mongodb-community#4.4
On terminal something like this will appear during reinstallation.
copy highlighted path with echo
echo 'export PATH="/opt/homebrew/opt/mongodb-community#4.4/bin:$PATH"' >> ~/.zshrc
Now open another terminal and start mongodb services
brew services restart mongodb/brew/mongodb-community#4.4
write mongo on terminal and here we fly
If you installed the mongodb via Homebrew. Need to add the mongo path in your bash_profile.
Edit the bash_profile vi ~/.bash_profile
Add the below line in EOF export PATH=$PATH:/usr/local/opt/mongodb-community#4.2/bin
After the edit bash_profile. Close all terminals and open them again. mongo command start works.
In addition to #ramesh-babu-t-b 's answer, https://stackoverflow.com/a/68407530/1279516, the issue could also be that your MongoDB installation did add mongod to your path, but the installation happened within the current shell session, and so your shell doesn't have the updates to the PATH variable yet.
In this case, only his last step is still necessary - Open a new console window and retry the mongod command.

Installing Apache Solr: Permission Denied

I am using iMac to run Apache Solr in command line. done the following:
wget https://apache.mirrors.nublue.co.uk/lucene/solr/8.5.1/solr-8.5.1-src.tgz
tar -xzf solr-8.5.1-src.tgz
cd to /solr
i then typed : bin/solr start and got permissions denied.
I tried sudo bin/solr start -force
and got :password: type password
after typing the password i get sudo: bin/solr command not found
I read that I need to change the solr home directory for better installation as it is denying root access probably?
Appreciate any suggestion to get Solr starting
Thanks
Paul
I think you need to download the binaries instead of the source files, then run:
cd solr/bin
solr create -c yourCore
solr start -p 8983
change the permission to to bin folder
something like:
sudo chmod -R 777 bin
You should download and install the version without scr at the end:
https://apache.mirrors.nublue.co.uk/lucene/solr/8.5.1/solr-8.5.1.tgz

How can I install Apache Solr into a specified directory in Ubuntu 18.04 LTS

I have installed Apache Solr into Ubuntu 18.04 LTS. I have used the following commands:
cd /vm
sudo wget http://apache-mirror.8birdsvideo.com/lucene/solr/8.2.0/solr-8.2.0.tgz
tar xzf solr-8.2.0.tgz solr-8.2.0/bin/install_solr_service.sh --strip-components=2
sudo bash ./install_solr_service.sh solr-8.2.0.tgz -d /vm
I am trying to install everything into a folder /vm.
But it throws an error and installs everything under /opt.
Everything works fine and I am able to add core, add a document, etc.
I want to be able to install it into my specified folder and I am not able to find an option for that. Is there any way to do this?
The parameter to give the install directory is -i /vm. -d configures the data directory.
The example from the manual that replicates the default settings:
sudo bash ./install_solr_service.sh solr-6.6.0.tgz -i /opt -d /var/solr -u solr -s solr -p 8983

Install Adminer on Ubuntu 18.04 bionic

I'm trying to install Adminer from Ubuntu repository using:
sudo apt install adminer
Installation works fine but can't find the file /etc/adminer/apache.conf to use with Apache server. The folder /etc/adminer/ is empty and can't find it anywhere with find command.
Any help?
Thanks in advance.
In the next few steps, I'll show you how I installed adminer for Ubuntu 18.04.1 LTS .
After installation with apt package manager change into the adminer directory.
cd /usr/share/adminer
There you will find a file called compile.php.
Run the following command and the adminer-X.X.X.php (X.X.X for your version) file will be created.
sudo php compile.php
Create the apache adminer configuration file.
sudo echo "Alias /adminer.php /usr/share/adminer/adminer-X.X.X.php" | sudo tee /etc/apache2/conf-available/adminer.conf
Now you'll need to activate the configuration.
cd /etc/apache2/conf-available/
sudo a2enconf adminer.conf
Reload your apache webserver.
sudo systemctl reload apache2.
Test in your browser of choice (localhost/adminer.php)
This source was really helpful:
https://www.linuxhelp.com/how-to-install-adminer-on-ubuntu-16-04/
Install Apache:
sudo apt-get install apache2
Install PHP:
sudo apt-get install php libapache2-mod-php php-mysql
Install Adminer:
sudo wget "http://www.adminer.org/latest.php" -O /var/www/html/adminer.php
Once the installation completes, restart Apache.
sudo service apache2 restart
At this point, the setup is complete. You can access Adminer at the following address.
http://[SERVER_IP]/adminer.php

Upgrade Apache Solr from 4.10.4 to 6.6.0 on Cent os 7

How to upgrade Apache solr from existing version 4.10.4 to 6.6.0 (A latest one)
On linux centos 7 operating system.
stop existing running solr
sudo service solr stop
confirm its stopped or not
sudo service solr status
You can take backup of existing solr data from
/var/solr/data/< core_name >, But reindexing solr data after upgrading
solr version will give best performance without any unknown issues.
now remove existing solr from centos
sudo rm -r /var/solr
remove solr from following location if its there
sudo rm -r /opt/solr
sudo rm /etc/init.d/solr
In my case following path was not exist to delete, Delete if exists in your case
sudo rm -r /opt/solr/solr-4.10.4
remove existing solr user with home directory
sudo userdel -r solr
for ubuntu
sudo deluser --remove-home solr
remove existing group
sudo groupdel solr
for ubuntu
sudo deluser --group solr
restart your system
sudo reboot
Check supporting application and download solr 6.6
Check which version Java version is installed on your machine
java -version
Check available java versions, and update to latest version
yum list available java*
Install latest java version
sudo yum install <jdk version>
download and extract installation folder
mkdir /home/user/temp
cd temp
wget http://apache.org/dist/lucene/solr/6.6.0/solr-6.6.0.tgz
tar -zxvf solr-6.6.0.tgz
install solr
cd solr-6.6.0/
sudo bin/install_solr_service.sh /home/user/temp/solr-6.6.0.tgz
after successful installation you can see following output
id: solr: no such user Creating new user: solr
Extracting /home/user/temp/solr-6.6.0.tgz to /opt
Installing symlink /opt/solr -> /opt/solr-6.6.0 ...
Installing /etc/init.d/solr script ...
Installing /etc/default/solr.in.sh ...
Service solr installed. Customize Solr startup configuration in
/etc/default/solr.in.sh Waiting up to 180 seconds to see Solr running
on port 8983 [] Started Solr server on port 8983 (pid=4802). Happy
searching!
Found 1 Solr nodes:
Solr process 4802 running on port 8983 {
"solr_home":"/var/solr/data", "version":"6.6.0
5c7a7b65d2aa7ce5ec96458315c661a18b320241 - ishan - 2017-05-30
07:32:53", "startTime":"2017-06-26T07:02:51.523Z", "uptime":"0
days, 0 hours, 0 minutes, 13 seconds", "memory":"34.4 MB (%7) of
490.7 MB"}
Now check if you can access solr admin panel
http://localhost:8983/solr/
Check if solr is running, start solr if not running and then try
sudo service solr status
If you are still not able to access solr admin panel, then may you OS firewall is blocking to port 8983
use following commands to allow port 8983 in firewall
sudo firewall-cmd --zone = public --add-port = 8983 / tcp --permanent
sudo firewall-cmd --reload
For further data migration please see Migration of solr cores after solr version upgradation from 4.10.4 to 6.6.0 on Cent os 7

Resources