首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如果您安装了M1,您如何在MAC OS postgress.app (苹果硅酮)上安装postgress.app?

如果您安装了M1,您如何在MAC OS postgress.app (苹果硅酮)上安装postgress.app?
EN

Stack Overflow用户
提问于 2022-08-05 10:11:47
回答 2查看 319关注 0票数 0

编辑:我知道如果你通过自制软件安装了postgres,使用国产Postgress.app会更容易,但出于其他原因,我想保留我的设置。

你是如何在苹果的Sillicone M1芯片上安装时间升级的?

我收到了这个错误

代码语言:javascript
复制
tsdb=# CREATE EXTENSION IF NOT EXISTS timescaledb;
ERROR:  could not open extension control file "/Applications/Postgres.app/Contents/Versions/14/share/postgresql/extension/timescaledb.control": No such file or directory

在遵循以下说明之后

https://docs.timescale.com/install/latest/self-hosted/installation-macos/#install-self-hosted-timescaledb-using-homebrew

EN

回答 2

Stack Overflow用户

发布于 2022-08-05 10:11:47

这个问题没有堆叠溢出,所以我决定问并回答它。

步骤1:确保安装了最新的postgress.app

您至少需要使用postgres v14 of postgress.app,如果您不这样做,就会得到这个错误。

代码语言:javascript
复制
ld: can't link with a main executable file '/Applications/Postgres.app/Contents/Versions/13/bin/postgres' for architecture arm64

因为旧版本只使用英特尔

第2步:按照自制的说明操作

使用说明这里

但是当你走到这一步的时候,timescaledb-tune --quiet --yes,你开始遵循我的命令

第三步:我的指示

步骤3.1

由于homebrew方法希望使用homebrew,所以您必须通过运行以下命令将running命令指向postgress.app配置文件

timescaledb-tune --yes --conf-path=/Users/tawanda/Library/Application Support/Postgres/var-14/postgresql.conf

如果以后用postgres的版本替换var-14

步骤3.2

手动运行您自己的安装程序,如下所示,因为随时间刻度的脚本不适用于您的posgresss.app用例

代码语言:javascript
复制
/usr/bin/install -c -m 755 $(find /opt/homebrew/Cellar/timescaledb/2.7.2/lib/timescaledb/postgresql/ -name "timescaledb*.so")  /Applications/Postgres.app/Contents/Versions/14/lib/postgresql

/usr/bin/install -c -m 644 /opt/homebrew/Cellar/timescaledb/2.7.2/share/timescaledb/* /Applications/Postgres.app/Contents/Versions/14/share/postgresql/extension/

将版本14和版本2.7.2分别替换为后置版本和时间刻度版本。

step3.3

初始化扩展

代码语言:javascript
复制
tawanda=# CREATE database tsdb;
    
tawanda=# \c tsdb;

tsdb=# CREATE EXTENSION IF NOT EXISTS timescaledb;
WARNING:
WELCOME TO
 _____ _                               _     ____________
|_   _(_)                             | |    |  _  \ ___ \
  | |  _ _ __ ___   ___  ___  ___ __ _| | ___| | | | |_/ /
  | | | |  _ ` _ \ / _ \/ __|/ __/ _` | |/ _ \ | | | ___ \
  | | | | | | | | |  __/\__ \ (_| (_| | |  __/ |/ /| |_/ /
  |_| |_|_| |_| |_|\___||___/\___\__,_|_|\___|___/ \____/
               Running version 2.7.2
For more information on TimescaleDB, please visit the following links:

 1. Getting started: https://docs.timescale.com/timescaledb/latest/getting-started
 2. API reference documentation: https://docs.timescale.com/api/latest
 3. How TimescaleDB is designed: https://docs.timescale.com/timescaledb/latest/overview/core-concepts

Note: TimescaleDB collects anonymous reports to better understand and assist our users.
For more information and how to disable, please see our docs https://docs.timescale.com/timescaledb/latest/how-to-guides/configuration/telemetry.

CREATE EXTENSION
票数 2
EN

Stack Overflow用户

发布于 2022-10-22 18:47:53

我使用的一个简单的解决方案是在docker中运行timescaledb,特别是使用docker组合。这允许您将所有数据保存在一个停靠卷中,这样您就可以将数据库从计算机移动到计算机,并从docker-compose.yml文件中设置端口、密码等。

下面是我用来运行本地timescaledb实例的docker-compose.yml文件:

代码语言:javascript
复制
version: "3"

# special port for timescaledb: 5445
services:
  timescaledb:
    image: timescale/timescaledb:latest-pg14
    ports:
      - "5445:5432"
    environment:
      - POSTGRES_PASSWORD=XXXXXXXXXXXXXX
    restart: always
    volumes:
      - type: bind
        source: ./timescaledb-data
        target: /var/lib/postgresql/data
    logging:
      driver: "json-file"
      options:
        max-size: "1000k"
        max-file: "5"
        compress: "true"

注意到:我将timescaledb端口映射到5445,因为我的系统上也运行了postgres。这使我可以让postgres运行到其他需要它的应用程序,同时仍然访问timescaledb。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73248119

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档