Installeren met Trellis¶
Elasticsearch install and configure for development¶
Install Elasticsearch in Trellis¶
Check version requirement for ElasticPress plugin¶
Go to Github ElasticPress and check for EP_ES_VERSION_MAX. At time of writing this is set to 6.2. Make sure you install the latest compatible version of Elasticsearch.
Add requirements to trellis/requirements.yml¶
Install new requirements in trellis/ folder¶
Update memory for Vagrant box in trellis/vagrant.default.yml¶
Note: after this step you need to rebuild your vagrant box for the changes to take effect.
Configure trellis/dev.yml file with variables and role¶
Add variables for Elasticsearch just below the 'remote_user' line.
...
remote_user: vagrant
vars:
es_enable_xpack: false
es_instance_name: "node1"
es_restart_on_change: true
es_start_service: true
roles:
...
Add Elasticsearch role at the end of the 'roles' section
...
- { role: wordpress-setup, tags: [wordpress, wordpress-setup] }
- { role: wordpress-install, tags: [wordpress, wordpress-install] }
- { role: elastic.elasticsearch, tags: [elasticsearch] }
In the next steps we will apply the changed configuration to the virtual machine.
Backup your vagrant database from the trellis/ folder¶
This creates a sql dump file of the current state.
Rebuild Vagrant box from your trellis/ folder¶
This may take a while depending on the speed of your machine. (\~5-10 minutes)
Note
You should see your newly added elastic.elasticsearch role being downloaded and extracted and installed as well.
Import your database¶
After vagrant is rebuild run this from your trellis/ folder.
Where FILENAME is the filename of your db backup.
All done!¶
Configure ElasticPress to connect to Elasticsearch¶
Install the ElasticPress plugin from the site/ folder¶
Activate and configure ElasticPress plugin¶
- Enter
http://127.0.0.1:9200as Elasticsearch Host - Sync with ElasticPress plugin