0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Liferay6.2 + memcached session manager + Elasticache(memcached)

Last updated at Posted at 2019-11-07

はじめに

LiferayでElasticacheをセッション管理サーバとして使用した際にとんでもなくはまってしまったので、設定方法をまとめておきます。
なおElasticacheはredisではなくmemcachedにしています。

使用環境

Liferay

  • liferay-portal-6.2-ce-ga2

セッションマネージャ

ElastiCache Cluster Client

設定周り

Elasticache

  • マネジメントコンソールに沿って構築するだけ

Liferay

  • SetupAndConfigurationを読んで所定のjarをtomcat/libへ配置
  • 今回は以下のファイルになりました
    1. memcached-session-manager-2.3.2.jar
    2. memcached-session-manager-tc7-2.3.2.jar
    3. AmazonElastiCacheClusterClient-1.1.1.jar
  • Elasticacheへの接続設定をtomcat/conf/Catalina/localhost/ROOT.xmlに記載する
  • 例えばこんな感じに
<Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
     storageKeyPrefix="static:devperf"
     memcachedNodes="<設定エンドポイント>"
     memcachedProtocol="binary"
     sticky="false"
     sessionBackupAsync="false"
     sessionBackupTimeout="300"
     requestUriIgnorePattern=".*\.(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|htm|html|js|css|mp3|swf|ico|flv)$"
  />

kryo

  • まだ試してないですが、使用する場合はおそらくtomcat/webapps/ROOT/libにjarを置くのではないでしょうか

まとめ

  • ROOTをいじるという発想になるのに時間がかかった
  • Liferayのドキュメントすくなすぎ案件
  • githubのissueをLiferayという単語で検索すれば秒で解決した内容だった。もっとissueを検索しよう。
  • tomcat/conf/context.xmlに設定を書いていた時はrequestUriIgnorePatternのおかげでひどい目にあった
    • 合致するたびに新しいセッションが登録される
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?