Ho provato a creare un ambiente di sviluppo semplice con vagabondo ma ho problemi con postgres.postgres in vagrant (ubuntu14.04)
mio Vagrantfile è semplice:
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "forwarded_port", guest: 8000, host: 8000
config.vm.network :public_network
config.vm.provision "ansible" do |ansible|
ansible.playbook = "playbook.yml"
end
end
e lo uso ansible per la fornitura:
- name: Configure development machine
hosts: all
sudo: True
tasks:
- name: install postgres
apt: name={{ item }} update_cache=yes
with_items:
- postgresql
- postgresql-contrib
ma qualcosa va storto e Postgres installa errato
Quando ho SSH per VM e vedo cose strane:
$ /etc/init.d/postgresql start
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_TIME = "uk_UA.UTF-8",
LC_MONETARY = "uk_UA.UTF-8",
LC_ADDRESS = "uk_UA.UTF-8",
LC_TELEPHONE = "uk_UA.UTF-8",
LC_NAME = "uk_UA.UTF-8",
LC_MEASUREMENT = "uk_UA.UTF-8",
LC_IDENTIFICATION = "uk_UA.UTF-8",
LC_NUMERIC = "uk_UA.UTF-8",
LC_PAPER = "uk_UA.UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
e non esiste una directory/etc/postgresql (ma è presente/etc/postgresql-common) Qualche idea?
Puoi provare 'env -i /etc/init.d/postgresql start' a conferma che è un problema locale? –
@gslin Ho lo stesso problema, solo con una localizzazione diversa, el_GR invece di uk_UA. Ecco cosa hai richiesto: vagrant @ vagrant-ubuntu-trusty-64: ~ $ sudo env -i /etc/init.d/postgresql start * Nessun cluster PostgreSQL esiste; vedi "man pg_createcluster" – alefteris
Non sono così familiare con l'installazione in Ubuntu, ma in RHEL/Centos devi fare "servizio postgresql initdb" per creare prima il cluster. Forse prova '/etc/init.d/postgresql initdb' o fallendo che' pg_ctl initdb' – harmic