Loading
ナレッジ

エラー「Connection refused」と表示されてログインできない

📅更新日: 2025-04-25🏷️P4エラー「connection手順Article ID: 000001822
Swarmへブラウザからログインしようとしたところ、「Connection refused」と表示され、
ログインできませんでした。対応方法を教えてください。
 

Redis-Serverが起動していないことが原因です。

Swarmでは、Redisを使用してキャッシュを管理する必要があります。Redisは、Swarm Tarballに付属しています。
デフォルト設定の場合、Swarmは、Swarmマシン上で専用のRedisサーバを使用します。

以下の手順でRedis-Serverを起動し、ログインできるかご確認ください。

手順

1.Redisキャッシュデータベースを設定

Configファイルに以下の情報を追記し、Redisキャッシュデータベースを設定します。

・ファイル名: redis-server.conf

・配置先:   /opt/perforce/etc

追記内容

bind 127.0.0.1
port 7379
supervised auto
save ""
dir /opt/perforce/swarm/redis

 

2.Redisサーバ起動スクリプトを作成

以下の内容で起動スクリプトを作成します。

・ファイル名: redis-server-swarm.service

・配置先:   /etc/systemd/system

記述例:CentOS/RHEL7の場合。pathはswarmの配置によって変わります

[Unit]
Description=Redis Server for Swarm
After=network.target

[Service]
ExecStart=/opt/perforce/swarm/p4-bin/bin.linux26x86_64/redis-server-swarm /opt/perforce/etc/redis-server.conf
ExecStop=/opt/perforce/swarm/p4-bin/bin.linux26x86_64/redis-cli-swarm shutdown
Restart=always
RestartSec=10
StandardOutput=syslog
StandardError=syslog
SyslogIndentifier=redis
User=perforce
Group=perforce

[Install]
WantedBy=multi-user.target

 

3.Redisサーバプログラムのバーミッション設定

tarball解凍後の状態では、プログラムに実行権が付与されていないため、実行権を付与します。

実行コマンド例:pathはswarmの配置によって変わります

chmod 755 /opt/perforce/swarm/p4-bin/bin.linux26x86_64/redis-server-swarm
chmod 755 /opt/perforce/swarm/p4-bin/bin.linux26x86_64/redis-cli-swarm

 

4.Redis用ディレクトリの作成

手順1で作成したConfigファイルで指定したRedisサーバのディレクトリを作成します。
このディレクトリは、OSの"peforce"ユーザが使用するため、パーミッションを"perforce"とします。

実行コマンド例:ディレクトリ作成

mkdir /opt/perforce/swarm/redis

実行コマンド例:パーミッション変更

chown perforce:perforce /opt/perforce/swarm/redis

 

5.Redisサーバの起動と自動起動登録

手順2で作成したスクリプトを使用してRedisサーバを起動します。

起動コマンド例

systemctl start redis-server-swarm

サーバ起動を確認するため、"ps"コマンドで実行状況を確認します。

確認コマンド例

ps -ef | grep redis

期待する結果

perforce 1359 1 0 13:25 ? 00:00:05 /opt/perforce/swarm/p4-bin/bin.linux26x86_64/redis-server-swarm 127.0.0.1:7379

次回から自動起動させるために、Systemdへ登録します。

Systemd登録コマンド例

systemctl enable redis-server-swarm

 

6.Apache再起動

Redisサーバ起動後にApacheの再起動が必要なため、以下のコマンドを実行します。

Apache再起動コマンド例

systemctl restart httpd24-httpd

読み込み中
エラー「Connection refused」と表示されてログインできない