作者:郭奧門
愛可生 DBLE 研發成員,負責分佈式數據庫中間件的新功能開發,回答社區/客戶/內部提出的一般性問題。
本文來源:原創投稿
*愛可生開源社區出品,原創內容未經授權不得隨意使用,轉載請聯繫小編並註明來源。
背景
鯤鵬 920 處理器是華爲在 2019 年 1 月發佈的數據中心高性能處理器,由華爲自主研發設計,旨在滿足數據中心多樣性計算、綠色計算等需求。鯤鵬處理器基於 ARM 架構。
ARM 是一種 CPU 架構,有別於 Intel&AMD 的CPU 採用的 CISC 複雜指令集;ARM CPU 採用 RISC 精簡指令集(reduced instruction set computer,精簡指令集計算機)。
近幾年爲了響應國產化的號召,越來越多的國內廠商也逐漸使用華爲鯤鵬920的服務器來替代之前的服務器。最近也是有很多社區小夥伴在鯤鵬的服務器上安裝dble時遇到了一些問題,這裏總結了一下安裝步驟。
步驟
DBLE 的 GitHub 文檔《0.3 快速開始》是基於 x86 處理器的服務器的安裝教程,在基於 ARM 處理器的服務器上安裝 DBLE 時可能會報以下錯誤:
[root@huawei bin]# ./dble start
Unable to locate any of the following operational binaries:
/opt/dble/bin/./wrapper-linux-aarch64-64
/opt/dble/bin/./wrapper-linux-aarch64-32
/opt/dble/bin/./wrapper
這時我們需要先執行以下步驟:
1. 補齊 wrapper 需要的文件
-
從 java service wrapper 下載並解壓 ARM 架構的文件
wget https://download.tanukisoftware.com/wrapper/3.5.40/wrapper-linux-armhf-64-3.5.40.tar.gz
tar zxvf wrapper-linux-armhf-64-3.5.40.tar.gz
-
將 bin/wrapper 拷貝至 dble/bin 目錄下
-
將 lib/libwrapper.so 拷貝至 dble/lib 目錄下
2. 安裝鯤鵬版 jdk
環境變量等問題不在此贅述,自行 Google 解決(adoptopenjdk 官網、編譯工具 — AdoptOpenJDK)。
3. 啓動 DBLE
查看 wrapper.log,如出現類似以下的日誌表示 DBLE 啓動成功。
STATUS | wrapper | 2021/01/08 13:45:15 | --> Wrapper Started as Daemon
STATUS | wrapper | 2021/01/08 13:45:15 | Java Service Wrapper Community Edition 64-bit 3.5.40
STATUS | wrapper | 2021/01/08 13:45:15 | Copyright (C) 1999-2019 Tanuki Software, Ltd. All Rights Reserved.
STATUS | wrapper | 2021/01/08 13:45:15 | http://wrapper.tanukisoftware.com
STATUS | wrapper | 2021/01/08 13:45:15 |
STATUS | wrapper | 2021/01/08 13:45:16 | Launching a JVM...
INFO | jvm 1 | 2021/01/08 13:45:16 | Listening for transport dt_socket at address: 8088
INFO | jvm 1 | 2021/01/08 13:45:16 | WrapperManager: Initializing...
INFO | jvm 1 | 2021/01/08 13:45:19 | Server startup successfully. dble version is [5.7.21-dble-3.20.10.99-cdc0923be854d91a0f942a9027bef1454057bde3-20210107185349]. Please see logs in logs/dble.log
4. 連接驗證
查看 user.xml 文件中的 shardingUser 用戶,並使用 mysql 客戶端建立連接,如出現以下情況表示連接建立成功。
[root@localhost ~]# mysql -uroot -p123456 -P8066 -hyour_ip
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.7.11-dble-3.20.10.0-b29c7c91ac638509dbc4f2c146aea41c3f9f0b83-20201203053354 dble Server (ActionTech)
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+----------+
| DATABASE |
+----------+
| testdb |
+----------+
1 row in set (0.04 sec)
mysql> use testdb;
Database changed
注意
-
wrapper 版本爲 3.5.40,不一致會報錯。
INFO | jvm 1 | 2021/01/08 16:12:21 | WrapperManager: ERROR - The version of the Wrapper which launched this JVM is "3.5.42"
INFO | jvm 1 | 2021/01/08 16:12:21 | WrapperManager: while the version of the Wrapper jar file currently in use
INFO | jvm 1 | 2021/01/08 16:12:21 | WrapperManager: is "3.5.40".
INFO | jvm 1 | 2021/01/08 16:12:21 | WrapperManager:
STATUS | wrapper | 2021/01/08 16:12:23 | <-- Wrapper Stopped
-
不使用鯤鵬版的 jdk 也是可以啓動成功,不過在實際使用過程中可能會出現無法預知的問題(比如之前遇到使用 Oracle 的 ARM 版 jdk,DBLE 可以啓動,但是隊列無法工作,會阻塞任務)。
文章推薦:
分佈式 | Global 表 Left Join 拆分表實現原因探究
社區近期動態
本文分享自微信公衆號 - 愛可生開源社區(ActiontechOSS)。
如有侵權,請聯繫 [email protected] 刪除。
本文參與“OSC源創計劃”,歡迎正在閱讀的你也加入,一起分享。