Use of /tmp dir when doing snapshot

207 views
Skip to first unread message

Vaclav Adamec

unread,
Oct 12, 2017, 5:49:20 AM10/12/17
to Consul
Hi,
 is there any way how to override /tmp usage during snapshot creation ? using v0.8.1

$ consul snapshot save backup.snap

# create temporary file in /tmp/snapshotXXXXXXXX
# than rename/mv to final file 'backup.snap'

Vasek

Vaclav Adamec

unread,
Oct 12, 2017, 6:05:33 AM10/12/17
to consu...@googlegroups.com
Based on GO TempDir https://golang.org/pkg/os/#TempDir this should
work, but seems to be ignored (still writing to /tmp):

$ export TMPDIR='/var/tmp' consul snapshot save backup.snap
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in violation
> of those guidelines may result in your removal from this mailing list.
>
> GitHub Issues: https://github.com/hashicorp/consul/issues
> IRC: #consul on Freenode
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "Consul" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/consul-tool/QVuurSPbWCA/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> consul-tool...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/consul-tool/febd9499-e8ac-4f43-b5c4-2af3135d695b%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
-- May the fox be with you ...
/\
(~(
) ) /\_/\
(_=---_(@ @)
( \ /
/|/----\|\ V
" " " "

James Phillips

unread,
Oct 17, 2017, 7:35:37 PM10/17/17
to consu...@googlegroups.com
Hi,

Currently there's not a way to control this. The snapshots you run
through the API use the same code path that Consul uses internally
when it's snapshotting and truncating the Raft log, so this would be
kind of a big change to split out, unfortunately.

-- James

On Thu, Oct 12, 2017 at 3:05 AM, Vaclav Adamec
> You received this message because you are subscribed to the Google Groups "Consul" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to consul-tool...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/consul-tool/CAN1zQ4YNGjQkroZ%2BLWd36AD2oD_AqWK_2Y8bTvhjji7FdnGdiw%40mail.gmail.com.

Vaclav Adamec

unread,
Oct 18, 2017, 4:08:38 PM10/18/17
to Consul
Via TMP_DIR variable in systemd unit for consul it works (need reload of systemd and restart of Consul but better than nothing)

Vasek 

James Phillips

unread,
Oct 18, 2017, 4:15:24 PM10/18/17
to consu...@googlegroups.com
Ah I didn't realize that Go would respect that - thanks for the update.
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in violation
> of those guidelines may result in your removal from this mailing list.
>
> GitHub Issues: https://github.com/hashicorp/consul/issues
> IRC: #consul on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Consul" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to consul-tool...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/consul-tool/aa578889-bfa2-4558-a32b-8e853e8167a6%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages