These are chat archives for azukiapp/azk

8th
Jul 2015
David BF
@d2bit
Jul 08 2015 06:51
Hi, I'm having problems with postgres containers.
I use several projects with postgres, but each time I restart the container I't losses the data, so I have to set it up..
Do any of you know how to solve that? It's very annoying to wait for the seeds every day :sob:
Felipe Arenales Santos
@fearenales
Jul 08 2015 07:39
hi @d2bit ! Probably you're not using persistent folders to postgres
check this Azkfile.js out and add the persistent options to the mount section of your postgres system
David BF
@d2bit
Jul 08 2015 07:40
yeah, I'm using that template
Felipe Arenales Santos
@fearenales
Jul 08 2015 07:42
and still not working?
may you send us your Azkfile.js?
I'm on debian8, but a colleague also is on deb8 and he has not that problem :confused:
Felipe Arenales Santos
@fearenales
Jul 08 2015 07:45
since you said you're using multiple projects with postgres, I'd recommend you to set:
'/var/lib/postgresql': persistent("postgresql-#{manifest.dir}"),
that config should be enough...
would you mind to give a try?
David BF
@d2bit
Jul 08 2015 07:46
I'll do.. but I just started one azk environment
azk start postgres; azk shell -c 'bundle exec rake db:setup'; now it works
azk stop, azk start postgres; now it has no data at all
I've seen that in ~/.azk/pesistent_folders/ there are lots of folders, how are they related to the containers?
Felipe Arenales Santos
@fearenales
Jul 08 2015 07:49
actually they are related with each Azkfile.js
David BF
@d2bit
Jul 08 2015 07:50
so, the change you said won't be necessary, doesn't it?
Felipe Arenales Santos
@fearenales
Jul 08 2015 07:51
I'd recommend you to keep it, just in case
I'm trying to wonder why postgres data is being swept off...
David BF
@d2bit
Jul 08 2015 07:53
inserting data...
Felipe Arenales Santos
@fearenales
Jul 08 2015 07:53
if you run azk shell postgres and check the content of /var/lib/postgresql, it isn't empty, is it?
David BF
@d2bit
Jul 08 2015 07:55
it has an empty data folder
Felipe Arenales Santos
@fearenales
Jul 08 2015 07:57
that's odd (even with the created database etc. ?)
David BF
@d2bit
Jul 08 2015 07:58
yeap, in both cases. before & after inserting data
Felipe Arenales Santos
@fearenales
Jul 08 2015 08:00
:/
your colleague are running the very same Azkfile.js and he isn't experiencing this issue?
David BF
@d2bit
Jul 08 2015 08:03
yeap
Felipe Arenales Santos
@fearenales
Jul 08 2015 08:04
I'm going to dig deeper on this and ping you back with the solution, sounds good?
btw, @gullitmiranda should know the answer :) (quite late over here, as soon as he wakes up he should get in touch)
David BF
@d2bit
Jul 08 2015 08:08
cool! thanks for your time ;)
Felipe Arenales Santos
@fearenales
Jul 08 2015 08:09
you're welcome! thanks for your patience! :)
Gullit Miranda
@gullitmiranda
Jul 08 2015 11:49

Hi guys,
Upgrade of docker 1.5 to 1.6 there were some changes in the way volumes are mounted. What happens here is that within the Dockerfile there is a volume to the /var/lib/postgresql/data, therefore it ends up ignoring the folder data folder if mounted only / var/lib/postgresql.

To solve this problem change the assembly for:

  mounts: {
      '/var/lib/postgresql/data': persistent("postgresql-#{system.name}"),
      '/var/log/postgresql': path("./log/postgresql"),
    },

as exemplified in:
http://images.azk.io/#/postgres

@d2bit ^
David BF
@d2bit
Jul 08 2015 11:53
let me try, thanks
BTW I'm using docker 1.7.0
it seems to work
David BF
@d2bit
Jul 08 2015 11:58
<3
Gullit Miranda
@gullitmiranda
Jul 08 2015 12:47
Unfortunately some users have experienced problems using the docker 1.7 :(
but if it works for you, even better