2021年2月16日火曜日

CentOS8-StreamにRedis Commanderをインストールする

Redis CommanderでブラウザからRedis Serverのコマンドを実行する事ができます。

〇Reddis Commanderの画面
ブラウザからhttp://<ホスト名またはIPアドレス>:8081/ にアクセスします。

インストール方法

以下の手順を実行します。

1. Redisのインストール
sudo dnf -y install redis

sudo systemctl enable redis

sudo systemctl start redis

動作確認は以下のコマンドを実行します。
redis-cli << EOF
ping
flushall
set mykey "hello world."
get mykey
EOF

2. node.jsとredis-commanderのインストール
以下のコマンドを実行して、nodeとredis-commanderをインストールします。
curl -sL https://rpm.nodesource.com/setup_12.x | sudo bash -

sudo dnf -y install nodejs

sudo npm install --no-optional -g redis-commander

cat << EOF | sudo tee /etc/systemd/system/rediscommander.service
[Unit]
Description=redis-commander

[Service]
Type=simple
ExecStart=/usr/bin/redis-commander

[Install]
WantedBy=multi-user.target
EOF

sudo systemctl enable rediscommander.service

sudo systemctl start rediscommander.service

3. ポート開放
firewallの8081番ポートを開けます
sudo firewall-cmd --add-port=8081/tcp --permanent

sudo firewall-cmd --reload

関連情報

・Redis Commanderに関する他の記事は、こちらを参照してください。

0 件のコメント:

コメントを投稿