在Azure上将jar作为Web应用程序运行 [英] Run jar as a webapp on Azure

查看:129
本文介绍了在Azure上将jar作为Web应用程序运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我能够在我的计算机(W10)上运行metabase.jar,现在我需要尝试使用Azure,因为它是我拥有SQL Server的地方.

I was able to run metabase.jar on my machine (W10), and now I need to try on Azure, because it's where I have SQL Server.

Metabase.jar: metabase.com/start/

Metabase.jar: metabase.com/start/

我一个人做不到(封闭和跳船对我来说是新的).

I couldn't do it by myself (closure and jetty are new to me).

在Azure上,我尝试过:

On Azure, I tried:

  • 创建一个Web应用程序;
  • 设置为Java 8和Jetty 9.1;
  • 无法运行metabase.jar.

推荐答案

基于我的理解,我认为您希望将metabase.jar文件作为web应用程序部署到本地的Azure WebApp上.然后我遵循了

Based on my understanding, I think you want to deploy the metabase.jar file as a web application on Azure WebApps like on local. Then I followed the article to upload the metabase.jar file into the directory wwwroot/bin which I created it via Kudu console and create & configure a wwwroot/web.config below to start up the app.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <handlers>
            <add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
        </handlers>
        <httpPlatform processPath="%ProgramW6432%\Java\jdk1.8.0_60\bin\java.exe" arguments="-Djava.net.preferIPv4Stack=true -Dport.http=3000 -jar &quot;%HOME%\site\wwwroot\bin\metabase.jar&quot;" stdoutLogEnabled="true" startupRetryCount='10'>
        </httpPlatform>
    </system.webServer>
</configuration>

部署的结果是我无法完全启动它而不会出现任何错误.似乎由于某些原因,该应用程序经常被Azure WebApp重新启动,例如某些资源超出了报价,导致内存不足或无法连接到Metabase DB.当我将测试Web应用程序的规模从小到大扩展时,问题仍然存在.请参见下图.

The result of deployment is that I can't startup it completely without any error. It seems that the app constantly restart by Azure WebApp because of some reasons, such as some resource exceeded quotes not enough memory or unable to connect to Metabase DB. While I scaled up the tier for my testing webapp from small to large, the issue still occured. Please see the figures below.

因此,我认为似乎只能通过使用Docker或虚拟机在Azure上部署元数据库.希望对您有所帮助.

So I think that it seems to deploy metabase on Azure only via using Docker or Virtual Machine. Hope it helps.

这篇关于在Azure上将jar作为Web应用程序运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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