serverapps:nextcloud:03.postgresql_config
差分
このページの2つのバージョン間の差分を表示します。
次のリビジョン | 前のリビジョン | ||
serverapps:nextcloud:03.postgresql_config [2023/08/07 03:19] – 作成 hayashi | serverapps:nextcloud:03.postgresql_config [2023/08/07 03:20] (現在) – hayashi | ||
---|---|---|---|
行 1: | 行 1: | ||
====== 03.PostgreSQLサーバの設定 ====== | ====== 03.PostgreSQLサーバの設定 ====== | ||
+ | |||
+ | |||
+ | ===== rc.conf ===== | ||
+ | |||
+ | / | ||
+ | |||
+ | postgresql_enable=" | ||
+ | postgresql_data="/ | ||
+ | |||
+ | data領域はzfsで別にとるので、disk追加してpool作成 | ||
+ | |||
+ | # zpool create zdata /dev/adaxx | ||
+ | # zfs create -o mountpoint=/ | ||
+ | # mkdir / | ||
+ | # chown postgres: | ||
+ | |||
+ | ===== 初期化 ===== | ||
+ | |||
+ | |||
+ | < | ||
+ | # service postgresql initdb | ||
+ | The files belonging to this database system will be owned by user " | ||
+ | This user must also own the server process. | ||
+ | |||
+ | The database cluster will be initialized with locales | ||
+ | COLLATE: | ||
+ | CTYPE: | ||
+ | MESSAGES: C.UTF-8 | ||
+ | MONETARY: C.UTF-8 | ||
+ | NUMERIC: | ||
+ | TIME: | ||
+ | The default text search configuration will be set to " | ||
+ | |||
+ | Data page checksums are disabled. | ||
+ | |||
+ | fixing permissions on existing directory / | ||
+ | creating subdirectories ... ok | ||
+ | selecting dynamic shared memory implementation ... posix | ||
+ | selecting default max_connections ... 100 | ||
+ | selecting default shared_buffers ... 128MB | ||
+ | selecting default time zone ... Japan | ||
+ | creating configuration files ... ok | ||
+ | running bootstrap script ... ok | ||
+ | performing post-bootstrap initialization ... ok | ||
+ | syncing data to disk ... ok | ||
+ | |||
+ | initdb: warning: enabling " | ||
+ | You can change this by editing pg_hba.conf or using the option -A, or | ||
+ | --auth-local and --auth-host, | ||
+ | |||
+ | Success. You can now start the database server using: | ||
+ | |||
+ | / | ||
+ | </ | ||
+ | |||
+ | ===== pg_hba.conf の編集 ===== | ||
+ | |||
+ | 外部からの接続を / | ||
+ | |||
+ | # TYPE DATABASE | ||
+ | host all | ||
+ | |||
+ | postgresql.confのlisten_addresses も変更 | ||
+ | |||
+ | listen_addresses = ' | ||
+ | |||
+ | ===== 起動 ===== | ||
+ | PostgrSQLを起動 | ||
+ | # service postgresql start | ||
+ | |||
+ | ===== NextCloud用設定 ===== | ||
+ | |||
+ | < | ||
+ | # psql -h localhost -U postgres | ||
+ | psql (13.11) | ||
+ | Type " | ||
+ | |||
+ | postgres=# CREATE ROLE ncadm WITH LOGIN PASSWORD ' | ||
+ | CREATE ROLE | ||
+ | postgres=# CREATE DATABASE nc WITH OWNER ncadm TEMPLATE template0 | ||
+ | postgres=# ENCODING UTF8 LC_COLLATE ' | ||
+ | CREATE DATABASE | ||
+ | </ | ||
serverapps/nextcloud/03.postgresql_config.1691378363.txt.gz · 最終更新: 2023/08/07 03:19 by hayashi