在GlassFish V2上使用Cluster并配置load balancer
来源:互联网 发布:会计专用软件v6 编辑:程序博客网 时间:2024/05/16 11:44
一、安装Glassfish V2
不用多讲,可以参考下面的文章。
http://server.it168.com/server/2007-12-05/200712051503146.shtml
NOTE:
1、 一般要加这个参数:
java -Xmx256m -jar filename.jar
2、 因为讲的是要使用Cluster的功能,所以安装的时候要用这个:
ant -f setup-cluster.xml
而不是
ant -f setup.xml
二、配置Cluster
1、启动Glassfish
asadmin start-domain domain1
最后一句看见这个就是成功了
Domain supports application server clusters and other standalone instances.
NOTE:不管是在什么时候,都强烈建议使用命令行来进行操作。
因为根据经验,“http://localhost:4848/”上所进行的设置很多情况下都是有问题
的,而且像Node Agent这些东西必须要在命令行里面才能建立和启动。
2、建立第一个Node Agent,叫做node1
asadmin create-node-agent node1
成功的话会显示:
Command create-node-agent executed successfully.
3、建立第二个Node Agent,叫做node2
asadmin create-node-agent node2
4、建立咱们的Cluster,叫做test-cluster
asadmin create-cluster test-cluster
成功的话会显示:
Command create-cluster executed successfully.
5、在Cluster上加入咱们的node1和node2,并且配置上各自管理的instance
asadmin create-instance --nodeagent node1 --cluster test-cluster instance1
成功显示:
Command create-instance executed successfully.
asadmin create-instance --nodeagent node2 --cluster test-cluster instance2
成功显示:
Using 38,081 for HTTP_LISTENER_PORT.
Using 38,182 for HTTP_SSL_LISTENER_PORT.
Using 33,821 for IIOP_SSL_LISTENER_PORT.
Using 37,677 for JMS_PROVIDER_PORT.
Using 33,701 for IIOP_LISTENER_PORT.
Using 38,687 for JMX_SYSTEM_CONNECTOR_PORT.
Using 33,921 for IIOP_SSL_MUTUALAUTH_PORT.
Command create-instance executed successfully.
6、启动Node Agent
asadmin start-node-agent --syncinstances=true node1
asadmin start-node-agent --syncinstances=true node2
会提示输入master password:
Please enter the master password [Enter to accept the default]:>
直接回车就好。
成功显示:
Command start-node-agent executed successfully.
NOTE:
syncinstances这个参数是干嘛的呢?
http://docs.sun.com/app/docs/doc/820-4046/start-node-agent-1?l=ja&a=view&q=start-node-agent
文档上这么解释的:
If set to true, forcibly synchronizes the cache repositories of all server instances with
the central repository of the DAS. The synchronization occurs when the node agent is
started. For more information, see Synchronizing Node Agents and the Domain Administration Server in Sun Java System Application Server 9.1 High Availability Administration Guide. Default is false.
什么的意思呢?大概就是要强制地使各个服务器实例缓存的存储库与DAS的中央存储库同步。能更安全吧。要想了解更详细自己瞅E文吧。
弄完了上面这几步,集群就算是搭起来了。上http://localhost:4848/看看,不错,都有。
三、配置和验证load balancer
好了,配置完成了,下面就该弄一个load balancer和验证它咯。
有个很详细的介绍在这里:
http://blogs.sun.com/Prashanth/entry/setting_up_load_balancing_in
但是是E文地。下面我介绍一下吧。
1、 下载一个Sun Java System Web Server,这里我们下载的是7.0版
下载后安装就可以咯。
地址是:
https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_SMI-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=SJWS-7.0U2-OTH-G-F@CDS-CDS_SMI
这里,人家老外说了,强烈推荐再下载一个Sun App Server来为Web Server安装load balancer的plugin(插件)。
http://www.sun.com/download/index.jsp?cat=Application%20%26%20Integration%20Services&tab=3&subcat=Application%20Servers
NOTE:
要下载带HADB版本的。
为什么呢?
因为老外还说,你要是够勇敢,也可以在下面的链接里学到怎么样手工配置你的load balancer插件。
http://blogs.sun.com/pjjairath/entry/installing_and_configuring_glassfish_http
不过上面介绍的都是unix版本的安装方法,windows咱就老实点吧,下个App Server。
还要提一句,里面说的aslb包可以在下面的地址找:
http://download.java.net/javaee5/external/
不多说了,一步步装好Web Server,都默认就行。
- 在GlassFish V2上使用Cluster并配置load balancer
- 在 GlassFish v2 中使用 SSL
- 在Eclipse WTP 2.0上安装GlassFish V2插件
- 在glassfish v2中配置MySql数据库连接池都方法
- GlassFish v2 虚拟主机配置感悟
- Load Balancer as a Service (LBaaS V2.0)
- 在eclipse上使用glassfish在mac上
- 使用glassfish在linux上的部署网站
- Ubuntu 12.04 / LTS : 3 Node Percona XtraDB Cluster + XtraBackup + GLB Load Balancer ( aka MySQL + Ga
- nginx as Database Load Balancer for MySQL or MariaDB Galera Cluster
- 在 GlassFish 上运行 javapetstore
- 在glassfish上发布liferay
- 使用 Load Balancer,Corosync,Pacemaker 搭建 Linux 高可用集群
- 使用 Load Balancer,Corosync,Pacemaker 搭建 Linux 高可用集群
- 使用 Load Balancer,Corosync,Pacemaker 搭建 Linux 高可用集群
- apache load balancer 翻译
- OpenStack Load Balancer LBaaS
- Nginx Load Balancer Config
- IE不显示PNG解决方法一则
- (原创)LDAP与CAS单点登录集成
- 点站点链接出现短时间白屏或闪屏现象
- javascript ajax提出异步请求
- 正则表达式 - 在线使用帮助
- 在GlassFish V2上使用Cluster并配置load balancer
- PROMISE SMARAID PDC20265R卡安装
- ActiveRecord中实体类问题解决方法
- SharePoint管理中心通过远程桌面不能访问,本机ie可以解决
- ALV 用对象的方法
- (原创)使用SPRING配置LDAP认证服务
- ALV Call function 的方法
- 如何添加
- 用C#调用Windows API和其它进程通信