简体   繁体   English

服务器上如何托管Java EE应用程序

[英]how a java ee application is hosted on servers

I'm a Java EE developer (never worked in an enterprise). 我是Java EE开发人员(从未在企业工作过)。 let's say we have a java ee 7 application (using EJB JPA JSF..) and connected to MySQL Database for example. 假设我们有一个Java ee 7应用程序(使用EJB JPA JSF ..)并连接到例如MySQL数据库。 now in the development mode you just work on your computer. 现在,在开发模式下,您只需在计算机上工作即可。 my question is, let's say you have bought 5 servers (Windows). 我的问题是,假设您购买了5台服务器(Windows)。 and you want to deploy the application (along with the database) on these servers. 并且您想要在这些服务器上部署应用程序(以及数据库)。 how you do that, how on server number 1 having Java, glassfish (war/ear file deployed) connect with others. 您如何执行此操作,在具有Java的1号服务器上,glassfish(部署了war / ear文件)如何与其他服务器连接。

I mean if server n1 wants to get some entry from the database and that entry exists in sever n3, how is that possible???? 我的意思是,如果服务器n1要从数据库中获取某些条目并且该条目存在于服务器n3中,那怎么可能?

today with the "Cloud" you don't actually know how stuff works. 如今,有了“云”,您实际上并不了解东西的工作原理。 I need to know how the "Classic" way things works. 我需要知道事情的“经典”方式。

You install the app server on a specific machine, and the DBMS on a specific machine. 您将应用程序服务器安装在特定计算机上,并将DBMS安装在特定计算机上。 They may be the same machine or different machines; 它们可能是同一台机器,也可能是不同的机器; in both cases the network layer handles the details. 在这两种情况下,网络层都会处理细节。 You configure the data server to listen on a specific address and port (the default port depends on the database). 您将数据服务器配置为侦听特定的地址和端口(默认端口取决于数据库)。 Your JDBC connection string specifies the server's address and, optionally, port number. JDBC连接字符串指定服务器的地址,以及端口号(可选)。 In your example the JDBC driver on n1 would simply make a network connection to the DBMS on n3. 在您的示例中,n1上的JDBC驱动程序将简单地与n3上的DBMS建立网络连接。

This is covered in the JDBC Tutorial . JDBC教程中对此进行了介绍 The greasy details are handled by the two nodes' TCP stacks; 油腻的细节由两个节点的TCP堆栈处理。 an explanation would be beyond the scope of this site. 一个解释将超出本网站的范围。

JEE adresses most of the topics you asked about. JEE解决了您所询问的大多数主题。 You shouldn't call yourself a Java EE developer and at the same time ask "what is Java EE". 您不应该称自己为Java EE开发人员,同时问“什么是Java EE”。

Also a developer always MUST "know how stuff works" to actually make it work, no matter where it's run, that was true yesterday, today and will probably be tomorrow. 同样,开发人员必须始终“知道事物的工作原理”才能使其真正起作用,无论它在哪里运行,昨天,今天,将来可能都是这样。

I think you are either a troll or did not even try to understand / read up at all JEE (or basically any other web / network based distributed) technology. 我认为您要么是一个巨魔,要么甚至没有尝试理解/阅读所有JEE(或基本上任何其他基于Web /网络的分布式)技术。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM