加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

postgresql – 流浪汉中的postgres(ubuntu14.04)

发布时间:2020-12-13 18:04:43 所属栏目:百科 来源:网络整理
导读:我尝试用流浪汉创建简单的开发环境但是在postgres中遇到问题. 我的Vagrantfile很简单: # -*- 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.c
我尝试用流浪汉创建简单的开发环境但是在postgres中遇到问题.

我的Vagrantfile很简单:

# -*- 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

我使用ansible提供:

- name: Configure development machine
  hosts: all
  sudo: True
  tasks:
    - name: install postgres
      apt: name={{ item }} update_cache=yes
      with_items:
        - postgresql 
        - postgresql-contrib

但出了问题,postgres安装不正确

当我ssh到VM,我看到奇怪的事情:

$/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

并且没有/ etc / postgresql目录(但是/ etc / postgresql-common存在)有什么想法吗?

Github repo

将以下行添加到shell启动文件
LANGUAGE=en_US.UTF-8
LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8

然后运行(使用root权限)

locale-gen en_US.UTF-8
dpkg-reconfigure locales

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读