在Linux上安装GlassFish的位置? [英] Where to install GlassFish on Linux?

查看:185
本文介绍了在Linux上安装GlassFish的位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

免责声明:我对Linux比较陌生。我辩论把这个放在SuperUser或ServerFault上,因为答案 需要将Linux解释为系统(而不是特定的编程问题),但是我从Java开发人员的角度对此感兴趣,并且我认为这是一个特定的问题,因为我安装GlassFish会大大影响我的Java配置,最终影响应用程序配置。更不用说在其他网站上发布这个问题可能不会引起任何Java开发人员的注意,更多的是系统管理员,他们可能不太了解Java,因此无法完全评估此决定。



我试图决定GlassFish的安装位置,在我看来,我有(实际上)4个可行的选择:


  • / opt / glassfish /

  • / usr / local / glassfish / / home / myUsers / glassfish / (这是所有OGS文档在其示例中显示的内容)
  • >
  • / home / ogs / glassfish (作为自己的用户,类似于Apache web服务器有时设置的方式)


我想知道哪些专业人士(考虑到Linux对待这些目录的性质,FHS等)以及每种方法的缺点。

我读过安装/分区的好处,在 opt / 下安装它。不过,我通常会将第三方软件安装到 usr / local / ,所以我有点不确定这是一种策略。



Oracle GlassFish服务器(OGS)文档全部演示(但从未完全推荐)将GlassFish安装在您的主目录下( home / myUser / )。 p>

然后我再次读到安装守护进程类型的服务是非常普遍的(这就是我想象的那样我将使用GlassFish作为 - 我在这里开始一次,它只是作为自己的用户( home / ogs / glassfish / )。)它只能用于例行维护或崩溃)。



我很确定这个决定也受到我将如何使用GlassFish的影响,所以让我用一些限制来限定这个问题:




  • 我打算在同一台物理机上的4个虚拟机上部署4个OGS实例,并将它们集群到同一个域中(4个服务器实例中的1个将是管理服务器的域名)

  • 几个应用程序将同时部署到此群集(所有3个非管理节点),并且应该全天候运行(除非它们发生崩溃)(希望不经常!)或者当我需要维护或调整它们时

  • 每个应用程序都会很大,我想用真正的管理员配置它们,而不是裸露的骨骼de minimis,默认设置



如果这些信息没有提供足够的信息来帮助您做出选择,请询问我可以我猜,当尘埃落定在一天结束的时候,我正在寻找(或多或少)一个矩阵,每个矩阵都有四个目录选项(加上我省略的任何其他明显的选项)与他们各自的专家和技术人员进行比较。使用你的Linux发行版的包管理系统来安装Glassfish也是可行的。例如,在Ubuntu上,您可以使用

 安装它。sudo apt-get install glassfish-appserv 

并让它安装到软件包所有者认为应该安装的地方。

$ b

我自己倾向于摆脱上述选项,因为我喜欢自己控制Glassfish(或任何其他Java服务器/软件)的确切版本的安装位置和位置,但我只是想把它抛出去,因为它是你可以做的事情之一。



现在针对您提供的各种选项:

/ opt / glassfish /
就我而言,这是首选选项。它将软件保存在常规Linux安装以外的单独目录中,并允许您提到的安装和分区优势。


$ b / usr / local / glassfish /
我不喜欢这么多,因为/ usr / local通常由使用发行版软件包管理软件(apt / yum / etc)安装的第三方软件使用,并且在大多数发行版它有像bin,etc和lib这样的目录。把它放在玻璃鱼的目录下,会使它不合适。



另外我更喜欢将系统目录与不使用发行版软件包管理的定制软件分开工具。



/ home / myUsers / glassfish / / home / ogs / glassfish



这2个,我不推荐。

它们仅在大多数地方被描述,因为作者不想假定用户对这些框具有root访问权限,在这种情况下,主目录将是唯一一个你会保证拥有的。如果您拥有该系统并对其进行管理,则不适用这些限制。

请记住,主目录是针对特定用户的。我总是推荐使用具有所需特权的个人用户帐户管理服务器软件。将软件放在别人的主目录中意味着你要么给你的每一个需要管理Glassfish的用户 >

  • 允许多个用户对特定用户的主目录进行读写访问。

  • 无论哪种方式,这不是很好的系统管理策略。



    这里没有太多的Java透视图,但是如果你问我,不需要。


    DISCLAIMER: I'm relatively new to Linux. I debated putting this on SuperUser or ServerFault because the answer does require an explanation of Linux as a system (and not a specific programming problem), however I'm interested in this from a Java developer's perspective, and I argue that this is a specific problem because where I install GlassFish greatly impacts my Java configuration, and ultimately, app configuration. Not to mention posting this question on those other sites probably won't garnish any attention from a Java developer, more over system admins, who may not know enough about Java to weigh-in fully on this decision.

    I'm trying to decide where to install GlassFish and it seems to me I have (realistically) 4 viable options:

    • /opt/glassfish/
    • /usr/local/glassfish/
    • /home/myUsers/glassfish/ (which is what all the OGS docs show in their examples)
    • /home/ogs/glassfish (as its own user, similar to how Apache web server is sometimes setup)

    I'm wondering what the pros (taking into consideration the nature of how Linux treats these directories differently, the FHS, etc.) and cons of each approach are.

    I've read that there are mounting/paritioning benefits to installing it under opt/. However, I normally install 3rd party software to usr/local/, so I'm a little unsure about that as a strategy.

    The Oracle GlassFish Server (OGS) docs all demonstrate (but never outright recommend) GlassFish being installed under your home directory (home/myUser/).

    Then again, I've read that it is fairly common to install daemon-type services (which is what I would imagine I would be using GlassFish as - where I start it once and it only comes down for routine maintenance or crashes) as their own user (home/ogs/glassfish/).

    I'm sure this decision is also impacted by how I'm going to use GlassFish, so let me qualify this question with a few constraints:

    • I intend to deploy 4 OGS instances across 4 VMs on the same physical machine and cluster them into the same domain (1 of the 4 server instances will be the admin server for the domain)
    • Several applications will be deployed to this cluster (all 3 non-admin nodes) at the same time, and should be running 24/7/365 except for when they crash (hopefully not often!) or when I need to maintenance or tune them
    • Each application will be farily large and I would like to configure them with real admin, not "bare bones" de minimis, default settings

    If these don't provide specific-enough information to help make this choice, please ask and I can be more specific.

    I guess, when the dust settles at the end of the day, I'm looking (more or less) for a matrix with each of the four directory options (plus any other obvious ones I've omitted) compared against their respective pros & cons.

    解决方案

    There's also the option of using your Linux distro's package management system to install Glassfish. On Ubuntu for example, you could install it using

    sudo apt-get install glassfish-appserv
    

    and let it get installed to wherever the package owner thought it should be installed.

    I myself tend to steer away from the above option, as I like to exert my own control over which exact version of Glassfish (or any other Java server/software) is installed and where, but I just wanted to throw that out there, as it's one of the things you could do.

    Now for the individual options you've provided:

    /opt/glassfish/ This is the preferred option as far as I'm concerned. It keeps the software on a separate directory outside of the regular Linux installation, and allows the mounting and partitioning benefits you mention.

    /usr/local/glassfish/ I don't like this much, because /usr/local is generally used by third-party software that is installed using the distro's package management software (apt/yum/etc), and on most distros has directories like bin, etc and lib under it. Putting a directory for glassfish under it, would make it out of place.

    Also I prefer to keep system directories separate from custom software that doesn't use the distro's package management tools.

    /home/myUsers/glassfish/ , /home/ogs/glassfish

    These 2, I would not recommend.

    They are only described in most places, because the author doesn't want to assume that the user has root access on those boxes, in which case the home directory would be the only one you'd be guaranteed to own. If you own the system and are managing it, those restrictions don't apply.

    Remember, home directories are for specific users. I always recommend server software being managed with individual users' accounts that have the required privileges. Putting software in someone's home directory would mean that you either

    1. Give everyone who needs to manage Glassfish, the password to that user account
    2. Give multiple users read/write access to the home directory of a specific user.

    Either way, that's not good system administration policy.

    There's not much of a Java perspective here, but if you ask me, there doesn't need to be.

    这篇关于在Linux上安装GlassFish的位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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