serverapps:nextcloud:02.postgresql_server
差分
このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン前のリビジョン | |||
| serverapps:nextcloud:02.postgresql_server [2023/08/07 03:18] – hayashi | serverapps:nextcloud:02.postgresql_server [2023/08/07 03:19] (現在) – hayashi | ||
|---|---|---|---|
| 行 28: | 行 28: | ||
| * バックアップ:以下が役に立つかも | * バックアップ:以下が役に立つかも | ||
| * / | * / | ||
| - | |||
| - | ===== 設定 ===== | ||
| - | ==== 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/02.postgresql_server.1691378317.txt.gz · 最終更新: by hayashi
