Skip to content

Instantly share code, notes, and snippets.

@goors
Last active June 1, 2024 14:40
Show Gist options
  • Save goors/c6574e650df10020a244333c03d52539 to your computer and use it in GitHub Desktop.
Save goors/c6574e650df10020a244333c03d52539 to your computer and use it in GitHub Desktop.
sudo apt-get install -y rsync
sudo mkfs.ext4 /dev/disk/azure/scsi1/lun$1
sudo mkdir -p /mnt/data
sudo mount /dev/disk/azure/scsi1/lun$1 /mnt/data
sudo rsync -av /var/lib/elasticsearch/ /mnt/data/
echo "/dev/disk/azure/scsi1/lun$1 /mnt/data ext4 defaults 0 0" | sudo tee -a /etc/fstab
sudo sed -i 's|path.data: /var/lib/elasticsearch|path.data: /mnt/data|g' /etc/elasticsearch/elasticsearch.yml
sudo systemctl restart elasticsearch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment