jvm加以下参数:-Djava.net.preferIPv4Stack=true可以停掉ipv6的支持
jgroups 2.3 + jdk6 是可以支持v4 和v6的。
关掉jvm的ipv6功能
jvm加以下参数:-Djava.net.preferIPv4Stack=true
Issues with JGroups and IPv6 on Linux
In a nutshell: IPv6 works with JGroups !
On Windows (XP), you have to enable IPv6 by clicking on any connection (e.g. "Local Area Connection") --> Properies --> Install --> Protocol --> IPv6. If you do ipconfig, you will see the new IPv6 addresses. By default, WinXP? seems to prefer IPv6.
On Linux, IPv6 doesn't work (see below) due to a bug
in the JDKs up to and including JDK 5. Mustang (JDK 6) fixed this, and I verified that it works on RHAT fedora core 5 . So, on Linux, with SUN's VM, you *have* to use -Djava.net.preferIPv4Stack=true, until you switch to JDK 6. I haven't tried this on JRockit or IBM's VM.
Here is the Jira issues:
http://jira.jboss.com/jira/browse/JGRP-47
IP_MULTICAST_IF:
java.net.SocketException: bad argument for IP_MULTICAST_IF: address not bound to any interface
at java.net.PlainDatagramSocketImpl.socketSetOption(Native Method)
at java.net.PlainDatagramSocketImpl.setOption(PlainDatagramSocketImpl.java:295)
There was an earlier post mentioning the same symptoms. Assuming that you are running JBoss on Linux, if your Linux kernel has IPv6 support, you will have this problem. If you don't need IPv6 support, you can disable it from the kernel and the problem will go away.
Turn off IPv6 in the Linux kernel
To disable IPv6 in the kernel (or really, disable automatic loading of the IPv6 module - see here for IPv6 and Linux details for details), add the following line in your modules config file :
alias net-pf-10 off # disable automatically load of IPv6 module on demand
For 2.4 kernels, this would be in /etc/modules.conf or /etc/conf.modules. For 2.6 kernels, this would be in /etc/modprobe.conf or /etc/modprobe.conf.local (for SLES). You need to reboot the Linux box. I'm not sure of another way to disable this without a reboot. If you know of any, please update this page or add a link to some further docs on the subject.
Also, once you disable this in the kernel, you can still enable IPv6 on an interface by following these instructions (for RedHat? at least).
Turn off IPv6 in the JVM
Another source of problems might be the use of IPv6, and/or misconfiguration of /etc/hosts. If you communicate between an IPv4 and an IPv6 host, and they are not able to find each other, try the java.net.preferIP4Stack=true property, e.g.
java -Djava.net.preferIPv4Stack=true org.jgroups.demos.Draw
JDK 1.4.1 uses IPv6 by default, although is has a dual stack, that is, it also supports IPv4. Here's
more details on the subject.
IPv6 and IP Bonding
Looks like turning IPv6 off also has the nice side effect that IP Bonding works (it doesn't work with IPv6 turned on). This is anecdotal (from a customer support case), and we need to verify this in the 2.3/2.4 time frame
IPv6 support
Due to a bug in the JDK on Linux, a socket cannot be bound to an IPv6 address. This is the reason why -Djava.net.preferIPv4Stack=true has to be used. This bug is supposedly fixed in Mustang (JDK 6). JGroups, starting from version 2.3, supports IPv6. The change from previous versions was mainly how we marshalled IpAddresses?.
分享到:
相关推荐
为了适应不同的操作系统和硬件平台,JVM 需要模拟一个简化的 CPU 架构,以支持各种指令的执行。在典型的 JVM 实现中,存在一个简单的 CPU 架构模型,包括以下几个主要部分: - **PC(Program Counter)**:程序...
标题中提到了JVM原理、JVM调优、JVM内存模型和JAVA并发,这些都是Java虚拟机(JVM)相关的核心概念。JVM是运行Java字节码的虚拟计算机,为Java提供了一个跨平台的环境,确保Java程序可以在不同的操作系统上运行而...
此外,JVM还支持自定义类加载器,以便于实现特定的加载逻辑。 Java代码的编译和执行涉及从源代码到字节码的转换,再到JVM执行引擎解释执行字节码的过程。Java源码编译机制包括三个主要步骤:分析和输入到符号表、...
6. 多线程:JVM支持多线程并发执行,每个线程都有自己的程序计数器和虚拟机栈。 7. 安全管理:JVM执行严格的类型检查和权限控制,确保代码的安全性。 8. 调优工具:如JVisualVM、JConsole等,帮助开发者监控和调整...
SAP JVM 4.1 64位的设计和实现涉及了诸多Java虚拟机的关键技术,如垃圾回收机制、类加载器、多线程支持、性能优化以及对SAP特定需求的定制。它还可能包含了对SAP NetWeaver或其他SAP产品集成的支持。了解并掌握这些...
jvm虚拟机规范和入门资料jvm虚拟机规范和入门资料jvm虚拟机规范和入门资料jvm虚拟机规范和入门资料jvm虚拟机规范和入门资料jvm虚拟机规范和入门资料jvm虚拟机规范和入门资料jvm虚拟机规范和入门资料jvm虚拟机规范和...
标题《JVM调优和故障排除手册》预示着文档将专注于Java虚拟机(JVM)的性能调优以及如何诊断和解决在JVM环境中遇到的问题。JVM是运行Java程序的核心,负责提供内存管理、垃圾回收、多线程处理以及本地方法调用等服务...
11. **线程并发**:JVM如何支持多线程,包括线程同步机制如synchronized、Lock等,以及线程池的使用和优化。 通过观看"jvm视频",你可以直观地了解这些概念,并通过"jvm笔记"加深理解和记忆。理论学习后,实践操作...
Java虚拟机(JVM)是Java程序运行的基础,它的历史发展和内存回收机制是Java开发者必须深入了解的关键领域。本文将详细探讨JVM的发展历程以及内存管理中的垃圾回收机制。 一、JVM的历史发展 1. **早期阶段**:1995...
### JVM必知必会知识点梳理 #### 1. JVM的定义与层次 Java虚拟机(JVM)具有多重含义: ...需要注意的是,JVM的学习是需要与实践相结合的,只有通过不断的实验和调优,才能更好地掌握和应用这些知识。
JVM由多个组件构成,包括类加载器、运行时数据区、执行引擎、本地方法接口和本地库。 JVM的启动过程可以分为以下几个关键步骤: 1. **加载**:当Java应用程序启动时,JVM首先通过类加载器加载主类(即包含main方法...
此资源有两个文件,含 nginx-upstream-jvm-route 和 nginx 对应版本,都是tar.gz文件。 安装方法网上很多就不写了,亲测可用。 不用担心版本不匹配造成安装失败,再浪费积分去到处下载尝试的烦恼。 此资源有两个文件...
Java JVM(Java虚拟机)内存分配与调优是Java开发者必须掌握的重要技能,它涉及到程序的性能优化和稳定性。在Java应用中,JVM扮演着至关重要的角色,它负责解析字节码、管理内存以及执行线程等。本文将深入探讨JVM...
然而,最佳的JVM参数配置往往依赖于具体的应用场景和硬件配置,因此,持续的性能监控和调优是必不可少的。希望本文能为读者提供一个深入理解JVM参数配置的起点,引导大家探索更高级的性能优化技术。
Java虚拟机(JVM)规范和Java语言规范是Java开发者深入理解这个平台和技术的基石。这两部分规范分别定义了Java程序如何在JVM上运行以及Java编程语言的语法和语义。 《Java语言规范》(Java Language Specification...
《JVM和GC详解及调优》是一本深入解析Java虚拟机(JVM)和垃圾收集(Garbage Collection,简称GC)的专业书籍,对于Java开发者来说,是进阶提升的必备资料。书中详尽地阐述了JVM的工作原理,以及如何进行有效的性能...
- JVM指令是字节码,每条指令对应一个特定的操作,如加载和存储变量、算术运算、控制流程、对象创建和方法调用等。 - 指令手册会列出所有这些指令,比如`iconst_5`表示将整数5压入操作数栈,`aload_0`用于将局部...
JVM 内存结构和 6 大区域 JVM 是 Java虚拟机,它是 Java 语言的核心组件之一,为 Java 程序提供了运行环境。JVM 的内存结构是 Java 程序的基础,它的设计和实现对 Java 程序的性能和可靠性产生了深远的影响。 JVM ...