在树莓派3上搭建Mattermost

我想在Raspberry Pi 3上搭建Mattermost。

只需一种选项:
参考的网站

在RaspberryPi3上安装Mattermost的步骤:
Mattermost官方网站:管理员指南

MariaDB的配置

安装MariaDB

因为这个已经安装过了,所以略过。
尝试安装MySQL时,被替换为了MariaDB。
基本上以为是MySQL并进行了操作没有问题。

MariaDB的配置

请提供根密码。
应该在MariaDB创建时设置的。

$ sudo mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 44
Server version: 10.3.22-MariaDB-0+deb10u1 Raspbian 10

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> 

我将创建一个名为mmuser的用户。
密码将由用户自行设置。
我将确认用户是否能正确创建。

MariaDB [(none)]> create user 'mmuser'@'%' identified by ‘your-password‘
    -> ;
Query OK, 0 rows affected (0.081 sec)

MariaDB [(none)]> 
MariaDB [(none)]> select user,host from mysql.user;
+--------+-----------+
| user   | host      |
+--------+-----------+
| mmuser | %         |
| root   | localhost |
+--------+-----------+
2 rows in set (0.006 sec)

MariaDB [(none)]> 

创建一个名为Mattermost的数据库,并进行其他设置。
完成后,使用exit命令从MariaDB注销。

MariaDB [(none)]> create database mattermost;
Query OK, 1 row affected (0.005 sec)

MariaDB [(none)]> 
MariaDB [(none)]> grant all privileges on mattermost.* to 'mmuser'@'%';
Query OK, 0 rows affected (0.005 sec)

MariaDB [(none)]> 
MariaDB [(none)]> GRANT ALTER, CREATE, DELETE, DROP, INDEX, INSERT, SELECT, UPDATE ON mattermost.* TO 'mmuser'@'%';
Query OK, 0 rows affected (0.008 sec)

MariaDB [(none)]> 
MariaDB [(none)]> exit

引入Mattermost

如果您想在Raspberry Pi 3上安装Mattermost,由于官方没有提供支持,所以无法安装。原因是因为Raspberry Pi 3不支持64位系统。

$ getconf LONG_BIT
32

因此,从以下支持32位的网站上下载。

$ wget https://github.com/SmartHoneybee/ubiquitous-memory/releases/download/untagged-e5b3d8052fc39cbf9f41/mattermost-4.10.0-arm.tar.gz
--2020-04-25 20:07:11--  https://github.com/SmartHoneybee/ubiquitous-memory/releases/download/untagged-e5b3d8052fc39cbf9f41/mattermost-4.10.0-arm.tar.gz
github.com (github.com) をDNSに問いあわせています... 52.192.72.89
github.com (github.com)|52.192.72.89|:443 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 302 Found
場所: https://github-production-release-asset-2e65be.s3.amazonaws.com/107789421/d48fbbec-58dd-11e8-92a4-110280b0c291?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200425%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200425T110717Z&X-Amz-Expires=300&X-Amz-Signature=66c4852c7f282b3a477c3d42fe1a8d232b1113560e9125b2b63f4aff30c22e60&X-Amz-SignedHeaders=host&actor_id=0&repo_id=107789421&response-content-disposition=attachment%3B%20filename%3Dmattermost-4.10.0-arm.tar.gz&response-content-type=application%2Foctet-stream [続く]
--2020-04-25 20:07:17--  https://github-production-release-asset-2e65be.s3.amazonaws.com/107789421/d48fbbec-58dd-11e8-92a4-110280b0c291?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200425%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200425T110717Z&X-Amz-Expires=300&X-Amz-Signature=66c4852c7f282b3a477c3d42fe1a8d232b1113560e9125b2b63f4aff30c22e60&X-Amz-SignedHeaders=host&actor_id=0&repo_id=107789421&response-content-disposition=attachment%3B%20filename%3Dmattermost-4.10.0-arm.tar.gz&response-content-type=application%2Foctet-stream
github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com) をDNSに問いあわせています... 52.216.10.67
github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)|52.216.10.67|:443 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 38253617 (36M) [application/octet-stream]
`mattermost-4.10.0-arm.tar.gz' に保存中

mattermost-4.10.0-arm.tar.gz              100%[=====================================================================================>]  36.48M   338KB/s 時間 6m 3s    

2020-04-25 20:13:21 (103 KB/s) - `mattermost-4.10.0-arm.tar.gz' へ保存完了 [38253617/38253617]

一旦使用wget工具下载完成后,我们将对其进行解压操作。

$ tar -xvzf mattermost*.gz
mattermost/
mattermost/bin/
mattermost/bin/platform
mattermost/logs/
mattermost/config/
〜長いので省略〜
mattermost/client/main.9bbaf95cca8e85cd2584.js.map
mattermost/client/root.html
mattermost/MIT-COMPILED-LICENSE.md
mattermost/NOTICE.txt
mattermost/README.md

一旦解冻成功后,我们将继续进行剩余的设置工作。

$ sudo mv mattermost /opt
$ sudo mkdir /opt/mattermost/data
$ sudo useradd --system --user-group mattermost
$ sudo chown -R mattermost:mattermost /opt/mattermost
$ sudo chmod -R g+w /opt/mattermost

我会修改json文件的内容。
我会修改SqlSettings的DataSource。
这是修改后的内容。

$ sudo vi /opt/mattermost/config/config.json

“DataSource”: “mmuser:your-password@tcp(localhost:3306)/mattermost?charset=utf8mb4,utf8¥u0026readTimeout=30s¥u0026writeTimeout=30s”,

会启动 Mattermost。启动可能需要一点时间。

$ cd /opt/mattermost
$ sudo -u mattermost ./bin/platform
{"level":"info","ts":1587815625.8077798,"caller":"utils/i18n.go:83","msg":"Loaded system translations for 'en' from '/opt/mattermost/i18n/en.json'"}
{"level":"info","ts":1587815625.809742,"caller":"app/app.go:181","msg":"Server is initializing..."}
{"level":"info","ts":1587815625.8209016,"caller":"sqlstore/supplier.go:198","msg":"Pinging SQL master database"}
{"level":"info","ts":1587815628.0340216,"caller":"sqlstore/upgrade.go:89","msg":"The database schema has been set to version 4.10.0"}
{"level":"info","ts":1587815632.1226985,"caller":"commands/server.go:73","msg":"Current version is 4.10.0 (dev-arm-tag4.10.0/Wed May 16 05:49:18 UTC 2018//none)"}
{"level":"info","ts":1587815632.1229966,"caller":"commands/server.go:74","msg":"Enterprise Enabled: false"}
{"level":"info","ts":1587815632.1232486,"caller":"commands/server.go:75","msg":"Current working directory is /opt/mattermost"}
{"level":"info","ts":1587815632.1234004,"caller":"commands/server.go:76","msg":"Loaded config file from /opt/mattermost/config/config.json"}
{"level":"info","ts":1587815632.1240351,"caller":"utils/file_backend_local.go:30","msg":"Able to write files to local storage."}
{"level":"info","ts":1587815632.1338358,"caller":"app/app.go:527","msg":"Migrating roles to database."}
{"level":"info","ts":1587815632.2322626,"caller":"sqlstore/post_store.go:1243","msg":"Post.Message supports at most 16383 characters (65535 bytes)"}
{"level":"info","ts":1587815632.4392831,"caller":"app/plugin.go:374","msg":"Starting up plugins"}
{"level":"warn","ts":1587815632.4402778,"caller":"app/plugin.go:404","msg":"plugin sandboxing is not supported. plugins will run with the same access level as the server. See documentation to learn more: https://developers.mattermost.com/extend/plugins/security/","error":"unsupported architecture"}
{"level":"info","ts":1587815632.4408529,"caller":"app/server.go:100","msg":"Starting Server..."}
{"level":"info","ts":1587815632.441362,"caller":"app/server.go:139","msg":"Server is listening on [::]:8065"}
{"level":"info","ts":1587815632.5323699,"caller":"app/web_hub.go:67","msg":"Starting 8 websocket hubs"}
{"level":"info","ts":1587815632.7220874,"caller":"jobs/workers.go:57","msg":"Starting workers"}
{"level":"info","ts":1587815632.7249198,"caller":"jobs/schedulers.go:62","msg":"Starting schedulers."}

如果站起来后,在Raspberry Pi 3的浏览器中访问 http://localhost:8065 ,将会打开Mattermost的界面。
从另一台电脑上,也可以通过访问 http://树莓派3的IP地址:8065 来打开。

个人的困难点

    我不知道从Mattermost公式网站下载的资源是64位的,因此无法运行。我在修改json文件时失败了。因为设置了dockerhost的查看配置,直到我注意到那里的错误才花了一些时间。
广告
将在 10 秒后关闭
bannerAds