SlideShare una empresa de Scribd logo
1 de 13
A strategy for better scalability, security, and control for large AtoM installations
https://commons.wikimedia.org/wiki/File:Cell_division_according_to_E._Strasburger_(1875).png
2-site replication with AtoM
What is 2-site replication?
A deployment strategy:
• One public facing read-only site
• One internal read-write edit site
for staff
• A script that can automatically
copy data from the internal site to
the public site with no downtime
when triggered manually by
internal staff
Advantages of a 2-site deployment
Scalability
• Can enable aggressive caching on the public front-end
• Staff have their own separate site for editing
• Can tune the server parameters of each site differently for best performance
Control
• Staff can choose when records with no publication status (such as authority
records, terms, repository records, etc.) become publicly visible
Security
• Login can be completely disabled in the public-facing site
• Staff edit site can be kept behind firewall, HTTP authentication, and other
security measures
The replication script
https://github.com/artefactual-labs/atom-replication
Powered by Ansible
Ansible is an open source
tool for software
provisioning, configuration
management, and
application deployment.
It is based around the idea
of “playbooks” which are
simple scripts (written in
YAML) to express
configurations, deployment
steps, and more.
https://blog.knoldus.com/introduction-to-ansible/
https://www.ansible.com/
What does the replication script do?
Lives on the internal edit site (the source server). When
triggered, the script:
• Copies the ES index (no downtime to reindex the public site)
• Copies the database and loads it into the public site
The replication script does NOT:
• Copy over software files or theme/plugin files. Any
customizations or code changes need to be deployed
separately to both the source (internal) and public
(destination sites)
• Currently handle the uploads and downloads directories. If
your sites are on the same server, you can symlink the
public and internal directories so no replication is needed.
We hope to expand the script in the future to handle these
directories for 2-site deployments on different servers.
Set up and configuration
Install Ansible on your source (i.e. internal read/write) server:
You will need to make sure you have Python installed as well (version
3.5 or newer). It should already be installed in new Ubuntu 18.04
installations but if not:
sudo apt update
sudo apt install software-properties-common
sudo apt-add-repository --yes --update ppa:ansible/ansible
sudo apt install ansible
sudo apt install python3-minimal
python3 –V (this will check the version installed)
Set up and configuration
Install the replication script on your source server using git:
You will also need to make sure that you’ve configured SSH access to
both host sites (source and destination). You’ll find guides online on how
to set up SSH access on Ubuntu if you’ve never done it before!
sudo apt install git
git clone https://github.com/artefactual-labs/atom-replication
cd atom-replication
Set up and configuration
In the replication scripts, edit the hosts file to include the IP address of your
source (internal) and destination (public) AtoM instances.
If both MySQL and Elasticsearch are installed in the same host, put the same
IP address twice. Default contents of the file:
Notice that you’ll want to add the SSH user that Ansible should use for
each host as well.
[atom_sites]
# Source site
atom_es_source_site ansible_ssh_host=10.10.10.15 ansible_ssh_user=vagrant
atom_mysql_source_site ansible_ssh_host=10.10.10.15 ansible_ssh_user=vagrant
# Destination site
atom_es_destination_site ansible_ssh_host=10.10.10.10 ansible_ssh_user=vagrant
atom_mysql_destination_site ansible_ssh_host=10.10.10.10 ansible_ssh_user=vagrant
Set up and configuration
Finally, we need to configure
the database credentials and
the Elasticsearch index name
and location for both our host
and source sites, in the
group_vars/all file found
in the replication scripts.
# Atom source site
atom_source_site:
atom_db_name: "atom"
atom_db_user: "atom-user"
atom_db_password: "ATOMPASSWORD"
atom_db_host: "localhost"
es_source_site:
server: "localhost"
port: "9200"
index: "atom"
# Atom destination site
#
# The database and ES search will be
#
atom_dest_site:
atom_db_name: "atom_dest"
atom_db_user: "atom_dest"
atom_db_password: "ATOMPASSWORD"
atom_db_host: "localhost"
es_dest_site:
index: "atom_dest" # the Atom index for the destination site
server: "localhost"
port: "9200"
# Common values for both servers, defaults should be fine.
replication_path: "/srv/atom-replication"
elasticsearch_repo_path: "/var/lib/elasticsearch/atom-replication"
elasticsearch_repo_name: "atom-replica"
elasticsearch_snapshot_name: "atomsnap"
atom_sync_folder: "{{ replication_path }}/last" # same folder in both servers
Using the script
• Confirm the source/edit site is okay, i.e. the site is up, browse works,
archival descriptions page is okay. If source site is broken, the
destination site will be broken as well after replication!
• Impose a data/edit freeze on the source site to assure nobody is
making changes to the database.
• SSH or log in to your source server, and change to the directory where
the replication script is installed
• Run the replication Ansible playbook!
ansible-playbook -i hosts playbook.yml
Using the script
• After running the script, you should clear the Symfony cache, and
restart PHP-FPM on the destination (i.e. public) site.
php symfony cc
sudo systemctl php7.2-fpm restart
• If you are using an additional caching engine (such as Memcached,
Varnish, etc.) then you should clear that cache as well, to make sure that
the newest updates are shown to your public users.
• Do a quick review of your public site to make sure everything looks
good – remember to clear your browser cache (or test in an incognito
browser window) so you are seeing the newest updates!
See: https://www.accesstomemory.org/docs/latest/admin-manual/maintenance/clear-cache/
info@artefactual.com
Questions?

Más contenido relacionado

Más de Artefactual Systems - AtoM

Looking Ahead: AtoM's governance, development, and future
Looking Ahead: AtoM's governance, development, and futureLooking Ahead: AtoM's governance, development, and future
Looking Ahead: AtoM's governance, development, and futureArtefactual Systems - AtoM
 
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...Artefactual Systems - AtoM
 
An Introduction to AtoM, Archivematica, and Artefactual Systems
An Introduction to AtoM, Archivematica, and Artefactual SystemsAn Introduction to AtoM, Archivematica, and Artefactual Systems
An Introduction to AtoM, Archivematica, and Artefactual SystemsArtefactual Systems - AtoM
 
National Archives of Norway - AtoM and Archivematica intro workshop
National Archives of Norway - AtoM and Archivematica intro workshopNational Archives of Norway - AtoM and Archivematica intro workshop
National Archives of Norway - AtoM and Archivematica intro workshopArtefactual Systems - AtoM
 
Technologie Proche: Imagining the Archival Systems of Tomorrow With the Tools...
Technologie Proche: Imagining the Archival Systems of Tomorrow With the Tools...Technologie Proche: Imagining the Archival Systems of Tomorrow With the Tools...
Technologie Proche: Imagining the Archival Systems of Tomorrow With the Tools...Artefactual Systems - AtoM
 
Project Documentation with Sphinx (or, How I Learned to Stop Worrying and Lov...
Project Documentation with Sphinx (or, How I Learned to Stop Worrying and Lov...Project Documentation with Sphinx (or, How I Learned to Stop Worrying and Lov...
Project Documentation with Sphinx (or, How I Learned to Stop Worrying and Lov...Artefactual Systems - AtoM
 
Digital Curation using Archivematica and AtoM: DLF Forum 2015
Digital Curation using Archivematica and AtoM: DLF Forum 2015Digital Curation using Archivematica and AtoM: DLF Forum 2015
Digital Curation using Archivematica and AtoM: DLF Forum 2015Artefactual Systems - AtoM
 

Más de Artefactual Systems - AtoM (20)

Looking Ahead: AtoM's governance, development, and future
Looking Ahead: AtoM's governance, development, and futureLooking Ahead: AtoM's governance, development, and future
Looking Ahead: AtoM's governance, development, and future
 
Contributing to the AtoM documentation
Contributing to the AtoM documentationContributing to the AtoM documentation
Contributing to the AtoM documentation
 
Installing AtoM with Ansible
Installing AtoM with AnsibleInstalling AtoM with Ansible
Installing AtoM with Ansible
 
AtoM feature development
AtoM feature developmentAtoM feature development
AtoM feature development
 
Constructing SQL queries for AtoM
Constructing SQL queries for AtoMConstructing SQL queries for AtoM
Constructing SQL queries for AtoM
 
Creating custom themes in AtoM
Creating custom themes in AtoMCreating custom themes in AtoM
Creating custom themes in AtoM
 
Installing and Upgrading AtoM
Installing and Upgrading AtoMInstalling and Upgrading AtoM
Installing and Upgrading AtoM
 
Get to Know AtoM's Codebase
Get to Know AtoM's CodebaseGet to Know AtoM's Codebase
Get to Know AtoM's Codebase
 
AtoM's Command Line Tasks - An Introduction
AtoM's Command Line Tasks - An IntroductionAtoM's Command Line Tasks - An Introduction
AtoM's Command Line Tasks - An Introduction
 
Command-Line 101
Command-Line 101Command-Line 101
Command-Line 101
 
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
 
An Introduction to AtoM, Archivematica, and Artefactual Systems
An Introduction to AtoM, Archivematica, and Artefactual SystemsAn Introduction to AtoM, Archivematica, and Artefactual Systems
An Introduction to AtoM, Archivematica, and Artefactual Systems
 
National Archives of Norway - AtoM and Archivematica intro workshop
National Archives of Norway - AtoM and Archivematica intro workshopNational Archives of Norway - AtoM and Archivematica intro workshop
National Archives of Norway - AtoM and Archivematica intro workshop
 
Introducing Access to Memory
Introducing Access to MemoryIntroducing Access to Memory
Introducing Access to Memory
 
Artefactual and Open Source Development
Artefactual and Open Source DevelopmentArtefactual and Open Source Development
Artefactual and Open Source Development
 
AtoM, Authenticity, and the Chain of Custody
AtoM, Authenticity, and the Chain of CustodyAtoM, Authenticity, and the Chain of Custody
AtoM, Authenticity, and the Chain of Custody
 
Technologie Proche: Imagining the Archival Systems of Tomorrow With the Tools...
Technologie Proche: Imagining the Archival Systems of Tomorrow With the Tools...Technologie Proche: Imagining the Archival Systems of Tomorrow With the Tools...
Technologie Proche: Imagining the Archival Systems of Tomorrow With the Tools...
 
AtoM Community Update 2016
AtoM Community Update 2016AtoM Community Update 2016
AtoM Community Update 2016
 
Project Documentation with Sphinx (or, How I Learned to Stop Worrying and Lov...
Project Documentation with Sphinx (or, How I Learned to Stop Worrying and Lov...Project Documentation with Sphinx (or, How I Learned to Stop Worrying and Lov...
Project Documentation with Sphinx (or, How I Learned to Stop Worrying and Lov...
 
Digital Curation using Archivematica and AtoM: DLF Forum 2015
Digital Curation using Archivematica and AtoM: DLF Forum 2015Digital Curation using Archivematica and AtoM: DLF Forum 2015
Digital Curation using Archivematica and AtoM: DLF Forum 2015
 

Último

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 

Último (20)

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 

2-site replication with AtoM

  • 1. A strategy for better scalability, security, and control for large AtoM installations https://commons.wikimedia.org/wiki/File:Cell_division_according_to_E._Strasburger_(1875).png 2-site replication with AtoM
  • 2. What is 2-site replication? A deployment strategy: • One public facing read-only site • One internal read-write edit site for staff • A script that can automatically copy data from the internal site to the public site with no downtime when triggered manually by internal staff
  • 3. Advantages of a 2-site deployment Scalability • Can enable aggressive caching on the public front-end • Staff have their own separate site for editing • Can tune the server parameters of each site differently for best performance Control • Staff can choose when records with no publication status (such as authority records, terms, repository records, etc.) become publicly visible Security • Login can be completely disabled in the public-facing site • Staff edit site can be kept behind firewall, HTTP authentication, and other security measures
  • 5. Powered by Ansible Ansible is an open source tool for software provisioning, configuration management, and application deployment. It is based around the idea of “playbooks” which are simple scripts (written in YAML) to express configurations, deployment steps, and more. https://blog.knoldus.com/introduction-to-ansible/ https://www.ansible.com/
  • 6. What does the replication script do? Lives on the internal edit site (the source server). When triggered, the script: • Copies the ES index (no downtime to reindex the public site) • Copies the database and loads it into the public site The replication script does NOT: • Copy over software files or theme/plugin files. Any customizations or code changes need to be deployed separately to both the source (internal) and public (destination sites) • Currently handle the uploads and downloads directories. If your sites are on the same server, you can symlink the public and internal directories so no replication is needed. We hope to expand the script in the future to handle these directories for 2-site deployments on different servers.
  • 7. Set up and configuration Install Ansible on your source (i.e. internal read/write) server: You will need to make sure you have Python installed as well (version 3.5 or newer). It should already be installed in new Ubuntu 18.04 installations but if not: sudo apt update sudo apt install software-properties-common sudo apt-add-repository --yes --update ppa:ansible/ansible sudo apt install ansible sudo apt install python3-minimal python3 –V (this will check the version installed)
  • 8. Set up and configuration Install the replication script on your source server using git: You will also need to make sure that you’ve configured SSH access to both host sites (source and destination). You’ll find guides online on how to set up SSH access on Ubuntu if you’ve never done it before! sudo apt install git git clone https://github.com/artefactual-labs/atom-replication cd atom-replication
  • 9. Set up and configuration In the replication scripts, edit the hosts file to include the IP address of your source (internal) and destination (public) AtoM instances. If both MySQL and Elasticsearch are installed in the same host, put the same IP address twice. Default contents of the file: Notice that you’ll want to add the SSH user that Ansible should use for each host as well. [atom_sites] # Source site atom_es_source_site ansible_ssh_host=10.10.10.15 ansible_ssh_user=vagrant atom_mysql_source_site ansible_ssh_host=10.10.10.15 ansible_ssh_user=vagrant # Destination site atom_es_destination_site ansible_ssh_host=10.10.10.10 ansible_ssh_user=vagrant atom_mysql_destination_site ansible_ssh_host=10.10.10.10 ansible_ssh_user=vagrant
  • 10. Set up and configuration Finally, we need to configure the database credentials and the Elasticsearch index name and location for both our host and source sites, in the group_vars/all file found in the replication scripts. # Atom source site atom_source_site: atom_db_name: "atom" atom_db_user: "atom-user" atom_db_password: "ATOMPASSWORD" atom_db_host: "localhost" es_source_site: server: "localhost" port: "9200" index: "atom" # Atom destination site # # The database and ES search will be # atom_dest_site: atom_db_name: "atom_dest" atom_db_user: "atom_dest" atom_db_password: "ATOMPASSWORD" atom_db_host: "localhost" es_dest_site: index: "atom_dest" # the Atom index for the destination site server: "localhost" port: "9200" # Common values for both servers, defaults should be fine. replication_path: "/srv/atom-replication" elasticsearch_repo_path: "/var/lib/elasticsearch/atom-replication" elasticsearch_repo_name: "atom-replica" elasticsearch_snapshot_name: "atomsnap" atom_sync_folder: "{{ replication_path }}/last" # same folder in both servers
  • 11. Using the script • Confirm the source/edit site is okay, i.e. the site is up, browse works, archival descriptions page is okay. If source site is broken, the destination site will be broken as well after replication! • Impose a data/edit freeze on the source site to assure nobody is making changes to the database. • SSH or log in to your source server, and change to the directory where the replication script is installed • Run the replication Ansible playbook! ansible-playbook -i hosts playbook.yml
  • 12. Using the script • After running the script, you should clear the Symfony cache, and restart PHP-FPM on the destination (i.e. public) site. php symfony cc sudo systemctl php7.2-fpm restart • If you are using an additional caching engine (such as Memcached, Varnish, etc.) then you should clear that cache as well, to make sure that the newest updates are shown to your public users. • Do a quick review of your public site to make sure everything looks good – remember to clear your browser cache (or test in an incognito browser window) so you are seeing the newest updates! See: https://www.accesstomemory.org/docs/latest/admin-manual/maintenance/clear-cache/