ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

ubuntu部署TimescaleDB

2020-05-12 12:09:26  阅读:492  来源: 互联网

标签:12 postgresql postgres 部署 sudo VM TimescaleDB ubuntu


系统环境: ubuntu16.04
PostgreSQL 版本: 12


注意:TimescaleDB 需要PostgreSQL 11.4+或12.0+。不再支持PostgreSQL 9.6.3+和10.9+,并将在以后的版本中删除。

  1. Add PostgreSQL's third party repository to get the latest PostgreSQL packages
ubuntu@VM-0-12-ubuntu:~# echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -c -s)-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list 
ubuntu@VM-0-12-ubuntu:~# wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - 
ubuntu@VM-0-12-ubuntu:~# sudo apt-get update

  1. Add PPA
ubuntu@VM-0-12-ubuntu:~# sudo add-apt-repository ppa:timescale/timescaledb-ppa 
ubuntu@VM-0-12-ubuntu:~# sudo apt-get update 
  1. Install appropriate package for PG version
ubuntu@VM-0-12-ubuntu:~# sudo apt install timescaledb-postgresql-12
  1. Run 'timescaledb-tune' (installed as part of the
    timescaledb-tools package, a recommended dependency) to update your config settings for TimescaleDB
ubuntu@VM-0-12-ubuntu:~# sudo timescaledb-tune --quiet --yes
ubuntu@VM-0-12-ubuntu:~# sudo service postgresql restart
  1. 为postgres用户设置密码
ubuntu@VM-0-12-ubuntu:~$ sudo -u postgres   psql postgres
psql (12.2 (Ubuntu 12.2-2.pgdg16.04+1))
Type "help" for help.

postgres=# \password postgres 
Enter new password:  #输入密码
Enter it again:  #确认密码
postgres=# \q #退出

  1. 修改登录权限设置
ubuntu@VM-0-12-ubuntu:~# sudo vim /etc/postgresql/12/main/pg_hba.conf
...
# Database administrative login by Unix domain socket
# local   all             postgres                                md5  
local   all             postgres                                peer #peer 方式允许管理员账号通过socket连接,用-h 指定socket目录,(default: "/var/run/postgresql")

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer

# IPv4 local connections:
host    all             all             10.0.0.1/16            md5
host    all             all             127.0.0.1/32            md5
...

ubuntu@VM-0-12-ubuntu:~# sudo vim /etc/postgresql/12/main/postgresql.conf 
...
listen_addresses = '*'          # what IP address(es) to listen on;
...
  1. 登录测试
ubuntu@VM-0-12-ubuntu:~$ psql  -h /var/run/postgresql -U postgres -W
Password:  #输入密码
psql (12.2 (Ubuntu 12.2-2.pgdg16.04+1))
Type "help" for help.

postgres=# \q


参考: https://docs.timescale.com/latest/getting-started/installation/ubuntu/installation-apt-ubuntu

标签:12,postgresql,postgres,部署,sudo,VM,TimescaleDB,ubuntu
来源: https://www.cnblogs.com/guoew/p/12872981.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有