JFrog Artifactory 総合ガイド — 機能・アーキテクチャ・設定の全容
本ドキュメントは JFrog Artifactory の全体像を俯瞰し、アーキテクチャの深部から運用上の設定例までを網羅的に解説する。対象読者は CI/CD パイプラインやアーティファクト管理に一定の知見を持つエンジニアを想定している。
目次
- はじめに — JFrog Artifactory とは何か
- アーキテクチャの全体像
- リポジトリ・タイプの詳細
- 対応パッケージ形式と設定例
- ストレージとデータベース
- セキュリティとアクセス制御
- レプリケーションと高可用性(HA)
- JFrog CLI と REST API
- CI/CD パイプラインとの統合
- JFrog Xray によるセキュリティスキャン
- Artifactory Query Language(AQL)
- プロパティ・メタデータ管理
- Docker / OCI コンテナレジストリ
- Helm チャートリポジトリ
- ビルド情報管理(Build Info)
- リリースバンドルとディストリビューション
- フェデレーテッドリポジトリ
- クリーンアップとメンテナンス
- 監視・ログ・トラブルシューティング
- system.yaml による設定管理
- AI/ML モデルレジストリ
- デプロイメントオプション
- バックアップとディザスタリカバリ
- パフォーマンスチューニング
- ベストプラクティスとアンチパターン
1. はじめに — JFrog Artifactory とは何か
1.1 概要
JFrog Artifactory は、JFrog 社が開発した ユニバーサル・アーティファクト・リポジトリマネージャ である。ソフトウェア開発ライフサイクル(SDLC)全体を通じて、バイナリ成果物(アーティファクト)を一元的に管理・配布するためのプラットフォームとして広く採用されている。
Artifactory の主要な特徴は以下のとおりである。
- ユニバーサルパッケージ管理: Maven、npm、PyPI、Docker、Helm、NuGet、Go、Cargo など 40 以上のパッケージ形式 をネイティブサポート
- 一元的なアーティファクト管理: ローカル、リモート、バーチャルの 3 種類のリポジトリを組み合わせて柔軟な管理体系を構築
- エンタープライズスケーラビリティ: 高可用性(HA)構成やマルチサイトレプリケーションにより、大規模組織のニーズに対応
- セキュリティ統合: JFrog Xray と連携した脆弱性スキャン、ライセンスコンプライアンスチェック
- CI/CD ネイティブ: Jenkins、GitHub Actions、GitLab CI、Azure DevOps など主要な CI/CD ツールとのシームレスな統合
- 豊富な API: REST API および GraphQL API により、あらゆるワークフローの自動化が可能
1.2 JFrog プラットフォームにおける位置づけ
Artifactory は JFrog プラットフォームの中核を構成するコンポーネントである。JFrog プラットフォーム全体は以下の主要サービスで構成される。
| コンポーネント | 役割 |
|---|
| JFrog Artifactory | アーティファクトの保管・管理・配布(本ドキュメントの主題) |
| JFrog Xray | アーティファクトの脆弱性・ライセンスコンプライアンス解析 |
| JFrog Distribution | リリースバンドルの作成とエッジノードへの配布 |
| JFrog Pipelines | CI/CD パイプラインのオーケストレーション |
| JFrog Connect | IoT デバイスへのソフトウェア配布 |
| JFrog Advanced Security | ソフトウェアサプライチェーン全体のセキュリティ分析 |
| JFrog Curation | OSS パッケージの承認・制御ゲートウェイ |
┌──────────────────────────────────────────────────────────┐
│ JFrog Platform │
│ ┌─────────────┐ ┌───────────┐ ┌──────────────────┐ │
│ │ Artifactory │ │ Xray │ │ Distribution │ │
│ │ (Repository │ │ (Security │ │ (Release │ │
│ │ Manager) │ │ Scanner) │ │ Bundles) │ │
│ └──────┬──────┘ └─────┬─────┘ └────────┬─────────┘ │
│ │ │ │ │
│ ┌──────┴───────────────┴──────────────────┴─────────┐ │
│ │ Shared Platform Services │ │
│ │ (Auth, Access Control, Metadata, Event System) │ │
│ └───────────────────────────────────────────────────┘ │
│ ┌──────────────┐ ┌─────────────┐ ┌───────────────┐ │
│ │ Pipelines │ │ Connect │ │ Advanced │ │
│ │ (CI/CD) │ │ (IoT) │ │ Security │ │
│ └──────────────┘ └─────────────┘ └───────────────┘ │
└──────────────────────────────────────────────────────────┘
1.3 ライセンスとエディション
| エディション | 主な機能 | 対象 |
|---|
| OSS(Open Source) | ローカル・リモート・バーチャルリポジトリ、Maven/Gradle/Ivy/Docker 対応 | 小規模チーム |
| JCR(JFrog Container Registry) | Docker/Helm に特化した無料レジストリ | コンテナワークロード |
| Pro | 全パッケージ形式、HA 構成、レプリケーション | 中規模組織 |
| Enterprise | マルチサイト、フェデレーションリポジトリ、高度な管理機能 | 大規模組織 |
| Enterprise+ | JFrog Platform 全機能(Xray、Distribution、Pipelines 等)を包括 | エンタープライズ |
1.4 利用シナリオ
- 中央集権的なアーティファクト管理: 組織全体で一貫したバイナリ管理ポリシーを適用し、「信頼された唯一の情報源(Single Source of Truth)」を確立する
- プロキシキャッシュ: Maven Central、npmjs.com、PyPI、Docker Hub などの外部レジストリをプロキシし、ビルドの再現性と速度を向上させる
- ソフトウェアサプライチェーンセキュリティ: すべての依存関係を可視化し、脆弱性やライセンスリスクを管理する
- マルチサイトデプロイメント: 複数のデータセンターやクラウドリージョンにわたるアーティファクトの自動同期
- コンプライアンスと監査: 不変のリリースバンドルにより、どのバイナリがいつ誰によってデプロイされたかを完全に追跡可能にする
- AI/ML モデル管理: 機械学習モデルやデータセットをバージョン管理し、再現可能なパイプラインを構築する
2. アーキテクチャの全体像
2.1 コンポーネント構成
JFrog Artifactory は、マイクロサービスベースのアーキテクチャを採用しており、以下の主要コンポーネントで構成される。
┌─────────────────┐
│ Load Balancer │
│ (NGINX/HAProxy) │
└────────┬────────┘
│
┌──────────────┼──────────────┐
│ │ │
┌─────────▼──────┐ ┌────▼────────┐ ┌───▼──────────┐
│ Artifactory │ │ Artifactory │ │ Artifactory │
│ Node 1 │ │ Node 2 │ │ Node 3 │
│ ┌───────────┐ │ │ ┌─────────┐ │ │ ┌──────────┐ │
│ │ Router │ │ │ │ Router │ │ │ │ Router │ │
│ ├───────────┤ │ │ ├─────────┤ │ │ ├──────────┤ │
│ │ Frontend │ │ │ │Frontend │ │ │ │ Frontend │ │
│ ├───────────┤ │ │ ├─────────┤ │ │ ├──────────┤ │
│ │ Metadata │ │ │ │Metadata │ │ │ │ Metadata │ │
│ ├───────────┤ │ │ ├─────────┤ │ │ ├──────────┤ │
│ │ Artifactory│ │ ││Artifact.│ │ │ │Artifact. │ │
│ │ (Core) │ │ │ │(Core) │ │ │ │(Core) │ │
│ ├───────────┤ │ │ ├─────────┤ │ │ ├──────────┤ │
│ │ Access │ │ │ │ Access │ │ │ │ Access │ │
│ └───────────┘ │ │ └─────────┘ │ │ └──────────┘ │
└────────┬───────┘ └──────┬──────┘ └──────┬───────┘
│ │ │
┌────────┴────────────────┴───────────────┴───────┐
│ Shared Services │
│ ┌──────────┐ ┌──────────┐ ┌───────────────┐ │
│ │ Database │ │ Binary │ │ Message Queue │ │
│ │(PostgreSQL│ │ Store │ │ (RabbitMQ) │ │
│ │ /MySQL) │ │(S3/NFS/ │ │ │ │
│ │ │ │ GCS/Azure│ │ │ │
│ └──────────┘ └──────────┘ └───────────────┘ │
└──────────────────────────────────────────────────┘
2.2 内部マイクロサービス
各 Artifactory ノードは以下のマイクロサービスを内包する。
- Router サービス: すべてのインバウンドリクエストのエントリポイント。内部サービスへのリバースプロキシ・ルーティングを担当。デフォルトポート: 8082
- Frontend サービス: Web UI の提供。SPA として実装
- Metadata サービス: メタデータの管理と検索、AQL クエリの処理
- Artifactory コアサービス: リポジトリ管理、アーティファクトの保存・取得、パッケージ形式固有のロジック。デフォルトポート: 8081
- Access サービス: 認証・認可(AuthN/AuthZ)、トークン管理(JWT ベース)、RBAC
2.3 通信フロー
Client → [Load Balancer :443] → [Router :8082]
├──► [Frontend] → Web UI
├──► [Artifactory Core :8081] → [Database] + [Binary Store]
└──► [Access Service] → 認証・認可
2.4 データフロー
| カテゴリ | 保存先 | 内容 |
|---|
| メタデータ | データベース(PostgreSQL/MySQL) | リポジトリ設定、ユーザー・権限情報、プロパティ、ビルド情報、チェックサム |
| バイナリデータ | バイナリストア(ファイルシステム/S3/GCS/Azure Blob) | 実際のアーティファクトファイル(JAR、Docker イメージレイヤーなど) |
Artifactory は チェックサムベースのストレージ を採用。同一のバイナリが複数のリポジトリにデプロイされても、物理的には 1 つのコピーのみが保存される。
2.5 ポート構成
| ポート | プロトコル | 用途 |
|---|
| 8081 | HTTP | Artifactory REST API / WebDAV |
| 8082 | HTTP | Router サービス(メインエントリポイント) |
| 8046 | HTTP | Access サービス(内部) |
| 8049 | gRPC | Router 間通信 |
| 8091 | HTTP | Metadata サービス(内部) |
3. リポジトリ・タイプの詳細
3.1 ローカルリポジトリ(Local Repository)
組織内部で作成されたアーティファクトを保管するためのリポジトリ。
curl -u admin:password -X PUT \
"https://artifactory.example.com/artifactory/api/repositories/libs-release-local" \
-H "Content-Type: application/json" \
-d '{
"key": "libs-release-local", "rclass": "local", "packageType": "maven",
"description": "Internal Maven release artifacts",
"repoLayoutRef": "maven-2-default",
"handleReleases": true, "handleSnapshots": false,
"checksumPolicyType": "client-checksums", "xrayIndex": true
}'
3.2 リモートリポジトリ(Remote Repository)
外部パッケージレジストリ(Maven Central、npmjs、Docker Hub など)をプロキシ・キャッシュする。
curl -u admin:password -X PUT \
"https://artifactory.example.com/artifactory/api/repositories/maven-central-remote" \
-H "Content-Type: application/json" \
-d '{
"key": "maven-central-remote", "rclass": "remote", "packageType": "maven",
"url": "https://repo1.maven.org/maven2/",
"retrievalCachePeriodSecs": 7200,
"missedRetrievalCachePeriodSecs": 7200,
"storeArtifactsLocally": true, "xrayIndex": true
}'
| パラメータ | デフォルト値 | 説明 |
|---|
retrievalCachePeriodSecs | 7200 | メタデータキャッシュ有効期間 |
missedRetrievalCachePeriodSecs | 7200 | 「見つからなかった」結果のキャッシュ期間 |
unusedArtifactCleanupPeriodHours | 0(無効) | 未使用キャッシュの自動削除間隔 |
storeArtifactsLocally | true | ローカルキャッシュの有効化 |
3.3 バーチャルリポジトリ(Virtual Repository)
複数のローカル・リモートリポジトリを単一のエンドポイントとして集約する。
┌──────────────────────────────────────────┐
│ libs-release (Virtual Repository) │
│ ┌─ libs-release-local (Local) [1] │
│ ├─ team-a-release-local (Local) [2] │
│ └─ maven-central-remote (Remote) [3] │
│ Default Deployment: libs-release-local │
└──────────────────────────────────────────┘
3.4 フェデレーテッドリポジトリ(Federated Repository)
複数の Artifactory インスタンス間でリポジトリの完全な双方向同期を実現する(Enterprise+)。
3.5 リリースバンドルリポジトリ
JFrog Distribution と連携した不変のリリースバンドルを管理する特殊リポジトリ。
4. 対応パッケージ形式と設定例
4.1 サポート対象一覧
| カテゴリ | パッケージ形式 |
|---|
| Java/JVM | Maven, Gradle, Ivy, SBT |
| JavaScript/Node.js | npm, Yarn, Bower |
| Python | PyPI, Conda |
| .NET | NuGet, Chocolatey |
| Go | Go Modules |
| Rust | Cargo (Crates) |
| Ruby | RubyGems |
| PHP | Composer (Packagist) |
| C/C++ | Conan |
| Swift/Objective-C | CocoaPods, Swift PM, Carthage |
| コンテナ | Docker, OCI, Podman |
| Kubernetes | Helm Charts |
| OS パッケージ | Debian (APT), RPM (YUM/DNF), Alpine (APK) |
| IaC/構成管理 | Terraform, Ansible, Puppet, Chef |
| 汎用 | Generic (任意のファイル) |
| AI/ML | Hugging Face Models |
4.2 Maven 設定例
<settings>
<servers>
<server>
<id>artifactory-release</id>
<username>${env.ARTIFACTORY_USER}</username>
<password>${env.ARTIFACTORY_PASSWORD}</password>
</server>
</servers>
<profiles>
<profile>
<id>artifactory</id>
<repositories>
<repository>
<id>artifactory-release</id>
<url>https://artifactory.example.com/artifactory/libs-release</url>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
</settings>
4.3 npm 設定例
registry=https://artifactory.example.com/artifactory/api/npm/npm-virtual/
//artifactory.example.com/artifactory/api/npm/npm-virtual/:_authToken=${NPM_TOKEN}
always-auth=true
4.4 PyPI 設定例
[global]
index-url = https://{username}:{password}@artifactory.example.com/artifactory/api/pypi/pypi-virtual/simple
4.5 Go Modules 設定例
export GOPROXY="https://artifactory.example.com/artifactory/api/go/go-virtual"
export GONOSUMDB="github.com/myorg/*"
5. ストレージとデータベース
5.1 チェックサムベースストレージ
すべてのバイナリは SHA-256 チェックサムで管理。同一ファイルは物理的に 1 コピーのみ保存される。
5.2 バイナリストアの種類
| ストアタイプ | 推奨用途 |
|---|
| Filesystem | 小規模・開発環境 |
| S3 (AWS) | AWS 本番環境 |
| Google Cloud Storage | GCP 本番環境 |
| Azure Blob Storage | Azure 本番環境 |
| S3 互換(MinIO等) | オンプレミス |
| NFS | HA レガシー |
S3 バイナリストア設定例(binarystore.xml)
<config version="2">
<chain>
<provider id="cache-fs" type="cache-fs">
<provider id="eventual" type="eventual">
<provider id="retry" type="retry">
<provider id="s3-storage-v3" type="s3-storage-v3"/>
</provider>
</provider>
</provider>
</chain>
<provider id="cache-fs" type="cache-fs">
<maxCacheSize>50000000000</maxCacheSize>
</provider>
<provider id="s3-storage-v3" type="s3-storage-v3">
<bucketName>my-artifactory-binaries</bucketName>
<region>us-east-1</region>
<useInstanceCredentials>true</useInstanceCredentials>
</provider>
</config>
5.3 データベースサポート
| データベース | バージョン | 備考 |
|---|
| PostgreSQL | 13.x - 16.x | 推奨 |
| MySQL | 8.0.x | サポート対象 |
| MariaDB | 10.x | MySQL 互換 |
| MS SQL Server | 2019, 2022 | Windows 環境 |
| Oracle | 19c, 21c | エンタープライズ |
shared:
database:
type: postgresql
driver: org.postgresql.Driver
url: "jdbc:postgresql://db-primary.example.com:5432/artifactory?ssl=true&sslmode=require"
username: artifactory
password: "${DB_PASSWORD}"
maxOpenConnections: 100
5.4 ガベージコレクション
artifactory:
gc:
cronExp: "0 0 2 * * ?"
batchSize: 1000
sleepBetweenBatches: 50
timeoutSecs: 14400
6. セキュリティとアクセス制御
6.1 認証方式
| 認証方式 | 説明 |
|---|
| 内部ユーザーDB | Artifactory 内蔵 |
| LDAP / Active Directory | 外部ディレクトリ |
| SAML SSO | Okta、Azure AD 等 |
| OAuth 2.0 / OIDC | OAuth ベース |
| アクセストークン | JWT ベース(推奨) |
| クライアント証明書 | mTLS |
LDAP 設定例
security:
ldapSettings:
- key: corporate-ldap
enabled: true
ldapUrl: "ldaps://ldap.example.com:636/dc=example,dc=com"
userDnPattern: "uid={0},ou=people"
searchFilter: "(uid={0})"
autoCreateUser: true
6.2 パーミッションターゲット
curl -u admin:password -X PUT \
"https://artifactory.example.com/access/api/v2/permissions/java-developers" \
-H "Content-Type: application/json" \
-d '{
"name": "java-developers",
"resources": {
"repository": {
"include-patterns": ["com/myorg/**"],
"repositories": ["libs-release-local", "libs-snapshot-local"],
"actions": {
"groups": {
"dev-team": ["read", "write", "annotate"],
"release-managers": ["read", "write", "annotate", "delete", "manage"]
}
}
}
}
}'
6.3 アクセストークン
curl -u admin:password -X POST \
"https://artifactory.example.com/access/api/v1/tokens" \
-d "username=ci-user" \
-d "scope=member-of-groups:ci-deployers" \
-d "expires_in=86400" \
-d "refreshable=true"
7. レプリケーションと高可用性(HA)
7.1 HA アーキテクチャ
[Load Balancer] → [Node1(Primary)] + [Node2(Member)] + [Node3(Member)]
↓
[共有 PostgreSQL] + [共有 S3/GCS Binary Store]
NGINX ロードバランサー設定例
upstream artifactory {
server art-node-1:8082 max_fails=3 fail_timeout=30s;
server art-node-2:8082 max_fails=3 fail_timeout=30s;
server art-node-3:8082 max_fails=3 fail_timeout=30s;
ip_hash;
}
server {
listen 443 ssl http2;
client_max_body_size 0;
location / {
proxy_pass http://artifactory;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-JFrog-Override-Base-Url https://artifactory.example.com;
proxy_read_timeout 900;
}
}
7.2 レプリケーション比較
| 機能 | プッシュ | プル | フェデレーテッド |
|---|
| 方向 | ソース → ターゲット | ターゲット ← ソース | 双方向 |
| トリガー | Cron / イベント | Cron のみ | イベント(リアルタイム) |
| エディション | Pro+ | Pro+ | Enterprise+ |
8. JFrog CLI と REST API
8.1 JFrog CLI
brew install jfrog-cli
jf config add my-server --url=https://artifactory.example.com --access-token=${TOKEN} --interactive=false
jf rt upload "build/libs/*.jar" libs-release-local/com/myorg/app/1.0/
jf rt download "libs-release-local/com/myorg/app/1.0/" ./local-dir/
jf rt build-publish my-build 42
jf rt build-promote my-build 42 libs-release-local --status="Released"
8.2 REST API
| エンドポイント | メソッド | 説明 |
|---|
/api/system/ping | GET | ヘルスチェック |
/api/storageinfo | GET | ストレージ使用状況 |
/api/repositories | GET | リポジトリ一覧 |
/api/repositories/{key} | PUT/DELETE | リポジトリ管理 |
/{repo}/{path} | PUT/GET/DELETE | アーティファクト操作 |
/api/search/aql | POST | AQL クエリ |
/api/build/{name}/{number} | GET | ビルド詳細 |
9. CI/CD パイプラインとの統合
9.1 GitHub Actions
- uses: jfrog/setup-jfrog-cli@v4
env:
JF_URL: ${{ secrets.JF_URL }}
JF_ACCESS_TOKEN: ${{ secrets.JF_ACCESS_TOKEN }}
- run: |
jf mvn clean package --build-name="${{ github.repository }}" --build-number="${{ github.run_number }}"
jf rt build-publish "${{ github.repository }}" "${{ github.run_number }}"
jf build-scan --vuln --fail=true
9.2 Jenkins
pipeline {
stages {
stage('Build') { steps { sh 'jf mvn clean package' } }
stage('Publish') { steps { sh 'jf rt build-collect-env && jf rt build-publish' } }
stage('Scan') { steps { sh 'jf rt build-scan --fail=true --vuln' } }
stage('Promote') { when { branch 'main' }
steps { sh 'jf rt build-promote ${JOB_NAME} ${BUILD_NUMBER} libs-release-local --status=Released' }
}
}
}
10. JFrog Xray によるセキュリティスキャン
curl -u admin:password -X POST "https://artifactory.example.com/xray/api/v2/policies" \
-H "Content-Type: application/json" \
-d '{"name":"block-critical","type":"security","rules":[{"name":"critical-block","criteria":{"min_severity":"Critical"},"actions":{"block_download":{"active":true},"fail_build":true},"priority":1}]}'
curl -u admin:password -X POST "https://artifactory.example.com/xray/api/v2/watches" \
-H "Content-Type: application/json" \
-d '{"general_data":{"name":"prod-watch","active":true},"project_resources":{"resources":[{"type":"repository","name":"libs-release-local","bin_mgr_id":"default"}]},"assigned_policies":[{"name":"block-critical","type":"security"}]}'
11. Artifactory Query Language(AQL)
items.find({"repo":"libs-release-local","name":{"$match":"*.jar"},"type":"file"})
.include("repo","path","name","size","created").sort({"$desc":["created"]}).limit(100)
items.find({"repo":"libs-release-local","stat.downloads":{"$eq":0},"created":{"$before":"90d"},"type":"file"})
.include("repo","path","name","size").sort({"$asc":["created"]})
12. プロパティ・メタデータ管理
curl -u admin:password -X PUT \
"https://artifactory.example.com/artifactory/api/storage/libs-release-local/app-1.0.jar?properties=quality.gate=passed;deploy.env=production"
curl -u admin:password \
"https://artifactory.example.com/artifactory/api/storage/libs-release-local/app-1.0.jar?properties"
13. Docker / OCI コンテナレジストリ
docker login artifactory.example.com -u deployer -p ${API_KEY}
docker build -t artifactory.example.com/docker-local/myapp:1.0 .
docker push artifactory.example.com/docker-local/myapp:1.0
docker pull artifactory.example.com/docker-virtual/myapp:1.0
14. Helm チャートリポジトリ
helm repo add my-charts https://artifactory.example.com/artifactory/helm-virtual --username deployer --password ${API_KEY}
helm install my-release my-charts/nginx --version 1.0.0
helm push my-chart-1.0.0.tgz oci://artifactory.example.com/helm-local
15. ビルド情報管理(Build Info)
jf rt build-publish my-app 42
curl -u admin:password -X POST \
"https://artifactory.example.com/artifactory/api/build/promote/my-app/42" \
-d '{"status":"Released","sourceRepo":"libs-staging-local","targetRepo":"libs-release-local","copy":true}'
16. リリースバンドルとディストリビューション
curl -u admin:password -X POST \
"https://artifactory.example.com/lifecycle/api/v2/release_bundle" \
-d '{"release_bundle_name":"my-app-release","release_bundle_version":"1.0.0","source_type":"builds","source":{"builds":[{"build_name":"my-app","build_number":"42"}]}}'
17. フェデレーテッドリポジトリ
| 特性 | フェデレーテッド | プッシュレプリケーション | プルレプリケーション |
|---|
| 同期方向 | 双方向 | 一方向 | 一方向 |
| 同期トリガー | イベント(リアルタイム) | Cron/イベント | Cron |
| 書き込み | すべてのメンバー | ソースのみ | ソースのみ |
| 要件 | Enterprise+ | Pro+ | Pro+ |
18. クリーンアップとメンテナンス
curl -u admin:password -X POST "https://artifactory.example.com/artifactory/api/cleanup/policies" \
-d '{"key":"cleanup-old","cronExp":"0 0 3 * * ?","enabled":true,"searchCriteria":{"repos":["libs-snapshot-local"],"createdBeforeInMonths":3,"keepLastNVersions":5}}'
curl -u admin:password -X POST "https://artifactory.example.com/artifactory/api/system/storage/gc"
19. 監視・ログ・トラブルシューティング
ログファイル
| ログ | パス |
|---|
artifactory-service.log | $JFROG_HOME/var/log/artifactory/ |
access-service.log | $JFROG_HOME/var/log/access/ |
request.log | $JFROG_HOME/var/log/artifactory/ |
Prometheus メトリクス
| メトリクス | 説明 |
|---|
jfrt_runtime_heap_freememory_bytes | ヒープ空きメモリ |
jfrt_db_connections_active_total | アクティブ DB 接続数 |
jfrt_http_500_total | 500 エラー合計 |
jfrt_storage_used_bytes | ストレージ使用量 |
20. system.yaml による設定管理
configVersion: 1
shared:
database:
type: postgresql
url: "jdbc:postgresql://db:5432/artifactory?ssl=true"
username: artifactory
password: "${DB_PASSWORD}"
maxOpenConnections: 100
node: { id: "art-node-1", haEnabled: true, primary: true }
security: { joinKey: "${JOIN_KEY}", masterKey: "${MASTER_KEY}" }
extraJavaOpts: "-Xms4g -Xmx8g -XX:+UseG1GC"
artifactory:
port: 8081
gc: { cronExp: "0 0 2 * * ?", batchSize: 1000 }
環境変数オーバーライド: JF_SHARED_DATABASE_URL, JF_SHARED_SECURITY_JOINKEY 等
21. AI/ML モデルレジストリ
curl -u admin:password -X PUT "https://artifactory.example.com/artifactory/api/repositories/huggingface-remote" \
-d '{"key":"huggingface-remote","rclass":"remote","packageType":"huggingfaceml","url":"https://huggingface.co"}'
curl -u admin:password -T ./model-v2.0.onnx \
"https://artifactory.example.com/artifactory/ml-models-local/model-v2.0.onnx;model.framework=onnx;model.accuracy=0.95"
22. デプロイメントオプション
| 方式 | 適用シナリオ |
|---|
| SaaS(JFrog Cloud) | 運用負荷の最小化 |
| Docker Compose | 小規模〜中規模 |
| Kubernetes Helm | クラウドネイティブ |
| RPM/DEB | 従来型インフラ |
| Hybrid | グローバル分散 |
services:
artifactory:
image: releases-docker.jfrog.io/jfrog/artifactory-pro:7.90.6
ports: ["8081:8081", "8082:8082"]
environment:
JF_SHARED_DATABASE_TYPE: postgresql
JF_SHARED_DATABASE_URL: "jdbc:postgresql://postgresql:5432/artifactory"
JF_SHARED_SECURITY_JOINKEY: ${JOIN_KEY}
23. バックアップとディザスタリカバリ
| コンポーネント | バックアップ方法 |
|---|
| データベース | pg_dump / クラウド DB スナップショット |
| バイナリストア | S3 バージョニング / GCS Object Versioning |
| 設定ファイル | $JFROG_HOME/var/etc/ バックアップ |
artifactory:
backup:
- key: "daily-backup"
enabled: true
cronExp: "0 0 1 * * ?"
retentionPeriodHours: 168
24. パフォーマンスチューニング
| 規模 | CPU | メモリ | ディスク |
|---|
| 小規模 | 4 コア | 8 GB | 100 GB SSD |
| 中規模 | 8 コア | 16 GB | 500 GB SSD |
| 大規模 | 16 コア | 32 GB | 1 TB NVMe |
| 超大規模 | 32+ コア | 64+ GB | 2+ TB NVMe |
shared_buffers = '4GB'
effective_cache_size = '12GB'
work_mem = '256MB'
max_connections = 200
25. ベストプラクティスとアンチパターン
ベストプラクティス
- 命名規則の統一(
<パッケージ>-<用途>-<タイプ>)
- バーチャルリポジトリの活用
- スナップショットとリリースの分離
- 最小権限の原則
- アクセストークンの使用(API キー廃止)
- Xray の全リポジトリ有効化
- クリーンアップポリシーの設定
- Prometheus/Grafana による監視
- HA 構成の採用(本番環境)
- オブジェクトストレージの活用
アンチパターン
| アンチパターン | 推奨 |
|---|
| 外部レジストリへの直接アクセス | リモートリポジトリでプロキシ |
| 単一リポジトリでの全管理 | 用途ごとに分割 |
| パスワードのハードコード | 環境変数/シークレット管理 |
| GC の未設定 | 定期的な GC スケジュール |
| Derby DB の本番利用 | PostgreSQL を使用 |
まとめ
JFrog Artifactory は、ソフトウェア開発ライフサイクル全体にわたるアーティファクト管理の中核を担うプラットフォームである。本ドキュメントでは以下の主要領域を網羅的に解説した。
- アーキテクチャ: マイクロサービスベースの設計、チェックサムベースストレージ、柔軟なバイナリストアオプション
- リポジトリ管理: ローカル、リモート、バーチャル、フェデレーテッドの 4 種類を組み合わせた柔軟なアーティファクト管理
- パッケージサポート: 40 以上のパッケージ形式へのネイティブ対応
- セキュリティ: 多層的な認証・認可、Xray による脆弱性スキャン
- スケーラビリティ: HA 構成、レプリケーション、フェデレーションによる大規模デプロイメント
- 自動化: JFrog CLI、REST API、CI/CD パイプライン統合による完全な自動化
- 運用: 監視、クリーンアップ、バックアップ、パフォーマンスチューニング
Artifactory を適切に設計・運用することで、ソフトウェアサプライチェーンの安全性、信頼性、効率性を大幅に向上させることができる。