ChatLuckの更新

ChatLuck (Linux+PostgreSQL) のChatLuck V6.0R1.1への更新についての説明です。

ここではChatLuck V6.0R1.1への更新について説明します。

ご注意

・ここではPostgreSQL 13の稼働ポートが"5432"であることを前提に説明します。ご利用になる環境によって稼働ポートを適宜変更してください。

1. 各プロセスの停止

1-1. 以下のコマンドを実行し、リアルタイムサーバーを停止します。

[root@xxxxxx ~]# systemctl stop chatluckws
chatluck-rserver を停止中:          [ OK ]
[root@xxxxxx ~]#

"chatluck-rserver を停止中: [ OK ]"のように表示されれば停止されています。

1-2. 以下のコマンドを実行し、スケジューラーを停止します。

[root@xxxxxx ~]# pkill -9 -f chatBatScheduler
[root@xxxxxx ~]#

 

2. パッケージの展開

ここでは、ダウンロードしたファイルをFTPにて、"guest"ユーザーのホームディレクトリに転送済みとし、/tmpディレクトリを作業用ディレクトリとして使用する前提で説明します。
引き続き、"root"ユーザーで作業を行います。

2-1. /tmpディレクトリに、前回インストール時のファイルが残っている場合は削除します。

[root@xxxxxx ~]# cd /tmp
[root@xxxxxx tmp]# rm -rf cgi-bin htdocs
[root@xxxxxx tmp]#

2-2. 次に、/tmpディレクトリにパッケージを展開します。

[root@xxxxxx tmp]# tar zxvf /home/guest/chatluckupdate_6.0.1.1_pg13_linux_x64.tar.gz
(中略)
[root@xxxxxx tmp]#

展開が完了すると、/tmpディレクトリ下に「cgi-bin」、「htdocs」ディレクトリが作成されます。

2-3. 展開された「cgi-bin」、「htdocs」ディレクトリのオーナーをApacheのサービス実行ユーザーに変更します。

[root@xxxxxx tmp]# chown -R apache:apache cgi-bin htdocs
[root@xxxxxx tmp]#

2-4. データベース更新スクリプトのディレクトリのオーナーをpostgresユーザーに変更します。

[root@xxxxxx tmp]# chown -R postgres:postgres cgi-bin/chatlk/sqlupd
[root@xxxxxx tmp]#

 

3. SQLの適用

3-1. postgresユーザーにスイッチ後、以下の手順にてSQLの適用を実施してください。

[root@xxxxxx tmp]# su - postgres
[postgres@xxxxxx ~]$ cd /tmp/cgi-bin/chatlk/sqlupd/chatlkdb
[postgres@xxxxxx chatlkdb]$ ./install.sh chatlk localhost chatlkdb 5432
==========================start alter table
(中略)
==========================end alter table
[postgres@xxxxxx chatlkdb]$

コマンドパラメータは以下の通りとなります。
./install.sh chatlk localhost chatlkdb 5432
       ①   ②    ③    ④

chatlk ・・・ PostgreSQL上のChatLuck用のロール名
localhost ・・・ PostgreSQL DBサーバーが動作しているサーバーのホスト名
chatlkdb ・・・ ChatLuckのDB名
5432 ・・・ PostgreSQL DBサーバーが動作しているサーバーのポート番号

コマンド実行時に下記のようなエラーが画面上に出力されますが、SQLの適用に問題はございません。

ERROR: index "xxxxxxxxxxxx" does not exist

3-2. コマンドが終了したら、exitコマンドにて、rootユーザーに戻してください。

[postgres@xxxxxx chatlkdb]$ exit
[root@xxxxxx tmp]#

 

4.パッケージの上書き

4-1. 展開されたディレクトリ内に静的コンテンツを、WebサーバーのドキュメントルートにあるChatLuckのイメージディレクトリに上書きコピーします。

[root@xxxxxx tmp]# /bin/cp -rp htdocs/chatres /var/www/html/.
[root@xxxxxx tmp]# /bin/cp -rp htdocs/chatsares /var/www/html/.
[root@xxxxxx tmp]#

4-2. 展開された「chatlk」「chatlksa」ディレクトリ内のファイルとディレクトリを、ChatLuck本体のインストール先に上書きコピーします。

[root@xxxxxx tmp]# /bin/cp -rp cgi-bin/chatlk /var/www/cgi-bin/.
[root@xxxxxx tmp]# /bin/cp -rp cgi-bin/chatlksa /var/www/cgi-bin/.
[root@xxxxxx tmp]#

4-3. 不要ファイルの削除を行います。

[root@xxxxxx tmp]# rm -rf cgi-bin htdocs
[root@xxxxxx tmp]#

 

5. リアルタイムサーバーの起動

5-1. 以下のコマンドを実行し、リアルタイムサーバーを起動します。

[root@xxxxxx tmp]# systemctl start chatluckws
[root@xxxxxx tmp]# cat /var/www/cgi-bin/chatlk/rserver/log/rserver.log
[2021-12-01T09:00:00.000+09:00] Start the server with the address "[::]:3000"

"rserver.log"に"Start the server with the address "[::]:3000""のように表示されていれば、リアルタイムサーバーの起動は完了です。

 

6. ルーム使用容量の集計

マイルーム、ルーム、コンタクトの使用容量を集計します。

本手順は上記アップデート手順1~5が終わった後に一度だけ実施してください。
また、お使いの環境により時間がかかることがありますので、お客様のご都合の良いタイミングで行ってください。

6-1. 以下のコマンドを実行し、集計を行います。

例)
ChatLuck本体のインストール先が「/var/www/cgi-bin/chatlk」であるとき

[root@xxxxxx ~]# /var/www/cgi-bin/chatlk/chatBatRecountChatUsage -h /var/www/cgi-bin/chatlk
[root@xxxxxx ~]#

 

以上でChatLuck (Linux+PostgreSQL版) のアップデートは完了です。

7.ChatGPT連携機能を利用する際の設定

ChatGPT連携機能をご利用いただく上での設定について以下のリンクよりご確認ください。

ChatGPT連携のリアルタイムサーバー設定手順

 

記載の製品名および商品名は、各社の商標、または登録商標です。