liferay_云中的Liferay

liferay

为什么在云中使用Liferay? (Why Liferay in the cloud?)

Today, everybody want things to be done in the cloud. Running your applications in the cloud relieves you from having to manage and scale the hardware. Management of databases, application servers, continuous integration etc is done by the provider and lets you focus on your core business. One thing you don’t find so easily, is how to get a Liferay portal up and running in the cloud. Liferay itself doesn’t offer a cloud service, so we’ll have to construct our own, using the existing providers. It is of course possible to spawn a machine with an IaaS provider and install everything from scratch to get Liferay in cloud – but our goal is here to utilize a PaaS platform to deploy Liferay and make it easier for you.

今天,每个人都希望事情在云中完成。 在云中运行应用程序使您不必管理和扩展硬件。 数据库,应用程序服务器,持续集成等的管理由提供商完成,使您可以专注于核心业务。 您不容易找到的一件事是如何在云中启动并运行Liferay门户。 Liferay本身不提供云服务,因此我们必须使用现有的提供商来构建自己的云服务。 当然,可以使用IaaS提供程序生成机器并从头开始安装所有内容,以将Liferay放入云中–但是我们的目标是利用PaaS平台来部署Liferay,并使您更轻松。

For this tutorial, I have used Cloudbees. There are 2 ways to get started: the ‘regular’ way, and the quick way which is made possible by the recent addition of  ‘ClickStarts’. The latter is obviously the easiest, but it’s good to see where we come from. It helps in understanding the underlying process.

在本教程中,我使用了Cloudbees 。 有2种入门方法:“常规”方法,以及最近添加的“ ClickStarts”使快速方法成为可能。 后者显然是最简单的,但是很高兴看到我们来自哪里。 它有助于理解底层过程。

在开始之前 (Before we get started)

Before we start, we should install the Cloudbees SDK. You can find it here. Dowload the zip-file, and extract it. Once that’s done, set the BEES_HOME environment variable, and point to the folder in which you unzipped the SDK. Add BEES_HOME to your PATH environment variable. You can check your installation by opening a command window and type ‘bees help’. The first time, Cloudbees SDK will attempt to download a configuration file from its servers. If none is found, it will ask your Cloudbees login and password to create one. Once that’s done, the necessary plugins are downloaded, and you’re good to go.

在开始之前,我们应该安装Cloudbees SDK。 你可以在这里找到它。 下载zip文件,然后解压缩。 完成后,设置BEES_HOME环境变量,并指向解压缩SDK的文件夹。 将BEES_HOME添加到您的PATH环境变量中。 您可以通过打开命令窗口并键入“ bees help”来检查安装。 第一次,Cloudbees SDK将尝试从其服务器下载配置文件。 如果没有找到,它将要求您的Cloudbees登录名和密码创建一个。 一旦完成,就下载了必要的插件,您就可以开始了。

Note: if you’re behind a proxy, you can edit the bees.bat/bees.sh file and change the JAVA_OPTS:

注意:如果您位于代理之后,则可以编辑bees.bat / bees.sh文件并更改JAVA_OPTS:

JAVA_OPTS=-Dbees.home=%BEES_HOME% -Dhttp.proxyHost=<your proxy host> -Dhttp.proxyPort=<your proxy port> -Xmx256m

JAVA_OPTS=-Dbees.home=%BEES_HOME% -Dhttp.proxyHost=<your proxy host> -Dhttp.proxyPort=<your proxy port> -Xmx256m

“常规”方式 (The ‘regular’ way)

Follow these easy steps to setup Liferay in the cloud, using the Cloudbees platform. Of course, you’ll need to sign up for an account.

按照以下简单步骤,使用Cloudbees平台在云中设置Liferay。 当然,您需要注册一个帐户。

– Create Database (LiferayTryout)
–创建数据库(LiferayTryout)
– Unzip it
–解压缩
tomcat-7.0.27/lib/ext folder into the unbundled WAR’s  tomcat-7.0.27 / lib / ext文件夹中的所有文件复制到解除捆绑的WAR的 WEB-INF/lib folder (14 items, although ccpp.jar is double and can be skipped). In windows, you can use 7Zip to browse the war-file, and drag and drop the jar files into the right folder WEB-INF / lib文件夹中 (14个项目,尽管ccpp.jar为两倍,可以跳过)。 在Windows中,您可以使用7Zip浏览war文件,并将jar文件拖放到正确的文件夹中
portal-ext.properties file in the unbundled WAR’s  WEB-INF / classes文件夹中创建一个 WEB-INF/classes folder (again, you can create it outside the war, and drag and drop it in afterwards) portal-ext.properties文件(同样,您可以在战争之外创建它,然后将其拖放到其中)
portal-ext.properties, to have following properties: portal-ext.properties ,使其具有以下属性:

portal-ext.propertiesliferay.home=/tmp/liferay-home-eb jdbc.default.driverClassName= com.mysql.jdbc.Driver jdbc.default.url=jdbc:mysql://yourDatabaseServer:3306/liferay-username?useUnicode=true&characterEncoding=UTF-8& useFastDateParsing=false jdbc.default.username=liferay-username jdbc.default.password=liferay-password

portal-ext.propertiesliferay.home = / tmp / liferay-home-eb jdbc.default.driverClassName = com.mysql.jdbc.Driver jdbc.default.url = jdbc:mysql:// yourDatabaseServer:3306 / liferay-username?useUnicode = true&characterEncoding = UTF-8&useFastDateParsing = false jdbc.default.username = liferay-用户名jdbc.default.password = liferay-password

– You can find your database server in the “Manage” tab of your Cloudbees database – Create App (JVM Web Application WAR) – Liferay requires quite a lot of memory. The free edition of Cloudbees comes with 128MB, which is probably not enough. You’ll have to switch to the paid (medium or large) edition – Upload the new WAR file using the Cloudbees SDK. This will take a while, since it’s pretty big. Subsequent deploys will be faster, as the SDK uses a delta system to only deploy the changes. To deploy, use this command:

–您可以在Cloudbees数据库的“管理”选项卡中找到数据库服务器–创建应用程序(JVM Web应用程序WAR)– Liferay需要大量内存。 免费版本的Cloudbees随附128MB,可能还不够。 您必须切换到付费(中型或大型)版本–使用Cloudbees SDK上传新的WAR文件。 这需要一段时间,因为它很大。 由于SDK使用增量系统仅部署更改,因此后续的部署将更快。 要部署,请使用以下命令:

       bees app:deploy liferay-portal-6.1.1-ce-ga2.war jvmPermSize=256

bees app:deploy liferay-portal-6.1.1-ce-ga2.war jvmPermSize=256

– Notice we have set the jvmPermSize parameter. – The SDK will now ask you which application you want to deploy. Enter the name, and watch it progress. – Your liferay instance is now up and running in the cloud!

–注意,我们已经设置了jvmPermSize参数。 –现在,SDK将询问您要部署哪个应用程序。 输入名称,然后观察进度。 –您的liferay实例现在已在云中启动并运行!

使用Liferay ClickStart的快速方法 (The quick way, using Liferay ClickStart)

Clickstarts are project templates, a bit like Maven archetypes, if you’ve worked with them. There is a Liferay Clickstart template, which ben be found here: https://github.com/CloudBees-community/liferay-clickstart

Clickstarts是项目模板,如果您使用过的话,则有点像Maven原型。 有一个Liferay Clickstart模板,可在这里找到: https : //github.com/CloudBees-community/liferay-clickstart

To use this Clickstart, and have our own Liferay in the cloud, follow these steps:

要使用此Clickstart,并在云中拥有我们自己的Liferay,请按照以下步骤操作:

– Click the button “Deploy instantly on Cloudbees”
–单击按钮“立即在Cloudbees上部署”
– Choose name
- 选择名字
– Source repository (GIT) is initialized, Jenkins is configured to automatically build the code, a web application is created, DB created and configured
–初始化源存储库(GIT),将Jenkins配置为自动生成代码,创建Web应用程序,创建并配置数据库
– Be patient, this can take a while…
–请耐心等待,可能需要一段时间...
– Again, you will have to increase your application memory to 512MB or 1024MB
–同样,您必须将应用程序内存增加到512MB或1024MB
– Now, use the Cloudbees SDK to locally create the app
–现在,使用Cloudbees SDK在本地创建应用

       bees create <your-applicationname>

bees create <your-applicationname>

– Go into the created folder
–进入创建的文件夹
– Change the source code if you want, or immediately upload the application again
–如果需要,请更改源代码,或立即再次上传应用程序

       bees deploy -a <your-username>/<your-applicationname>

bees deploy -a <your-username>/<your-applicationname>

– Your application is now up and running!

–您的应用程序现在已启动并正在运行!

结论 (Conclusion)

As you can see, the ClickStart way is a lot quicker. On top of that, you also have the immediate creation of a source repository (GIT, in this case) and a Jenkins configuration. While the first method requires a lot of effort and some insight, the second one is quick and easy. We demonstrated use of ClickStarts and in process also deployed Liferay to cloud.
如您所见,ClickStart方法要快得多。 最重要的是,您还可以立即创建源存储库(在本例中为GIT)和Jenkins配置。 第一种方法需要大量的精力和洞察力,而第二种方法又快速又容易。 我们演示了ClickStarts的用法,并且在过程中还将Liferay部署到了云中。

翻译自: https://www.sitepoint.com/liferay-in-the-cloud/

liferay

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值