Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loongarch64 architecture throw librocksdbjni-linux64.so error . #11526

Closed
ljh205sy opened this issue Jun 12, 2023 · 3 comments
Closed

loongarch64 architecture throw librocksdbjni-linux64.so error . #11526

ljh205sy opened this issue Jun 12, 2023 · 3 comments
Labels
Build build, makefile, cmake, scripts question

Comments

@ljh205sy
Copy link

Note: Please use Issues only for bug reports. For questions, discussions, feature requests, etc. post to dev group: https://groups.google.com/forum/#!forum/rocksdb or https://www.facebook.com/groups/rocksdb.dev

the system was throw errors when nacos started on loongarch64 architecture。How to fixed it.
[root@vap test]# uname -a
Linux vap.kafka.com.cn 4.19.90-52.22.sm3.03.v2207.a.ky10.loongarch64 #1 SMP Sun May 14 15:09:34 CST 2023 loongarch64 loongarch64 loongarch64 GNU/Linux

image

Caused by: java.lang.UnsatisfiedLinkError: /opt/test/rocksdb/librocksdbjni-linux64.so: /opt/test/rocksdb/librocksdbjni-linux64.so: 无法打开共享对象文件: 没有那个文件或目录 (Possible cause: can't load AMD 64-bit .so on a LOONGARCH64-bit platform)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1934)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1817)
at java.lang.Runtime.load0(Runtime.java:810)
at java.lang.System.load(System.java:1088)
at org.rocksdb.NativeLibraryLoader.loadLibraryFromJar(NativeLibraryLoader.java:102)
at org.rocksdb.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:82)
at org.rocksdb.RocksDB.loadLibrary(RocksDB.java:70)
at org.rocksdb.RocksDB.(RocksDB.java:39)
at com.alipay.sofa.jraft.storage.impl.RocksDBLogStorage.(RocksDBLogStorage.java:77)
at com.alipay.sofa.jraft.core.DefaultJRaftServiceFactory.createLogStorage(DefaultJRaftServiceFactory.java:50)
at com.alipay.sofa.jraft.core.NodeImpl.initLogStorage(NodeImpl.java:580)
at com.alipay.sofa.jraft.core.NodeImpl.init(NodeImpl.java:1005)
at com.alipay.sofa.jraft.core.NodeImpl.init(NodeImpl.java:141)
at com.alipay.sofa.jraft.RaftServiceFactory.createAndInitRaftNode(RaftServiceFactory.java:47)
at com.alipay.sofa.jraft.RaftGroupService.start(RaftGroupService.java:129)
at com.alibaba.nacos.core.distributed.raft.JRaftServer.createMultiRaftGroup(JRaftServer.java:260)
at com.alibaba.nacos.core.distributed.raft.JRaftProtocol.addRequestProcessors(JRaftProtocol.java:163)
at com.alibaba.nacos.naming.core.v2.service.impl.PersistentClientOperationServiceImpl.(PersistentClientOperationServiceImpl.java:96)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:211)
... 57 common frames omitted

Expected behavior

Actual behavior

Steps to reproduce the behavior

@jowlyzhang
Copy link
Contributor

According to RocksDB makefile, .so file built for loongarch64 machines would have the file name formatted like this:
https://github.com/facebook/rocksdb/blob/main/Makefile#L2078
librocksdbjni-linux-$(MACHINE)$(JNI_LIBC_POSTFIX).so

Where $(MACHINE) should contain the literal "loongarch64"

This file "librocksdbjni-linux64.so" doesn't seem to be built for this type of platform. Please try to rebuild from source code specifically for this machine.

@jowlyzhang jowlyzhang added Build build, makefile, cmake, scripts question labels Jun 12, 2023
@ljh205sy
Copy link
Author

image

RocksDB在该机器下重新编译,重新生成rocksDBJNI,

指定librocksdbjni.so文件路径,如果没有该文件,会从jar文件内查找,最后会放到/tmp目录下。tmp/librocksdbjni.so没有权限
JAVA_OPT="${JAVA_OPT} -Djava.library.path=${BASE_DIR}/target"

编译版本:rocksdb-7.10.2
jraft版本: 1.3.13

com.alipay.sofa
jraft-parent
1.3.13

@ljh205sy
Copy link
Author

According to RocksDB makefile, .so file built for loongarch64 machines would have the file name formatted like this: https://github.com/facebook/rocksdb/blob/main/Makefile#L2078 librocksdbjni-linux-$(MACHINE)$(JNI_LIBC_POSTFIX).so

Where $(MACHINE) should contain the literal "loongarch64"

This file "librocksdbjni-linux64.so" doesn't seem to be built for this type of platform. Please try to rebuild from source code specifically for this machine.

Thanks. Rebuild successful can be resolved this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build build, makefile, cmake, scripts question
Projects
None yet
Development

No branches or pull requests

2 participants