Comments (13)
Solr 4.4 through 4.10 have automatic core discovery, for these versions you have to:
- create a core directory manually containing
conf
anddata
- manually copy your config into
conf
(ensure there is no<dataDir>
set insolrconfig.xml
) - place
core.properties
containingname=[your core name]
in the core directory
My Ansible playbook for a Solr 4.8.1 server with 3 cores on an EC2 instance looks like this:
---
- hosts: all
become: yes
gather_facts: yes
roles:
- geerlingguy.java
- geerlingguy.solr
vars:
solr_version: 4.8.1
cores:
- app1
- app2
- app3
tasks:
- name: Mount EBS volume
mount:
name: /mnt/solr
src: /dev/xvdf
fstype: ext4
opts: defaults,nofail
state: present
- name: Create Solr core
lineinfile:
path: "/var/solr/{{ item }}/core.properties"
regexp: '^name='
line: 'name={{ item }}'
create: yes
owner: solr
group: solr
mode: 0644
with_items: "{{ cores }}"
- name: Deploy Solr config
copy:
src: "files/{{ item }}/solr/"
dest: "/var/solr/{{ item }}/conf"
owner: solr
group: solr
mode: 0644
with_items: "{{ cores }}"
- name: Symlink Solr data
file:
src: "/mnt/solr/{{ item }}"
dest: "/var/solr/{{ item }}/data"
force: yes
owner: solr
group: solr
state: link
with_items: "{{ cores }}"
from ansible-role-solr.
Ok, solr hadn't started properly. Making more sense now.
from ansible-role-solr.
@fubarhouse - Yeah... I've actually been trying to find a nice simple way to do it for one of my own projects too. It was never super easy to add cores in 3.x/4.x, but the basic way I'm doing it now is:
- use a templated
solr.xml
file with all the cores listed. - manually modify the
<dataDir>
in each core'ssolrconfig.xml
file - copy things into the right places
- cross fingers and hope it all works!
from ansible-role-solr.
Can anyone offer a task file that creates a new core from Drupal's search_api_solr config? I had it working for 5 but struggling a bit with 4 - trying to duplicate the Acquia setup.
from ansible-role-solr.
@simesy have you tried the playbook by @longwave?
You'd need a Solr 4 instace for it to work, but it looks good. You may also need to template a file for the cores.
I'll have anotherlook today - I have not had a lot of Solr 6 success in local drupal development in recent weeks.
from ansible-role-solr.
Thanks fubarhouse, i'll have a looksee.
from ansible-role-solr.
Oh you mean up there. yeah i manually tried those steps that failed, but since then I went on a long loop of other things. Going to try again now.
from ansible-role-solr.
I could look into it in that case, the most critical piece is templating a single file with the core configs.
I’ve no problem with templating it, but longer term management isn’t flexible outside of Ansible and as you’ve seen in person our Jenkins workflows capitalise on that flexibility. I haven’t invested in Solr 4 config management yet...
I would use geerlingguy’s recommendation in doing this, but no guarantees though, I’m pressed for time outside work hours at the moment.
Edit: could you provide the output of that playbook? It’s a fantastic starting point!!
from ansible-role-solr.
i think the templating thing is fine, it's installing any core and getting anything to show on http.../solr/ :)
from ansible-role-solr.
For reference these are my config and rudimentary steps. With:
assets/core.properties
referenced below containingname=MYCORE
- drupal-vm config.yml contains config below
vagrant up
sudo /etc/init.d/solr start
- then visit MYSITE.vm:8983/solr/#/MYCORE
installed_extras:
... ...
- solr
...
solr_version: "4.5.1"
solr_xms: "64M"
solr_xmx: "128M"
solr_remove_cruft: true
solr_install_path: /opt/solr
solr_connect_host: MYSITE.vm
- name: Setup Drupal solr config
copy:
src: ../docroot/modules/contrib/search_api_solr/solr-conf/4.x/
dest: /var/solr/MYCORE/conf/
owner: solr
group: solr
mode: 0755
when: stat_solr.stat.exists == False
- name: Set discoverable core property file
template:
src: assets/core.properties
dest: "/var/solr/MYCORE/"
owner: solr
group: solr
mode: 0755
Thanks @longwave !
from ansible-role-solr.
Something changed which means i don't need to manually start solr, probably 018d78e
from ansible-role-solr.
This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!
Please read this blog post to see the reasons why I mark issues as stale.
from ansible-role-solr.
This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.
from ansible-role-solr.
Related Issues (20)
- log4j.properties does not exist with solr 6.6.6 HOT 1
- Confirm support for Solr 8 HOT 1
- solrcloud mode get error : Error processing the request. CoreContainer is either not initialized or shutting down. HOT 2
- Update solr versions to latest stable releases
- installation problem HOT 1
- Installation problem during playing the playbook HOT 2
- Upgrade version HOT 7
- configset mislocated? HOT 2
- Use role for managing individual cores HOT 2
- Support for separating core configuration and data HOT 4
- Failure to build Solr AMI with Permission denied HOT 2
- Setting solr_remove_cruft: true disallows creating additional cores HOT 3
- Allow to update to a new solr version HOT 3
- Switch defaults to Solr 9 HOT 5
- Solr-Example directory not available in Solr 9.0.0 on Debian 11 HOT 4
- Adjust recommended JVM Memory settings HOT 1
- Consider non root use HOT 2
- Debian 12 with OpenJDK Java 17 results in 'No ScriptEngine found' error HOT 1
- RHEL 9 needs chkconfig installed HOT 1
- Context needs to be updated on the /etc/init.d/solr folder to allow solr to start HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-role-solr.