ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Installing Mattermost on CentOS 7

    IT Discussion
    linux ntg lab scale scale hc3 mattermost instant messaging centos centos 7 golang projects slack
    6
    17
    8.5k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • scottalanmillerS
      scottalanmiller
      last edited by

      Mattermost is a Slack competitor written in Google's new(ish) Go Language (GoLang.) Mattermost is fully free and open source. The biggest deal about Mattermost is that it is Slack compatible, so those Slack tools that you want to use will work with it.

      We get started with a normal, plain CentOS 7 minimal install. I'll make mine from a template.

      0_1460471965138_Screenshot from 2016-04-06 12:55:54.png

      yum install http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-redhat94-9.4-1.noarch.rpm
      yum install postgresql94-server postgresql94-contrib wget
      /usr/pgsql-9.4/bin/postgresql94-setup initdb
      systemctl enable postgresql-9.4.service
      systemctl start postgresql-9.4.service
      

      Now we need to work as the database user...

      sudo -i -u postgres
      psql
      CREATE DATABASE mattermost;
      CREATE USER mmuser WITH PASSWORD 'noonewilleverguess';
      GRANT ALL PRIVILEGES ON DATABASE mattermost to mmuser;
      \q
      exit
      

      Back as root, again. Uncomment the listen_addresses line.

      vi /var/lib/pgsql/9.4/data/postgresql.conf
      

      And in this file, we need to allow md5 instead of peer for the local connection at the bottom.
      vi /var/lib/pgsql/9.4/data/pg_hba.conf

      And now we need to reload the database and test:

      systemctl reload postgresql-9.4.service
      

      Here is the test...

      psql --host=127.0.0.1 --dbname=mattermost --username=mmuser --password
      

      If we get an error here, stop, nothing will work if this fails. Comment and we will troubleshoot. A success message looks like mattermost=> and you \q to quit.

      cd /tmp
      wget
      tar -xvzf mattermost.tar.gz
      mv mattermost /opt/
      mkdir -p /opt/mattermost/data
      useradd -r mattermost -U
      chown -R mattermost:mattermost /opt/mattermost
      chmod -R g+w /opt/mattermost
      cd /opt/mattermost/config
      vi config.json
      

      In this file you need to replace DriverName": "mysql" with DriverName": "postgres"

      And then replace "DataSource":"mmuser:mostest@tcp(dockerhost:3306)/mattermost_test?charset=utf8mb4,utf8" with "DataSource": "postgres://mmuser:[email protected]:5432/mattermost?sslmode=disable&connect_timeout=10"

      And then to test it out...

      cd /opt/mattermost/bin
      ./platform
      

      That's it. You should be able to log into the web interface from a web browser.

      1 Reply Last reply Reply Quote 6
      • scottalanmillerS
        scottalanmiller
        last edited by

        sc to come

        1 Reply Last reply Reply Quote 0
        • KellyK
          Kelly
          last edited by Kelly

          Why would you choose not to use their Docker install? This is an honest question, not a criticism.

          scottalanmillerS 1 Reply Last reply Reply Quote 0
          • scottalanmillerS
            scottalanmiller @Kelly
            last edited by

            @Kelly said:

            Why would you choose not to use their Docker install? This is an honest question, not a criticism.

            Don't have Docker set up currently.

            1 Reply Last reply Reply Quote 0
            • JaredBuschJ
              JaredBusch
              last edited by

              Why was postgres used? Nothing wrong with it of course, but not typically used on RHEL based stuff for the masses

              scottalanmillerS 1 Reply Last reply Reply Quote 2
              • wirestyle22W
                wirestyle22
                last edited by wirestyle22

                Hm. Interesting. I'd like to set this up on a test machine right now. Maybe I will tonight.

                1 Reply Last reply Reply Quote 1
                • scottalanmillerS
                  scottalanmiller @JaredBusch
                  last edited by

                  @JaredBusch said:

                  Why was postgres used? Nothing wrong with it of course, but not typically used on RHEL based stuff for the masses

                  both my preferred, so I didn't fight it, and the recommended one from the Mattermost project. They support MySQL, of course, but they push PostgreSQL as their preferred so I went with that.

                  JaredBuschJ KellyK 2 Replies Last reply Reply Quote 1
                  • JaredBuschJ
                    JaredBusch @scottalanmiller
                    last edited by

                    @scottalanmiller said:

                    @JaredBusch said:

                    Why was postgres used? Nothing wrong with it of course, but not typically used on RHEL based stuff for the masses

                    both my preferred, so I didn't fight it, and the recommended one from the Mattermost project. They support MySQL, of course, but they push PostgreSQL as their preferred so I went with that.

                    Interesting that they chose it is all.

                    scottalanmillerS 1 Reply Last reply Reply Quote 0
                    • wirestyle22W
                      wirestyle22
                      last edited by wirestyle22

                      @scottalanmiller said:

                      psql --host=127.0.0.1 --dbname=mattermost --username=mmuser --password

                      As a test:

                      psql --host=127.0.0.1 --dbname=mattermost --username=administrator --password

                      This is the user I created for these steps:

                      sudo -i -u postgres
                      psql
                      CREATE DATABASE mattermost;
                      CREATE USER mmuser WITH PASSWORD 'noonewilleverguess';
                      GRANT ALL PRIVILEGES ON DATABASE mattermost to mmuser;
                      \q
                      exit

                      Error:

                      [root@vultr ~]# psql --host=127.0.0.1 --dbname=mattermost --username=administrator --password
                      Password for user administrator:
                      psql: FATAL: Ident authentication failed for user "administrator"

                      scottalanmillerS 1 Reply Last reply Reply Quote 0
                      • scottalanmillerS
                        scottalanmiller @JaredBusch
                        last edited by

                        @JaredBusch said:

                        @scottalanmiller said:

                        @JaredBusch said:

                        Why was postgres used? Nothing wrong with it of course, but not typically used on RHEL based stuff for the masses

                        both my preferred, so I didn't fight it, and the recommended one from the Mattermost project. They support MySQL, of course, but they push PostgreSQL as their preferred so I went with that.

                        Interesting that they chose it is all.

                        Yes, widely supported but rarely the primary choice. It might be tied to Go for all that I know. Ruby, for example, as a culture leans to PostgreSQL not MySQL whereas PHP leans the other way. Don't know anything about the Go culture so just speculating.

                        1 Reply Last reply Reply Quote 0
                        • scottalanmillerS
                          scottalanmiller @wirestyle22
                          last edited by

                          @wirestyle22 said:

                          @scottalanmiller said:

                          psql --host=127.0.0.1 --dbname=mattermost --username=mmuser --password

                          As a test:

                          psql --host=127.0.0.1 --dbname=mattermost --username=administrator --password

                          This is the user I created for these steps:

                          sudo -i -u postgres
                          psql
                          CREATE DATABASE mattermost;
                          CREATE USER mmuser WITH PASSWORD 'noonewilleverguess';
                          GRANT ALL PRIVILEGES ON DATABASE mattermost to mmuser;
                          \q
                          exit

                          Error:

                          [root@vultr ~]# psql --host=127.0.0.1 --dbname=mattermost --username=administrator --password
                          Password for user administrator:
                          psql: FATAL: Ident authentication failed for user "administrator"

                          Did you change the "peer" to "md5" in the config file?

                          wirestyle22W A 2 Replies Last reply Reply Quote 0
                          • wirestyle22W
                            wirestyle22 @scottalanmiller
                            last edited by wirestyle22

                            @scottalanmiller said:

                            @wirestyle22 said:

                            @scottalanmiller said:

                            psql --host=127.0.0.1 --dbname=mattermost --username=mmuser --password

                            As a test:

                            psql --host=127.0.0.1 --dbname=mattermost --username=administrator --password

                            This is the user I created for these steps:

                            sudo -i -u postgres
                            psql
                            CREATE DATABASE mattermost;
                            CREATE USER mmuser WITH PASSWORD 'noonewilleverguess';
                            GRANT ALL PRIVILEGES ON DATABASE mattermost to mmuser;
                            \q
                            exit

                            Error:

                            [root@vultr ~]# psql --host=127.0.0.1 --dbname=mattermost --username=administrator --password
                            Password for user administrator:
                            psql: FATAL: Ident authentication failed for user "administrator"

                            Did you change the "peer" to "md5" in the config file?

                            Yes I did. I even went back, copy and pasted everything directly from the guide: mmuser noonewilleverguess etc and it still did the same thing.

                            Just to verify
                            0_1460657433761_mattermost.jpg

                            A 1 Reply Last reply Reply Quote 0
                            • KellyK
                              Kelly @scottalanmiller
                              last edited by

                              @scottalanmiller said:

                              @JaredBusch said:

                              Why was postgres used? Nothing wrong with it of course, but not typically used on RHEL based stuff for the masses

                              both my preferred, so I didn't fight it, and the recommended one from the Mattermost project. They support MySQL, of course, but they push PostgreSQL as their preferred so I went with that.

                              Oddly the Docker container uses MySQL. I'm playing with it right now to learn both Mattermost and Docker.

                              wirestyle22W 1 Reply Last reply Reply Quote 1
                              • wirestyle22W
                                wirestyle22 @Kelly
                                last edited by

                                @Kelly said:

                                @scottalanmiller said:

                                @JaredBusch said:

                                Why was postgres used? Nothing wrong with it of course, but not typically used on RHEL based stuff for the masses

                                both my preferred, so I didn't fight it, and the recommended one from the Mattermost project. They support MySQL, of course, but they push PostgreSQL as their preferred so I went with that.

                                Oddly the Docker container uses MySQL. I'm playing with it right now to learn both Mattermost and Docker.

                                That interesting. I need to play with Docker too.

                                1 Reply Last reply Reply Quote 0
                                • A
                                  aaronxiang @wirestyle22
                                  last edited by

                                  @wirestyle22 I have the same problem

                                  1 Reply Last reply Reply Quote 0
                                  • A
                                    aaronxiang @scottalanmiller
                                    last edited by

                                    @scottalanmiller I have the same problem. Confused

                                    1 Reply Last reply Reply Quote 0
                                    • NashBrydgesN
                                      NashBrydges
                                      last edited by

                                      For those who were still having problems getting Mattermost running on CentOS 7, I was also having the same problems and couldn't get beyond the postgres install. I found another guide and with a few tweaks, I was able to get this running.

                                      https://www.howtoforge.com/tutorial/install-mattermost-with-postgresql-and-nginx-on-centos7/

                                      The change that was required from this guide was in the "Download and Extract Mattermost"

                                      Instead of...
                                      [root@mattermost ~]# wget -q "https://github.com/mattermost/platform/releases/download/v2.0.0/mattermost.tar.gz" -O mattermost.tar.gz

                                      Use this...
                                      wget https://releases.mattermost.com/3.3.0/mattermost-team-3.3.0-linux-amd64.tar.gz

                                      Then in the next block, instead of...
                                      tar -xvzf mattermost.tar.gz

                                      Use this...
                                      tar -xvzf mattermost-team-3.3.0-linux-amd64.tar.gz

                                      After that, follow the guide to the letter and it will get you to this...
                                      0_1473265786807_upload-d89fe07b-7d71-4d39-8dd7-e00395f6aa84

                                      @aaronxiang @wirestyle22 @scottalanmiller

                                      1 Reply Last reply Reply Quote 0
                                      • 1 / 1
                                      • First post
                                        Last post