Installing Kibana on a Raspberry Pi 4 using Raspbian Buster

I have ES and logstash 7.4 installed on a RPi 4B. I understand that Kibana no longer supports 32-bit operating systems, but I found another thread where someone installed 64-bit Kibana on a 32-bit OS.

I figured I could attempt this on Raspbian, so here are the commands I used:

sudo apt-get install nodejs

mkdir /usr/share/kibana && cd /usr/share/kibana

wget https://artifacts.elastic.co/downloads/kibana/kibana-7.4.0-amd64.deb

sudo dpkg -i --force-all kibana-7.4.0-amd64.deb

Finally, I attempted to start it using my node installation from the directory /usr/share/kibana. Kibana attempts to start, but after several seconds I get a fatal error:

pi@raspberrypi:/usr/share/kibana $ /usr/bin/node src/cli
log [04:29:36.441] [info][plugins-system] Setting up [4] plugins: [security,translations,inspector,data]
log [04:29:36.501] [info][plugins][security] Setting up plugin
log [04:29:36.509] [warning][config][plugins][security] Generating a random key for xpack.security.encryptionKey. To prevent sessions from being invalidated on restart, please set xpack.security.encryptionKey in kibana.yml
log [04:29:36.511] [warning][config][plugins][security] Session cookies will be transmitted over insecure connections. This is not recommended.
log [04:29:36.843] [info][plugins][translations] Setting up plugin
log [04:29:36.846] [info][data][plugins] Setting up plugin
log [04:29:36.859] [info][plugins-system] Starting [3] plugins: [security,translations,data]
log [04:30:43.568] [fatal][root] Error: /usr/share/kibana/node_modules/@elastic/nodegit/build/Release/nodegit.node: wrong ELF class: ELFCLASS64
at Object.Module._extensions..node (internal/modules/cjs/loader.js:718:18)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/usr/share/kibana/node_modules/@elastic/nodegit/dist/nodegit.js:12:12)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Module._compile (/usr/share/kibana/node_modules/pirates/lib/index.js:99:24)
at Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Object.newLoader [as .js] (/usr/share/kibana/node_modules/pirates/lib/index.js:104:7)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
log [04:30:43.582] [info][plugins-system] Stopping all plugins.
log [04:30:43.584] [info][data][plugins] Stopping plugin
log [04:30:43.586] [info][plugins][translations] Stopping plugin
log [04:30:43.587] [info][plugins][security] Stopping plugin

FATAL Error: /usr/share/kibana/node_modules/@elastic/nodegit/build/Release/nodegit.node: wrong ELF class: ELFCLASS64

I realize that it's not meant to run on a 32-bit OS, but if anyone could help here I would appreciate it. The other Kibana thread I linked seemed to have success using Node to accomplish this, but I'm at a loss on how to continue in my specific circumstance.

@glassman during the build we do some procedures to create our distributables. Right now we use a package called nodegit (https://github.com/elastic/nodegit) which is a native module and as so, one of the required steps from our build is to include the correct nodegit builds per platform (in that case a 64bits version).

I think your only option is to try to build @elastic/nodegit on your platform, then build kibana and in the end replace the nodegit build files on kibana/node_modules/@elastic/nodegit/build

Cheers,

@tiagocosta Thank you for your reply. It certainly helped point me in the right direction. Now I have another question, that is if you (or another knowledgeable stranger) would be generous enough to lend me some more advice.

I was able to build nodegit and place it into the appropriate Kibana directory, but like you said, that wasn't enough as I get the following fatal error when issuing the command '/usr/bin/node src/cli':

pi@raspberrypi:/usr/share/kibana $ /usr/bin/node src/cli

log [02:22:19.275] [info][plugins-system] Setting up [4] plugins: [security,translations,inspector,data]
log [02:22:19.308] [info][plugins][security] Setting up plugin
log [02:22:19.314] [warning][config][plugins][security] Generating a random key for xpack.security.encryptionKey. To prevent sessions from being invalidated on restart, please set xpack.security.encryptionKey in kibana.yml
log [02:22:19.316] [warning][config][plugins][security] Session cookies will be transmitted over insecure connections. This is not recommended.
log [02:22:19.350] [info][plugins][translations] Setting up plugin
log [02:22:19.351] [info][data][plugins] Setting up plugin
log [02:22:19.359] [info][plugins-system] Starting [3] plugins: [security,translations,data]
log [02:22:33.132] [fatal][root] { Error: Cannot find module '/usr/share/kibana/node_modules/@elastic/node-ctags/ctags/build/ctags-node-v64-linux-arm/ctags.node'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/usr/share/kibana/node_modules/@elastic/node-ctags/ctags/lib/ctags.js:7:12)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Module._compile (/usr/share/kibana/node_modules/pirates/lib/index.js:99:24)
at Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Object.newLoader [as .js] (/usr/share/kibana/node_modules/pirates/lib/index.js:104:7)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/usr/share/kibana/node_modules/@elastic/ctags-langserver/lib/lsp-server.js:28:28)
at Module._compile (internal/modules/cjs/loader.js:689:30) code: 'MODULE_NOT_FOUND' }
log [02:22:33.148] [info][plugins-system] Stopping all plugins.
log [02:22:33.150] [info][data][plugins] Stopping plugin
log [02:22:33.151] [info][plugins][translations] Stopping plugin
log [02:22:33.152] [info][plugins][security] Stopping plugin

FATAL Error: Cannot find module '/usr/share/kibana/node_modules/@elastic/node-ctags/ctags/build/ctags-node-v64-linux-arm/ctags.node'

Because of that, I've been trying to build Kibana from source. I have Yarn and Nodejs v10.15 installed, but when I try to run 'yarn kbn bootstrap', I get a specific error regarding Cypress that I cannot make go away.

[5/5] Building fresh packages...
[9/74] ⢀ puppeteer
[6/74] ⢀ node-sass
[12/74] ⠠ backport
[8/74] ⠠ yo
error /home/pi/kibana/node_modules/cypress: Command failed.
Exit code: 1
Command: node index.js --exec install
Arguments:
Directory: /home/pi/kibana/node_modules/cypress
Output:
Installing Cypress (version: 3.4.1)

[06:37:48] Downloading Cypress [started]
[06:37:51] Downloading Cypress [failed]
[06:37:51] → The Cypress App could not be downloaded.

I guess Cypress only supports up to version 3.2.0 for 32-bit operating systems, so I'm trying to figure out a way to either use version 3.2.0 or get rid of Cypress completely.

I've tried issuing the command 'yarn upgrade cypress@3.2.0' which to my understanding is supposed to update the yarn.lock file when finished, but even that doesn't make it through as for some reason, the upgrade process again gives me a message (like above) about failing to download Cypress 3.4.1.

Heck, I even tried taking Cypress out of the top level package.json and yarn.lock files completely, but no matter what I do, the yarn upgrade/bootstrap/install process will try to install Cypress 3.4.1. Any ideas on what I should do?

@tiagocosta I have Kibana 7.4.0 working for the RPi 4. Before I post the steps I took, I wanted to know your thoughs on node-ctags. Is there a place where I can get/compile a 32-bit feature comparable version of the 64-bit one included in Kibana?

As is stands, I have a version of ctags that works, but I don't know if it will present any issues moving forward as it was kind of "hacky" to get it to work in the first place.

1 Like

Hello, I have the same problem as you when I install kibana on Raspberry pi 4B, How did you solve it? Can you give me some advice?

@sixian_he Yes, I can tell you. Sorry it's taken so long to reply. I feel like I've been as helpful as every other joker who hasn't replied here. For what it's worth, for as well designed as this forum is, I feel like team members should find it easier to reply with something, but it seems as though the opposite is true. Moving on ...

First, download and install kibana:

cd ~/ && wget https://artifacts.elastic.co/downloads/kibana/kibana-7.4.0-amd64.deb
sudo dpkg -i --force-all kibana-7.4.0-amd64.deb

Build @elastic/nodegit and ctags on your platform to replace the nodegit amd64 build files located at kibana/node_modules/@elastic/nodegit/build with the one you just compiled.

The following command installs nodejs and npm. Note that only nodejs is required to run our custom kibana install, not npm. However, npm is needed to install packages we will use to replace in kibana:

sudo apt-get install nodejs npm

The following commands will install nodegit. Phantomjs is used in conjunction with npm to build nodegit.

Nodegit prereqs:

sudo apt-get install libkrb5-dev

NPM install of nodegit. As stated above, nodegit depends on phantomjs, which we will also download:

cd ~/ && git clone https://github.com/nodegit/nodegit.git && cd nodegit
wget https://github.com/fg2it/phantomjs-on-raspberry/releases/download/v2.1.1-wheezy-jessie-armv6/phantomjs
export PATH=$PATH:~/nodegit
sudo chmod -R 777 ~/nodegit
npm install

The following commands backup the old nodegit module:

sudo mv /usr/share/kibana/node_modules/@elastic/nodegit/build/Release /usr/share/kibana/node_modules/@elastic/nodegit/build/Release.old
sudo mv /usr/share/kibana/node_modules/@elastic/nodegit/dist/enums.js /usr/share/kibana/node_modules/@elastic/nodegit/dist/enums.js.old

Replace nodegit module with one just built:

sudo cp -rf ~/nodegit/build/Release /usr/share/kibana/node_modules/@elastic/nodegit/build
sudo cp ~/nodegit/dist/enums.js /usr/share/kibana/node_modules/@elastic/nodegit/dist

Install node-ctags into local nodegit directory:

cd ~/nodegit
npm install ctags

The following commands change the folder name and backup the old ctags module:

sudo mv /usr/share/kibana/node_modules/@elastic/node-ctags/ctags/build/ctags-node-v64-linux-x64 /usr/share/kibana/node_modules/@elastic/node-ctags/ctags/build/ctags-node-v64-linux-arm
sudo mv /usr/share/kibana/node_modules/@elastic/node-ctags/ctags/build/ctags-node-v64-linux-arm/ctags.node /usr/share/kibana/node_modules/@elastic/node-ctags/ctags/build/ctags-node-v64-linux-arm/ctags.node.old

Replace node-ctags module with one just built:

sudo cp ~/nodegit/node_modules/ctags/build/Release/ctags.node /usr/share/kibana/node_modules/@elastic/node-ctags/ctags/build/ctags-node-v64-linux-arm

Edit the kibana start script so that it uses your node installation:

sudo nano /usr/share/kibana/bin/kibana

Locate the line that starts with NODE="${DIR}/node/bin/node" and edit it to mirror the below example:

NODE="/usr/bin/node"

Save and exit the file.

Enable and start the kibana service. Be patient as kibana takes a while to load:

sudo systemctl enable kibana
sudo systemctl start kibana

1 Like

@glassman @sixian_he both nodegit and ctags won't be present in the next public kibana version, so you won't have the need to worry with them anymore.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.