Thanks a lot. I will give it  a try!

On Friday, March 6, 2020 at 1:06:57 AM UTC-8, Riccardo Murri wrote:
>
> Hello Smahane, 
>
> as far as I understand from reading the docs (never used GCP's 
> "Filestore" myself, yet), the filestore is made available to VMs like 
> a normal NFS filesystem. 
>
> So you have several options to mount it; for example to mount it on 
> directory `/data` on a running cluster: 
>
>     pdsh -a sudo mkdir -p /data 
>     pdsh -a sudo mount -t nfs 1.2.3.4:/filestorename /data 
>
> This only works "temporarily" in that the mount point disappears at 
> reboot; you need to edit `/etc/fstab` for it to be permanent. 
>
> To have a more permanent solution that can be re-used across clusters, 
> it's better to write a small Ansible playbook; like the following 
> (enclosed in "```" markers). 
>
> ``` 
> - name: Mount volume on head node 
>   tags: 
>     - after 
>     - local 
>   hosts: all 
>
>   vars: 
>     # mount point for the filesystem 
>     mountpoint: '/data' 
>     # IP address of filestore endpoint 
>     filestore_server: 1.2.3.4 
>     # filestore endpoint name 
>     filestore_name: foobar 
>
>   tasks: 
>
>     - name: Ensure mountpoint directory exists 
>       file: 
>         dest: '{{ mountpoint }}' 
>         state: directory 
>
>     - name: Mount filesystem 
>       mount: 
>         path: '{{ mountpoint }}' 
>         src: '{{ filestore_server }}:/{{ filestore_name }}' 
>         fstype: nfs 
>         state: mounted 
> ``` 
>
> You  can then run this playbook on all cluster nodes via: 
>
>     elasticluster setup my-cluster-name -- /path/to/playbook/file.yml 
>
> Hope this helps! 
>
> Riccardo 
>

-- 
You received this message because you are subscribed to the Google Groups 
"elasticluster" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticluster/e2f57f27-5584-4ca6-a555-e935828aac3c%40googlegroups.com.

Reply via email to