activemq-artemis - Apache Artemis - libartemis-native-64.so 发货与手动创建 - 都是相同的
问题描述
Apache Artemis tar.gz 附带了一个bin/lib/linux-x86_64/libartemis-native-64.so
我不知道的,直到我手动使用本机源来创建那个 .so 文件。
问题:
libartemis-native-64.so
tar 附带了一个 - 这与在代理运行的特定 Linux 机器上从源代码生成有什么不同吗?- 我可以使用
libartemis-native-64.so
tar.gz 附带的本机库吗,有什么影响吗? - 生成的本机库与发货的库相比大小不同。
- 如果我们需要使用生成的原生库,我们是否需要简单地替换 $ARTEMIS_HOME/bin/lib/linux* 位置下的那个?
- 最后,如何验证代理是否使用了本机库,在我的情况下,我在日志上看不到任何信息。只看到使用 AIO 消息。
2020-08-14 12:24:16,226 INFO [org.apache.activemq.artemis.integration.bootstrap] AMQ101000: Starting ActiveMQ Artemis Server
2020-08-14 12:24:16,269 INFO [org.apache.activemq.artemis.core.server] AMQ221000: live Message Broker is starting with configuration Broker Configuration (clustered=true,journalDirectory=data/journal,bindingsDirectory=data/bindings,largeMessagesDirectory=data/large-messages,pagingDirectory=data/paging)
2020-08-14 12:24:16,662 INFO [org.apache.activemq.artemis.core.server] AMQ221055: There were too many old replicated folders upon startup, removing /brokers/broker1/data/bindings/oldreplica.1
2020-08-14 12:24:16,663 INFO [org.apache.activemq.artemis.core.server] AMQ222162: Moving data directory /brokers/broker1/data/bindings to /brokers/broker1/data/bindings/oldreplica.3
2020-08-14 12:24:16,667 INFO [org.apache.activemq.artemis.core.server] AMQ221055: There were too many old replicated folders upon startup, removing /brokers/broker1/data/journal/oldreplica.1
2020-08-14 12:24:16,671 INFO [org.apache.activemq.artemis.core.server] AMQ222162: Moving data directory /brokers/broker1/data/journal to /brokers/broker1/data/journal/oldreplica.3
2020-08-14 12:24:16,673 INFO [org.apache.activemq.artemis.core.server] AMQ221055: There were too many old replicated folders upon startup, removing /brokers/broker1/data/paging/oldreplica.1
2020-08-14 12:24:16,674 INFO [org.apache.activemq.artemis.core.server] AMQ222162: Moving data directory /brokers/broker1/data/paging to /brokers/broker1/data/paging/oldreplica.3
2020-08-14 12:24:16,703 INFO [org.apache.activemq.artemis.core.server] AMQ221012: Using AIO Journal
2020-08-14 12:24:16,706 WARN [org.apache.activemq.artemis.core.server] AMQ222007: Security risk! Apache ActiveMQ Artemis is running with the default cluster admin user and default password. Please see the cluster chapter in the ActiveMQ Artemis User Guide for instructions on how to change this.
2020-08-14 12:24:16,716 INFO [org.apache.activemq.artemis.core.server] AMQ221057: Global Max Size is being adjusted to 1/2 of the JVM max size (-Xmx). being defined as 2,147,483,648
2020-08-14 12:24:16,763 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-server]. Adding protocol support for: CORE
2020-08-14 12:24:16,763 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-amqp-protocol]. Adding protocol support for: AMQP
以下是我遵循的步骤,以防它帮助其他人。
从链接下载的本机源文件
如文档中所述,更新了 Linux VM (RHEL dist) 中的最新软件包
$ sudo yum install libtool gcc-c++ gcc libaio libaio-devel make
- 将代码提取到
apache-artemis-native-1.0.2
文件夹中,在该文件夹中使用以下命令创建 .so 文件
$ ./scripts/compile-native.sh
// This command threw compilation error for missing gnu/stubs.h (which i think is 32-bit dependency)
上面的命令在 target/ 文件夹中创建了 libartemis-native-64.so。(由于编译错误,未创建 32 位库)
- 我正在探索将这个库设置为
java.library.path
borker 实例的方法。 - 注意到 broker1/bin/artemis shell 脚本指
java.library.path
的是 artemis-2.14.0(提取的 tar.gz 位置)bin/lib 路径。 - 我将 libartemis-nativie-64.so 复制到这个位置,假设它会被代理实例拾取。
下面是 broker-instance broker1/bin/artemis 的内容。
exec "$JAVACMD" \
$JAVA_ARGS \
-Xbootclasspath/a:"$LOG_MANAGER:$WILDFLY_COMMON" \
-Djava.security.auth.login.config="$ARTEMIS_INSTANCE_ETC/login.config" \
$ARTEMIS_CLUSTER_PROPS \
-classpath "$CLASSPATH" \
-Dartemis.home="$ARTEMIS_HOME" \
-Dartemis.instance="$ARTEMIS_INSTANCE" \
-Djava.library.path="$ARTEMIS_HOME/bin/lib/linux-$(uname -m)" \
-Djava.io.tmpdir="$ARTEMIS_INSTANCE/tmp" \
-Ddata.dir="$ARTEMIS_DATA_DIR" \
-Dartemis.instance.etc="$ARTEMIS_INSTANCE_ETC" \
-Djava.util.logging.manager="$ARTEMIS_LOG_MANAGER" \
-Dlogging.configuration="$ARTEMIS_LOGGING_CONF" \
$DEBUG_ARGS \
org.apache.activemq.artemis.boot.Artemis "$@"
解决方案
推荐阅读
- python-3.x - Python2 (str) 字节串
- html - 如何查看图像“onerror”事件的实际错误?
- node.js - Model.findAll() 只返回一个相同的孩子
- regex - 删除不包含媒体文件的目录
- php - phinx "--configuration 选项不存在。"
- python - 如何打印此列表的所有组合?
- java - 从 db.properties 文件加载属性时出现异常
- java - ¿ 如何检查 int 变量的字符数?
- javascript - 我们可以在 JS 文件的顶部写“use strict”,它会验证所有函数和语句吗?
- python - Django Migration InternalError 1054 未知列