LoginSignup
2
2

More than 5 years have passed since last update.

Mattermost Team Edition のインストール

Last updated at Posted at 2019-03-01

やってみたのでメモ

環境

OS・ミドルウェア バージョン
OS CentOS Linux release 7.6.1810 (Core)
PostgreSQL 11.2
Mattermost 5.8.0

前提

  • PostgreSQL はインストール済みであること

データベース設定手順

  1. postgres ユーザにログインする

    # su - postgres
    
  2. PostgreSQL にログインする

    $ psql
    psql (11.2)
    Type "help" for help.
    
  3. Mattermost 用 DB を作成する

    postgres=# CREATE DATABASE mattermost;
    CREATE DATABASE
    
  4. Mattermost 用 DB ユーザを作成する

    postgres=# CREATE USER mmuser WITH PASSWORD '<パスワード>';
    CREATE ROLE
    
  5. Mattermost 用 DB にユーザアクセス権限を付与する

    postgres=# GRANT ALL PRIVILEGES ON DATABASE mattermost to mmuser;
    GRANT
    
  6. postgresql.confファイルの設定を編集する

    # vi /var/lib/pgsql/11/data/postgresql.conf
    
    postgresql.conf
    listen_addresses = '*'
    
  7. pg_hba.confファイルの設定を編集する

    # vi /var/lib/pgsql/11/data/pg_hba.conf
    
    # TYPE  DATABASE        USER            ADDRESS                 METHOD
    
    # "local" is for Unix domain socket connections only
    local   all             all                                     trust
    # IPv4 local connections:
    host    all             all             127.0.0.1/32            md5
    # IPv6 local connections:
    host    all             all             ::1/128                 md5
    # Allow replication connections from localhost, by a user with the
    # replication privilege.
    local   replication     all                                     trust
    host    replication     all             127.0.0.1/32            md5
    host    replication     all             ::1/128                 md5
    

Mattermost インストール手順

  1. yumリポジトリを更新する

    # yum update
    
  2. バイナリファイルをダウンロードする(ダウンロードサイトからダウンロード)

    # curl -LkvOf https://releases.mattermost.com/5.8.0/mattermost-5.8.0-linux-amd64.tar.gz
    
  3. 破損がないか確認する(バージョン履歴を参照)

    # sha256sum mattermost-5.8.0-linux-amd64.tar.gz
    f95c438c81171f6929c0f2438c358b7e1ccbd343546b2b3e75a5f9d14b0242cd  mattermost-5.8.0-linux-amd64.tar.gz
    
  4. 展開する

    # tar -xvzf mattermost-5.8.0-linux-amd64.tar.gz
    
  5. 展開したディレクトリを/opt配下に移動

    # mv mattermost /opt
    
  6. データ用ディレクトリを作成

    # mkdir -p /opt/mattermost/data
    
  7. Mattermost 用ユーザを作成する

    # useradd --system --user-group mattermost
    
  8. ディレクトリの所有者を変更する

    # chown -R mattermost:mattermost /opt/mattermost
    
  9. ディレクトリの権限を設定する

    # chmod -R g+w /opt/mattermost
    
  10. config.json ファイルを修正する

    # vi /opt/mattermost/config/config.json
    
    "SqlSettings": {
        "DriverName": "postgres",
        "DataSource": "postgres://mmuser:<mmuserのパスワード>@localhost:5432/mattermost?sslmode=disable\u0026connect_timeout=10",
        "DataSourceReplicas": null,
        "DataSourceSearchReplicas": null,
        "MaxIdleConns": 20,
        "ConnMaxLifetimeMilliseconds": 3600000,
        "MaxOpenConns": 300,
        "Trace": false,
        "AtRestEncryptKey": "h59xds1srgnbnj1849b5tat9xtf8kkex",
        "QueryTimeout": 30
    },
    
  11. サービスファイルを作成する

    # vi /usr/lib/systemd/system/mattermost.service
    
    mattermost.service
    [Unit]
    Description=Mattermost
    After=syslog.target network.target postgresql-11.2.service
    
    [Service]
    Type=notify
    WorkingDirectory=/opt/mattermost
    User=mattermost
    ExecStart=/opt/mattermost/bin/mattermost
    PIDFile=/var/spool/mattermost/pid/master.pid
    TimeoutStartSec=3600
    LimitNOFILE=49152
    
    [Install]
    WantedBy=multi-user.target
    
  12. サービスファイルの権限を修正する

    # chmod 664 /usr/lib/systemd/system/mattermost.service
    
  13. サービスファイルを再読み込みする

    # systemctl daemon-reload
    
  14. 自動起動を設定する

    # systemctl enable mattermost
    
  15. 起動する

    # systemctl start mattermost
    

確認

次のURLにアクセスすると、Mattermost の画面が表示される

http://<IPアドレスもしくはホスト名>:8065

Mattermostログイン画面.png

参考

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2