ChatLuckの更新

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

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

1.各プロセスの停止

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

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

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

1-2. 以下のコマンドを実行し、Redisサーバーを停止します。

[root@xxxxxx ~]# service redis stop
Stopping ...
Redis stopped
[root@xxxxxx ~]#

"Redis stopped"のように表示されれば停止されています。

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

[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/chatluck-update-V30R11pg96lRE6.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.古いファイルの削除

引き続き、"root"ユーザーで作業を行います。

3-1. ChatLuck本体のインストール先から、不要なファイルを削除します。

[root@xxxxxx tmp]# pushd /var/www/cgi-bin/chatlk/rserver
[root@xxxxxx rserver]# rm -rf node_modules
[root@xxxxxx rserver]# popd
/tmp
[root@xxxxxx tmp]#

 

4.SQLの適用

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

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

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

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

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

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

 

5.パッケージの上書き

5-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]#

5-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]#

 

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

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

 

6.設定ファイルの編集

6-1.設定ファイルを開きます。

[root@xxxxxx tmp]# vi /var/www/cgi-bin/chatlk/rserver/config/default.json

6-2.3行目のポート番号を、「5432」から「5433」に変更します。また、「logdbport」の設定を追加します。以下のように、赤い個所を修正または追記してください。

{
	"DB" : {
		"dbport"		:	5433,
		"dbs"			:	"localhost",
		"dbname"		:	"chatlkdb",
		"dbuser"		:	"chatlk",
		"dbpwd"			:	"chatlk",
		"logdbport"		:	5433
	},
	"node"	:	{
		"port" : "3000",
		"log" : {
			"appenders": [
			    {
			    	"category" : "info",
			    	"filename" : "log/rserver.log"
			    },
			    {
			    	"category" : "error",
			    	"filename" : "log/error.log"
			    }
			]
		}
	}
}

編集が完了したら、viコマンドの":wq"(保存して閉じる)を実行してください。

 

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

7-1.Node.jsの更新を行います。

Node.jsの更新方法は、以下をご覧ください。
https://www.chatluck.com/download/doc/install/ja_JP/Linux/linuxpg_node.html

※ChatLuck V3.0にてご利用できるNode.jsのバージョンは「v8.11.0」となります。以下のパッケージをダウンロードしてご利用ください。
https://www.chatluck.com/download/binary/linuxpg93/node-v8.11.0-linux-x64.tar.gz

 

7-2. 以下のコマンドを実行し、Redisサーバーを起動します。

[root@xxxxxx tmp]# service redis start
Starting Redis server...
[root@xxxxxx tmp]#

"Starting Redis server..."のように表示されれば起動しています。

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

[root@xxxxxx tmp]# service chatluck start
Starting chatluck-rserver:
[root@xxxxxx tmp]#

"Starting chatluck-rserver:"のように表示されれば、リアルタイムサーバーの起動は完了です。

 

以上でChatLuck (Linux+PostgreSQL版) のアップデートは完了です。
システム管理者権限のユーザーでChatLuckにログインし、「システム管理者設定」画面の「運用管理 > ログ管理 > ログ削除」画面を表示できることを確認してください。

 

続いて『PostgreSQL 9.3の停止』を行います。

 

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