エラー「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
[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解凍後の状態では、プログラムに実行権が付与されていないため、実行権を付与します。
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へ登録します。
systemctl enable redis-server-swarm
6.Apache再起動
Redisサーバ起動後にApacheの再起動が必要なため、以下のコマンドを実行します。
systemctl restart httpd24-httpd