PostgreSQL for Linux の Power Systems サーバーへのインストール

このタスクを使用して、PostgreSQL for Linux を Power Systems サーバーにインストールします。トレーニング・サーバーとスタンドアロン・エッジは PostgreSQL データベースを使用します。

手順

  1. 次のコマンドを使用することで、su を実行して root に切り替えます。
    sudo su
  2. PostgreSQL のソースをダウンロードします。
    wget https://ftp.postgresql.org/pub/source/v9.5.13/postgresql-9.5.13.tar.gz
  3. 次のコマンドを使用して、PostgreSQL をインストールします。
    tar -zxvf postgresql-9.5.13.tar.gz
    cd postgresql-9.5.13/
    yum -y install readline-devel
    ./configure --prefix=/usr/local/postgresql
    make
    make install
  4. ユーザー postgres を作成し、postgres ディレクトリーの所有者を変更します。
    useradd postgres
    chown -R postgres:postgres /usr/local/postgresql/
  5. ユーザー postgres に切り替えます。
    su postgres
  6. postgres に対するシステム・パスを構成します。
    vi ~/.bashrc
    PGHOME=/usr/local/postgresql
    export PGHOME
    PGDATA=/usr/local/postgresql/data
    export PGDATA
    PATH=$PATH:$HOME/.local/bin:$HOME/bin:$PGHOME/bin
    export PATH
  7. 構成を読み込みます。
    source ~/.bashrc
  8. PostgreSQL データベースを初期化します。
    initdb
  9. データベースを構成します。vi で postgresql.conf を開きます。
    vi /usr/local/postgresql/data/postgresql.conf
    次のコードを変更します。
    #listen_address='localhost' 
    #port = 5432 

    変更後のコード:
    listen_address='*' 
    port = 5432

    vi で pg_hba.conf ファイルを開きます。
    vi /usr/local/postgresql/data/pg_hba.conf
    以下の行をファイルに追加します。
    host all all 0.0.0.0/0 trust
  10. PostgreSQL を再始動します。
    pg_ctl -D /usr/local/postgresql/data -l logfile restart
  11. PostgreSQL データベース内のユーザー postgres のパスワードを変更します。
    psql
    ALTER USER postgres WITH PASSWORD 'password';
    ¥q
    PostgreSQL サービスが開始していない場合は、次のコマンドを実行します。
    su postgres
    vi ~/.bashrc
    ファイルに /usr/local/pgsql/bin/ を追加します。
    export PATH=/usr/local/cuda-8.0/bin:$PATH:/usr/local/pgsql/bin/
    以下のコマンドを実行します。
    source ~/.bashrc
  12. PostgreSQL にデータベース・スキーマを作成します。psql コンソールで次のコマンドを実行します。
    create database edge with owner postgres encoding='UTF-8' lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template0;
    データベースに以下の表を作成します。
    CREATE TABLE vi_tenant_inspectionresult(id text, info jsonb); 
    CREATE TABLE vi_tenant_notification(id text, info jsonb); 
    CREATE TABLE vi_tenant_defectsummary(id text, info jsonb); 
    CREATE TABLE vi_tenant_uploaddataset(id text, info jsonb); 
    CREATE TABLE vi_tenant_syncprocess(id text, info jsonb); 
    CREATE TABLE vi_tenant_model(id text, info jsonb); 
    CREATE TABLE vi_tenant_datagroup(id text, info jsonb);

    ここで tenant は、Maximo® PQI SaaS Visual Insights のセンターの操作ユーザーのテナントです。テナントの値は、センター・アプリケーションのユーザー・インターフェースでユーザー・プロファイルから取得できます。