Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.

Drupal 8 + Elasticsearch + Docker

2.287 Aufrufe

Veröffentlicht am

Drupal Camp 2016 presentation

Veröffentlicht in: Technologie
  • Als Erste(r) kommentieren

Drupal 8 + Elasticsearch + Docker

  1. 1. DRUPAL 8 + ELASTICSEARCH + DOCKER Roald R. Umandal, Vielsoft Ltd Co. Drupal Camp Manila 2016
  2. 2. What we need? • Docker • Docker ubuntu image • Docker elasticsearch image • Apache, MySQL, PHP 5, Drush • Drupal 8
  3. 3. What is Docker?
  4. 4. Docker • Docker allows you to package an application with all of its dependencies into a standardized unit of software development
  5. 5. Docker • Docker container wrap up a piece of software in a complete filesystem that contains everything it needs to run: code, runtime, system tools, system libraries – anything you can install on a server
  6. 6. Why Docker • Lightweight • Portable • Isolation • Consistent Environments
  7. 7. What is Elasticsearch?
  8. 8. Elasticsearch • Elasticsearch is distributed RESTful search engine built for the cloud.
  9. 9. Elasticsearch • Elasticsearch is a search server based on Lucene. It provides distributed, multitenant-capable full-text search engine with an HTTP web interface and Schema- Free JSON documents.
  10. 10. Elasticsearch • Elasticsearch is developed in Java and is released as open source under the terms of the Apache License
  11. 11. Features • Distributed and Highly Available Search Engine – Each index is fully sharded with a configurable number of shards – Each shard can have one or more replicas – Read/Search operations performed on any of the replica shards.
  12. 12. Features • Multi Tenant with Multi Types – Support for more than one index. – Support for more than one type per index. – Index level configuration (number of shards, index storage).
  13. 13. Features • Various set of APIs – HTTP RESTful API – Native Java API – All APIs perform automatic node operation rerouting
  14. 14. Features • Document Oriented – No need for upfront schema definition. – Schema can be defined per type for customization of indexing process.
  15. 15. Features • Reliable, Asynchronous Write Behind for long term persistency. • (Near) Real Time Search. • Built on top of lucene – Each shard is fully functional Lucene index – All the power of Lucene easily exposed through simple configuration / plugins.
  16. 16. Features • Per operation consistency – Singe document level operations are atomic, consistent, isolated and durable. • Open Source under the Apache License, version 2 (“ALv2”)
  17. 17. Let’s get started
  18. 18. Demo
  19. 19. Setup  Drupal 8  docker pull roaldumandal/drupal8  docker run -d -P --name [container name][docker image]  docker exec -it [container name | container id] [command]  Start mysql - /etc/init.d/mysql start  Start apache - /etc/init.d/apache2 start  Elasticsearch  docker pull roaldumandal/elasticsearch  docker run -d -P --name [container name][docker image]  docker exec -it [container name | container id] [command]  Start elasticsearch - /etc/init.d/elasticsearch start
  20. 20. Let’s build first our elasticsearch server
  21. 21. Elasticsearch • docker pull roaldumandal/elasticsearch
  22. 22. Elasticsearch • docker run -d -P elasticsearch roaldumandal/elasticsearch
  23. 23. Elasticsearch • Login to docker container – docker exec -it elasticsearch bash
  24. 24. Elasticsearch • Start elasticsearch - /etc/init.d/elasticsearch start • Type in your terminal exit
  25. 25. Now where ready to setup our Drupal 8 web server!
  26. 26. Drupal 8 • docker pull roaldumandal/drupal8
  27. 27. Drupal 8 • Create docker your docker container • docker run -d -P --name [container name] [docker image] • The -d flag keeps the container running in background after the docker run command completes • The -p flag publishes exposed ports from the container to your localhost; this lets you access them from your computer
  28. 28. Drupal 8 • docker exec -it [container name | container id] [command] • After running the command it login you as root
  29. 29. Drupal 8 • Start mysql - /etc/init.d/mysql start • Start apache - /etc/init.d/apache2 start • Type in on your terminal exit
  30. 30. Drupal 8 • Check newly created container • docker ps -a (This command will list all available container)
  31. 31. Drupal 8 • Accessing your docker web app in your computer • Getting your docker default ip run this command – docker-machine ip default (This will list your default ip). • Example: – http://192.168.99.100:32773 – 32773 is the docker generated port
  32. 32. Drupal 8 • Voila! you already have Drupal 8 running in your local
  33. 33. Configuring Elasticsearch • Enable elasticsearch connector
  34. 34. Configuring Elasticsearch • Add cluster name • Set server URL (Elasticsearch server)
  35. 35. Configuring Elasticsearch • Creating elasticsearch index
  36. 36. Configuring Elasticsearch • You should be able to see now your cluster and index
  37. 37. Configuring Search API • Add search server • Fill up the fields set the elasticsearch server name • Set the backend type to Elasticsearch
  38. 38. Configuring Search API • Add search index • Fill up the fields • Set data source to Content: – None except those selected – Bundles: Article • Server – Elasticsearch Server • Goto views tab then index the data
  39. 39. Create views search page • Views module supports elasticsearch connector module we can build search page using views and set the views settings to index elasticsearch • Create new view • Name it elasticsearch then save and edit
  40. 40. Create views search page • Views Elasticsearch page settings – Format: Unformatted list – Show: Fields – Fields: • Content datasource: Title • Content datasource: Image • Content datasource: Body • Filter criteria: – Search Fulltext
  41. 41. Elasticsearch Views
  42. 42. Questions?
  43. 43. Thank You
  44. 44. Need more help? • https://www.docker.com/what-docker • http://www.lucenetutorial.com/basic-concepts.html • https://docs.docker.com/engine/reference/commandline/cli/ • https://www.quora.com/What-is-the-difference-between-Docker-and- Vagrant-When-should-you-use-each-one • http://stackoverflow.com/questions/16647069/should-i-use-vagrant- or-docker-for-creating-an-isolated-environment • https://medium.com/dev-tricks/apache-and-php-on-docker- 44faef716150#.g64yqogkg • https://docs.docker.com/engine/installation/mac/ • https://www.elastic.co/guide/en/elasticsearch/reference/current/gloss ary.html • http://joelabrahamsson.com/elasticsearch-101/ • https://www.quora.com/What-are-the-disadvantages-of-using- Elasticsearch-as-a-primary-database
  45. 45. Disclaimer All images used in this presentation are borrowed from the internet. Therefore, all rights reserved to the original owner.

×