Liferay具有多个服务器实例 [英] Liferay With Multiple Server Instances

查看:82
本文介绍了Liferay具有多个服务器实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在同时处理多个Liferay项目(不同的Portal,插件,用户和用户组等),并且经常不得不在它们之间进行切换.此开关需要很多步骤,例如

I'm working with multiple Liferay Projects (different Portal, plugins, user and usergroups etc ) in the same time, and often have to switch between them. This switch requires lots of steps like

  • 编辑portal-ext.properties(以更改Liferay数据库,并编辑一些特定于项目的自定义属性),并编辑"portal-setup-wizard.properties"
  • 从Eclipse Server实例添加/删除portlet主题和挂钩,有时清除Tomcat的数据""Webapps"和工作"文件夹
  • 转到Liferay的控制面板/服务器/插件安装,并重新索引portlet(例如用户和组织"或文档和媒体")

因此,我认为为每个项目创建一个新的Server Instance(带有新的tomcat和JRE)将是一个不错的主意.当我不得不切换项目时,我可以停止旧服务器并启动另一个.起初,我认为(实际上已建议)使用相同的Liferay插件SDK (6.1.0),只要 Server实例具有相同的版本.

So, I thought that creating a new Server Instance for each project, with a new tomcat and JRE, would be a nice idea. When I had to switch project, I could just stop the old server and start another. At first, I thought (was adviced actually) that using the same Liferay Plugins SDK (6.1.0), should be ok, as long as the Server instances are the same version.

实际上,这并非100%完美.虽然大部分工作都已完成,但这里和那里仍然存在一些问题,例如主题无法正确部署,钩子没有被应用等.据我所知,存在[Liferay SDK]-[Liferay Server]绑定,这意味着只有1台服务器(我创建的第一个服务器)可以正常工作. 例如,通过研究[Liferay SDK文件夹]/bild.[用户名] .properties,我可以看到一些属性是指特定的Server/JRE位置:

Practically this doesn't work 100% perfectly. While most of the work is getting done, there are some problems here and there, like a theme not getting deployed propertly, hooks not beeing applied etc. As I understand, there is some [Liferay SDK] - [Liferay Server] binding, and that means that only 1 Server (the first one I created) will fully work. For example, By investigating the [Liferay SDK folder]/bild.[user name].properties, I can see some properties that are referring to a specific Server/JRE location :

    app.server.portal.dir
app.server.lib.global.dir
app.server.deploy.dir
app.server.type
app.server.dir

所以,我的问题是,我应该如何处理多个Liferay项目?

So, my question is, what should I do to work with multiple Liferay Projects ?

  1. 多服务器实践是与多个项目一起工作的好方法吗?
  2. 如果是,是否应该为每个服务器创建一个不同的SDK?也许也可以使用其他Eclipse工作区吗?还是有某种方法可以使用相同的SDK
  3. 如何使用不同Liferay版本的服务器?

推荐答案

我个人设置了每个项目都有自己的源代码,tomcat,数据库等,即使这意味着重复.这些天的存储很便宜,这使它成为可能.当然,您的里程可能非常高,但是我想我会和您分享我的设置.

Personally, I set up every project with its own source, tomcat, database, etc. even if it means duplication. These days storage is cheap and makes this possible. Of course your milage may very but I thought I'd share my setup with you.

我有一个包含所有项目的项目目录,如下所示:

I have a project directory with all my projects which looks like so:

/projects
    /foo-project
    /bar-project
    /my-project

在我拥有的项目中

/my-project
    /tomcat
        /bin
        /conf
        ...
    /src
        /portal
            ... my portal source ...
        /plugins
            ... my plugin source ...
    /portal-ext.properties

  • 然后我将tomcat设置为使用不同的端口(8080、8081、8082等),以便在需要或不需要时只运行它们.
  • 我将Liferay设置为对每个Liferay实例使用不同的数据库.
  • 我将portal-ext.properties放置为tomcat目录的同级文件,Liferay将读取此文件(假定为默认行为).这样可以快速简便地进行编辑,并弄清楚如何设置每个项目.
    • I then setup tomcat to use different ports (8080, 8081, 8082, etc...) so that I can just leave them all running if I have to or want to.
    • I setup Liferay to use different database for each Liferay instance.
    • I place the portal-ext.properties as a sibling to the tomcat directory and Liferay will read this file (assuming the default behavior). This offers quick and easy edits as well as figuring out how you've set each project up.
    • 优点应该很明显.您可以离开"一个项目并进入另一个项目,而无需拆除和设置.当您返回时,一切仍将如您所愿.如果您要回答尚未处理的项目的问题,上下文切换也将更快,更有用.

      The advantages should be clear. You can just "walk away" from a project and into another without tearing down and setting up. And when you return everything will still be as you left it. Context switching is also quicker and helpful if you want to answer a question about a project you're not yet working on.

      取决于每个项目的复杂性,多实例可能不适用于您.挂钩和EXT可能会相互冲突,并且看起来好像已经存在于您的项目中.

      Depending on the complexity of each of your projects, multi-instance might not work for you. Hooks and EXTs may conflict with each other and it appears as if this is already the case with your projects.

      如果您负担得起空间(不多),这是我作为Liferay开发人员发现的最快方法.

      If you can afford the space (which is not much) this has been the fastest way I have found as a Liferay developer.

      这篇关于Liferay具有多个服务器实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆