- README.md: Build and deployment guide for beginners - Extend-Function.md: Extended files list and version upgrade guide - Unlock-License.md: License check removal documentation - Dockerfile.local: Local source build support 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
329 lines
6.8 KiB
Markdown
329 lines
6.8 KiB
Markdown
# Mattermost Community Enterprise
|
|
|
|
라이선스 없이 Enterprise 기능을 사용할 수 있는 Mattermost 오픈소스 빌드입니다.
|
|
|
|
## 시스템 요구사항
|
|
|
|
- **OS**: Rocky Linux 9 / CentOS 9 / RHEL 9 (권장) 또는 Ubuntu 22.04+
|
|
- **CPU**: 최소 2 Core
|
|
- **RAM**: 최소 2GB (권장 4GB)
|
|
- **디스크**: 최소 20GB
|
|
- **네트워크**: 인터넷 연결 필요 (빌드 시)
|
|
|
|
## 빠른 시작 (Docker 사용)
|
|
|
|
### 1. 소스 코드 받기
|
|
|
|
```bash
|
|
git clone http://10.0.4.213:3000/claude/mattermost-community-enterprise.git
|
|
cd mattermost-community-enterprise
|
|
```
|
|
|
|
### 2. Docker 이미지 빌드
|
|
|
|
```bash
|
|
# 로컬 소스로 빌드 (권장)
|
|
docker build -f Dockerfile.local -t mattermost-community:latest .
|
|
|
|
# 또는 Git에서 직접 빌드 (네트워크 필요)
|
|
docker build -f Dockerfile.mattermost -t mattermost-community:latest .
|
|
```
|
|
|
|
### 3. Docker Compose로 실행
|
|
|
|
```bash
|
|
# docker-compose.yml 파일 생성 (아래 내용 참고)
|
|
docker compose up -d
|
|
```
|
|
|
|
**docker-compose.yml 예시:**
|
|
|
|
```yaml
|
|
version: '3.8'
|
|
services:
|
|
postgres:
|
|
image: postgres:15
|
|
environment:
|
|
POSTGRES_DB: mattermost
|
|
POSTGRES_USER: mmuser
|
|
POSTGRES_PASSWORD: mmpassword
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
restart: unless-stopped
|
|
|
|
mattermost:
|
|
image: mattermost-community:latest
|
|
depends_on:
|
|
- postgres
|
|
ports:
|
|
- "8065:8065"
|
|
environment:
|
|
MM_SQLSETTINGS_DRIVERNAME: postgres
|
|
MM_SQLSETTINGS_DATASOURCE: postgres://mmuser:mmpassword@postgres:5432/mattermost?sslmode=disable
|
|
volumes:
|
|
- mattermost_data:/mattermost/data
|
|
- mattermost_logs:/mattermost/logs
|
|
- mattermost_plugins:/mattermost/plugins
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
postgres_data:
|
|
mattermost_data:
|
|
mattermost_logs:
|
|
mattermost_plugins:
|
|
```
|
|
|
|
### 4. 접속
|
|
|
|
브라우저에서 `http://서버IP:8065` 로 접속합니다.
|
|
|
|
---
|
|
|
|
## 수동 빌드 (Docker 없이)
|
|
|
|
### 1. 의존성 설치
|
|
|
|
**Rocky Linux / CentOS 9:**
|
|
|
|
```bash
|
|
sudo dnf install -y git golang make gcc
|
|
```
|
|
|
|
**Ubuntu 22.04:**
|
|
|
|
```bash
|
|
sudo apt update
|
|
sudo apt install -y git golang-go make gcc
|
|
```
|
|
|
|
### 2. Go 버전 확인
|
|
|
|
Go 1.21 이상이 필요합니다.
|
|
|
|
```bash
|
|
go version
|
|
# go version go1.21.x linux/amd64
|
|
```
|
|
|
|
Go 버전이 낮으면 최신 버전을 설치합니다:
|
|
|
|
```bash
|
|
# Rocky Linux
|
|
sudo dnf module enable go-toolset:rhel9
|
|
sudo dnf install -y go-toolset
|
|
|
|
# 또는 직접 설치
|
|
wget https://go.dev/dl/go1.22.0.linux-amd64.tar.gz
|
|
sudo tar -C /usr/local -xzf go1.22.0.linux-amd64.tar.gz
|
|
export PATH=$PATH:/usr/local/go/bin
|
|
```
|
|
|
|
### 3. 소스 코드 받기
|
|
|
|
```bash
|
|
git clone http://10.0.4.213:3000/claude/mattermost-community-enterprise.git
|
|
cd mattermost-community-enterprise
|
|
```
|
|
|
|
### 4. 빌드
|
|
|
|
```bash
|
|
# vendor 디렉토리 사용 (오프라인/에어갭 환경)
|
|
go build -v -mod=vendor -o mattermost ./cmd/mattermost
|
|
|
|
# 또는 온라인 환경에서 최신 의존성 사용
|
|
go mod download
|
|
go build -v -o mattermost ./cmd/mattermost
|
|
```
|
|
|
|
### 5. 디렉토리 구조 준비
|
|
|
|
```bash
|
|
mkdir -p /opt/mattermost/{bin,config,data,logs,plugins,client/plugins}
|
|
|
|
# 바이너리 복사
|
|
cp mattermost /opt/mattermost/bin/
|
|
|
|
# 설정 및 리소스 복사
|
|
cp -r config/* /opt/mattermost/config/
|
|
cp -r i18n /opt/mattermost/
|
|
cp -r fonts /opt/mattermost/
|
|
cp -r templates /opt/mattermost/
|
|
cp -r client/* /opt/mattermost/client/
|
|
```
|
|
|
|
### 6. 데이터베이스 설정
|
|
|
|
**PostgreSQL 설치 및 설정:**
|
|
|
|
```bash
|
|
# PostgreSQL 설치
|
|
sudo dnf install -y postgresql-server postgresql
|
|
sudo postgresql-setup --initdb
|
|
sudo systemctl enable --now postgresql
|
|
|
|
# 데이터베이스 생성
|
|
sudo -u postgres psql <<EOF
|
|
CREATE DATABASE mattermost;
|
|
CREATE USER mmuser WITH PASSWORD 'mmpassword';
|
|
GRANT ALL PRIVILEGES ON DATABASE mattermost TO mmuser;
|
|
ALTER DATABASE mattermost OWNER TO mmuser;
|
|
\c mattermost
|
|
GRANT ALL ON SCHEMA public TO mmuser;
|
|
EOF
|
|
```
|
|
|
|
### 7. 설정 파일 수정
|
|
|
|
`/opt/mattermost/config/config.json` 수정:
|
|
|
|
```json
|
|
{
|
|
"SqlSettings": {
|
|
"DriverName": "postgres",
|
|
"DataSource": "postgres://mmuser:mmpassword@localhost:5432/mattermost?sslmode=disable"
|
|
},
|
|
"ServiceSettings": {
|
|
"SiteURL": "http://서버IP:8065",
|
|
"ListenAddress": ":8065"
|
|
}
|
|
}
|
|
```
|
|
|
|
### 8. 실행
|
|
|
|
```bash
|
|
cd /opt/mattermost
|
|
./bin/mattermost
|
|
```
|
|
|
|
### 9. Systemd 서비스 등록 (선택)
|
|
|
|
`/etc/systemd/system/mattermost.service` 파일 생성:
|
|
|
|
```ini
|
|
[Unit]
|
|
Description=Mattermost
|
|
After=network.target postgresql.service
|
|
|
|
[Service]
|
|
Type=simple
|
|
ExecStart=/opt/mattermost/bin/mattermost
|
|
WorkingDirectory=/opt/mattermost
|
|
User=mattermost
|
|
Group=mattermost
|
|
Restart=always
|
|
RestartSec=10
|
|
LimitNOFILE=49152
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
```
|
|
|
|
서비스 활성화:
|
|
|
|
```bash
|
|
# mattermost 사용자 생성
|
|
sudo useradd -r -s /sbin/nologin mattermost
|
|
sudo chown -R mattermost:mattermost /opt/mattermost
|
|
|
|
# 서비스 시작
|
|
sudo systemctl daemon-reload
|
|
sudo systemctl enable --now mattermost
|
|
sudo systemctl status mattermost
|
|
```
|
|
|
|
---
|
|
|
|
## HA 클러스터 구성
|
|
|
|
고가용성을 위해 여러 Mattermost 인스턴스를 클러스터로 구성할 수 있습니다.
|
|
|
|
### Redis 설정
|
|
|
|
클러스터 모드에서는 Redis가 필요합니다:
|
|
|
|
```bash
|
|
docker run -d --name redis -p 6379:6379 redis:7
|
|
```
|
|
|
|
### 환경 변수 설정
|
|
|
|
각 Mattermost 노드에서:
|
|
|
|
```bash
|
|
export MM_CLUSTERSETTINGS_ENABLE=true
|
|
export MM_CLUSTERSETTINGS_CLUSTERNAME=mattermost-cluster
|
|
export MM_CLUSTERSETTINGS_REDISHOST=redis호스트:6379
|
|
```
|
|
|
|
### HAProxy 로드밸런서
|
|
|
|
```
|
|
frontend mattermost
|
|
bind *:80
|
|
default_backend mattermost_servers
|
|
|
|
backend mattermost_servers
|
|
balance roundrobin
|
|
cookie SERVERID insert indirect nocache
|
|
server mm1 10.0.4.112:8065 check cookie mm1
|
|
server mm2 10.0.4.49:8065 check cookie mm2
|
|
```
|
|
|
|
---
|
|
|
|
## 트러블슈팅
|
|
|
|
### 빌드 오류: "cannot find module"
|
|
|
|
```bash
|
|
# vendor 디렉토리 재생성
|
|
go mod vendor
|
|
```
|
|
|
|
### 실행 오류: "config.json not found"
|
|
|
|
```bash
|
|
# 설정 파일 위치 지정
|
|
./mattermost --config /opt/mattermost/config/config.json
|
|
```
|
|
|
|
### 데이터베이스 연결 실패
|
|
|
|
1. PostgreSQL 서비스 상태 확인: `systemctl status postgresql`
|
|
2. 연결 테스트: `psql -h localhost -U mmuser -d mattermost`
|
|
3. pg_hba.conf에서 인증 방식 확인
|
|
|
|
### 포트 8065 접근 불가
|
|
|
|
```bash
|
|
# 방화벽 포트 열기
|
|
sudo firewall-cmd --permanent --add-port=8065/tcp
|
|
sudo firewall-cmd --reload
|
|
```
|
|
|
|
---
|
|
|
|
## 지원되는 Enterprise 기능
|
|
|
|
이 빌드에서 라이선스 없이 사용 가능한 기능:
|
|
|
|
- LDAP/AD 연동
|
|
- SAML SSO
|
|
- 고가용성 클러스터링
|
|
- Prometheus 메트릭
|
|
- 커스텀 권한 스키마
|
|
- 데이터 보존 정책
|
|
- 컴플라이언스 내보내기
|
|
- 메시지 내보내기
|
|
|
|
자세한 내용은 `Extend-Function.md`와 `Unlock-License.md`를 참조하세요.
|
|
|
|
---
|
|
|
|
## 라이선스
|
|
|
|
이 프로젝트는 교육 및 개인 사용 목적으로 제공됩니다.
|
|
상용 환경에서는 Mattermost 공식 라이선스 구매를 권장합니다.
|