Launch MongoDB built from source on ARM - mongodb

I followed this tutorial to compile a MongoDB on a raspberry pi. I ended up with the content of the tarball which is on the same repo.
The unpacked archive has the following structure:
mongo-embedded-sdk-4.0.4
include lib share
mongo-embedded-sdk-4.0.4/include:
libbson-1.0 libmongoc-1.0 mongo_embedded mongoc_embedded
mongo-embedded-sdk-4.0.4/include/libbson-1.0:
bson bson.h
mongo-embedded-sdk-4.0.4/include/libbson-1.0/bson:
bcon.h bson-context.h bson-json.h bson-oid.h bson-value.h
bson-atomic.h bson-decimal128.h bson-keys.h bson-reader.h bson-version-functions.h
bson-clock.h bson-endian.h bson-macros.h bson-string.h bson-version.h
bson-compat.h bson-error.h bson-md5.h bson-types.h bson-writer.h
bson-config.h bson-iter.h bson-memory.h bson-utf8.h bson.h
mongo-embedded-sdk-4.0.4/include/libmongoc-1.0:
mongoc mongoc.h
mongo-embedded-sdk-4.0.4/include/libmongoc-1.0/mongoc:
mongoc-apm.h mongoc-error.h mongoc-init.h mongoc-socket.h mongoc-topology-description.h
mongoc-bulk-operation.h mongoc-find-and-modify.h mongoc-iovec.h mongoc-ssl.h mongoc-uri.h
mongoc-change-stream.h mongoc-flags.h mongoc-log.h mongoc-stream-buffered.h mongoc-version-functions.h
mongoc-client-pool.h mongoc-gridfs-file-list.h mongoc-macros.h mongoc-stream-file.h mongoc-version.h
mongoc-client-session.h mongoc-gridfs-file-page.h mongoc-matcher.h mongoc-stream-gridfs.h mongoc-write-concern.h
mongoc-client.h mongoc-gridfs-file.h mongoc-opcode.h mongoc-stream-socket.h mongoc.h
mongoc-collection.h mongoc-gridfs.h mongoc-rand.h mongoc-stream-tls-libressl.h
mongoc-config.h mongoc-handshake.h mongoc-read-concern.h mongoc-stream-tls-openssl.h
mongoc-cursor.h mongoc-host-list.h mongoc-read-prefs.h mongoc-stream-tls.h
mongoc-database.h mongoc-index.h mongoc-server-description.h mongoc-stream.h
mongo-embedded-sdk-4.0.4/include/mongo_embedded:
v1
mongo-embedded-sdk-4.0.4/include/mongo_embedded/v1:
mongo_embedded
mongo-embedded-sdk-4.0.4/include/mongo_embedded/v1/mongo_embedded:
mongo_embedded.h
mongo-embedded-sdk-4.0.4/include/mongoc_embedded:
v1
mongo-embedded-sdk-4.0.4/include/mongoc_embedded/v1:
mongoc_embedded
mongo-embedded-sdk-4.0.4/include/mongoc_embedded/v1/mongoc_embedded:
mongoc_embedded.h
mongo-embedded-sdk-4.0.4/lib:
cmake libbson-1.0.so.0 libmongo_embedded.so libmongoc-1.0.so.0 libmongoc_embedded.so
libbson-1.0.so libbson-1.0.so.0.0.0 libmongoc-1.0.so libmongoc-1.0.so.0.0.0 pkgconfig
mongo-embedded-sdk-4.0.4/lib/cmake:
libbson-1.0 libmongoc-1.0
mongo-embedded-sdk-4.0.4/lib/cmake/libbson-1.0:
libbson-1.0-config-version.cmake libbson-1.0-config.cmake
mongo-embedded-sdk-4.0.4/lib/cmake/libmongoc-1.0:
libmongoc-1.0-config-version.cmake libmongoc-1.0-config.cmake
mongo-embedded-sdk-4.0.4/lib/pkgconfig:
libbson-1.0.pc libmongoc-1.0.pc
mongo-embedded-sdk-4.0.4/share:
doc mongo-c-driver
mongo-embedded-sdk-4.0.4/share/doc:
mongo_embedded mongoc_embedded
mongo-embedded-sdk-4.0.4/share/doc/mongo_embedded:
LICENSE-Community.txt LICENSE-Embedded.txt THIRD-PARTY-NOTICES
mongo-embedded-sdk-4.0.4/share/doc/mongoc_embedded:
LICENSE-Community.txt LICENSE-Embedded.txt
mongo-embedded-sdk-4.0.4/share/mongo-c-driver:
uninstall.sh
When I installed it from a package I just had to run
dbPath="/home/pi/app/mongodb_data"
mongod --dbpath "$dbPath" &
Question:
How can I launch the MongoDB to listen on a port?

The tutorial you have followed is for building MongoDB as a library to embed in your application (aka MongoDB Mobile). This embedded build does not provide a standalone server daemon (mongod); you have to link this library directly into your application. The output of the embedded SDK build is the required development header files (include/*.h) and compiled library files (lib/*.so).
For more context, see the original blog post related to the repo you found: Embedded MongoDB 4.0 on Raspberry Pi.
How can I launch the MongoDB to listen on a port?
This requires a build of the normal MongoDB community server. You could try to follow the server build instructions on Build MongoDB from source or look for a precompiled binary for your O/S distro.
Note that Raspberry Pi isn't a generally supported target for the server so you will likely encounter some challenges (particularly on 32-bit O/S). The standard MongoDB server is designed to run on 64-bit hardware with more resources than are typical on a Pi.

Related

zc702 not BOOTing up my yocto created build

Any possible solution in this regard should be appreciated, I have yocto gatesgarth version running on Linux 20.04, have compiled my build successfully with no error messages but while trying to boot it up on board it does not blink blue led(not loading my build image). have tried by keeping all files in Boot partition and rootfs in root partition but it doesn't even boot (blinked blue LED )
boot.bin u-boot.elf boot.bin-zc702-zynq7 u-boot.img boot.bin-zc702-zynq7-v2020.01-xilinx-v2020.2+gitAUTOINC+bb4660c33a-r0 u-boot-xlnx-initial-env boot.scr u-boot-xlnx-initial-env-zc702-zynq7 core-image-minimal-zc702-zynq7-20210623025329.qemuboot.conf u-boot-xlnx-initial-env-zc702-zynq7-v2020.01-xilinx-v2020.2+gitAUTOINC+bb4660c33a-r0 core-image-minimal-zc702-zynq7-20210623025329.rootfs.cpio u-boot-zc702-zynq7.elf core-image-minimal-zc702-zynq7-20210623025329.rootfs.cpio.gz.u-boot u-boot-zc702-zynq7.img core-image-minimal-zc702-zynq7-20210623025329.rootfs.manifest u-boot-zc702-zynq7-v2020.01-xilinx-v2020.2+gitAUTOINC+bb4660c33a-r0.elf core-image-minimal-zc702-zynq7-20210623025329.rootfs.tar.gz u-boot-zc702-zynq7-v2020.01-xilinx-v2020.2+gitAUTOINC+bb4660c33a-r0.img core-image-minimal-zc702-zynq7-20210623025329.testdata.json u-boot-zynq-scr--1.0-r0.scr core-image-minimal-zc702-zynq7.cpio uEnv.txt core-image-minimal-zc702-zynq7.cpio.gz.u-boot uImage core-image-minimal-zc702-zynq7.manifest uImage--5.4+git0+62ea514294-r0-zc702-zynq7-20210622034511.bin core-image-minimal-zc702-zynq7.qemuboot.conf uImage-zc702-zynq7.bin core-image-minimal-zc702-zynq7.tar.gz zImage core-image-minimal-zc702-zynq7.testdata.json zImage--5.4+git0+62ea514294-r0-zc702-zynq7-20210622034511.bin modules--5.4+git0+62ea514294-r0-zc702-zynq7-20210622034511.tgz zImage-zc702-zynq7.bin modules-zc702-zynq7.tgz zynq-zc702--5.4+git0+62ea514294-r0-zc702-zynq7-20210622034511.dtb pxeboot zynq-zc702.dtb pxelinux.cfg zynq-zc702-zc702-zynq7.dtb
i have tried with putty but it do not even display any single character on screen.
IS MY BOOT.BIN HAVE BIT FILE IN IT ? how i can confirm that
This is working fine now. i just have made my BOOT.bin with petalinux and uses my yocto build rootfs as ROOT this is working fine on my board.

bitbake error in do_rootfs: systemd depends on update-rc.d

I got a bit stuck debugging a yocto build problem. I encountered this while updating from yocto warrior (2.7) to yocto dunfell (3.1) The build fails during the building of the rootfs, all steps before seem to work:
ERROR: my-project-develop-1.0-r0 do_rootfs: Could not invoke dnf. Command '/shared/build/tmp/work/raspberrypi_cm3-poky-linux-gnueabi/my-project-develop/1.0-r0/recipe-sysroot-native/usr/bin/dnf -v --rpmverbosity=info -y -c /shared/build/tmp/work/raspberrypi_cm3-poky-linux-gnueabi/my-project-develop/1.0-r0/rootfs/etc/dnf/dnf.conf --setopt=reposdir=/shared/build/tmp/work/raspberrypi_cm3-poky-linux-gnueabi/my-project-develop/1.0-r0/rootfs/etc/yum.repos.d --installroot=/shared/build/tmp/work/raspberrypi_cm3-poky-linux-gnueabi/my-project-develop/1.0-r0/rootfs --setopt=logdir=/shared/build/tmp/work/raspberrypi_cm3-poky-linux-gnueabi/my-project-develop/1.0-r0/temp --repofrompath=oe-repo,/shared/build/tmp/work/raspberrypi_cm3-poky-linux-gnueabi/my-project-develop/1.0-r0/oe-rootfs-repo --nogpgcheck install base-version-develop bash cairo cantarell-fonts cellular-geolocation commit-hashes-develop crda curl disable-airplane-mode disable-power-saving-for-some-devices disconnect-wifi-without-connectivity dnsmasq dosfstools e2fsprogs e2fsprogs-resize2fs firmware-develop fit-conf gbs-overlay geofencing-db hostapd htop i2c-tools iw jq lateswap libgpiod libgpiod-tools linux-firmware-rtl8192cu matlab-develop modemmanager mosquitto mosquitto-clients nano network-configuration networkmanager openmoji-fonts os-release ostree ostree-devicetrees ostree-initramfs ostree-kernel packagegroup-base packagegroup-base-extended packagegroup-core-boot packagegroup-core-ssh-openssh parted psplash-raspberrypi pstree raspi-gpio rtwpriv run-postinsts set-modes-and-bands source-han-sans-jp-fonts special-shadow sqlite3tzdata u-boot-fw-utils userland weston weston-init wifi-configurator-frontend-develop wifilm811 wifilm843 wpa-supplicant locale-base-en-us' returned 1:
DNF version: 4.2.2
cachedir: /shared/build/tmp/work/raspberrypi_cm3-poky-linux-gnueabi/my-project-develop/1.0-r0/rootfs/var/cache/dnf
Added oe-repo repo from /shared/build/tmp/work/raspberrypi_cm3-poky-linux-gnueabi/my-project-develop/1.0-r0/oe-rootfs-repo
repo: using cache for: oe-repo
not found other for:
not found modules for:
not found deltainfo for:
not found updateinfo for:
oe-repo: using metadata from Tue 16 Feb 2021 08:59:38 AM UTC.
No module defaults found
--> Starting dependency resolution
--> Finished dependency resolution
Error:
Problem 1: package packagegroup-core-boot-1.0-r17.raspberrypi_cm3 requires systemd, but none of the providers can be installed
- conflicting requests
- nothing provides update-rc.d needed by systemd-1:244.5-r0.cortexa7t2hf_neon_vfpv4
Problem 2: package packagegroup-distro-base-1.0-r83.raspberrypi_cm3 requires packagegroup-core-boot, but none of the providers can be installed
- package packagegroup-base-1.0-r83.raspberrypi_cm3 requires packagegroup-distro-base, but none of the providers can be installed
- package packagegroup-core-boot-1.0-r17.raspberrypi_cm3 requires systemd, but none of the providers can be installed
- conflicting requests
- nothing provides update-rc.d needed by systemd-1:244.5-r0.cortexa7t2hf_neon_vfpv4
Problem 3: package packagegroup-base-1.0-r83.raspberrypi_cm3 requires packagegroup-distro-base, but none of the providers can be installed
- package packagegroup-distro-base-1.0-r83.raspberrypi_cm3 requires packagegroup-core-boot, but none of the providers can be installed
- package packagegroup-base-extended-1.0-r83.raspberrypi_cm3 requires packagegroup-base, but none of the providers can be installed
- package packagegroup-core-boot-1.0-r17.raspberrypi_cm3 requires systemd, but none of the providers can be installed
- conflicting requests
- nothing provides update-rc.d needed by systemd-1:244.5-r0.cortexa7t2hf_neon_vfpv4
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
It seems that systemd-1:244.5 depends on update-rc.d. This doesn't make a lot sense to me, since I don't need those scripts anymore when using systemd - maybe there are for some compatibility reasons? Puzzled by this I checked the reference and it seems that I have the right settings to use systemd exclusively:
$ bitbake -e exos-develop | grep "^DISTRO_FEATURES"
DISTRO_FEATURES="acl alsa argp bluetooth ext2 ipv4 ipv6 largefile pcmcia usbgadget usbhost wifi xattr nfs zeroconf pci 3g nfc x11 vfat largefile opengl ptest multiarch wayland vulkan systemd weston wayland sota usrmerge systemd systemd pulseaudio gobject-introspection-data ldconfig"
DISTRO_FEATURES_BACKFILL="pulseaudio sysvinit gobject-introspection-data ldconfig"
DISTRO_FEATURES_BACKFILL_CONSIDERED="sysvinit sysvinit"
DISTRO_FEATURES_DEFAULT="acl alsa argp bluetooth ext2 ipv4 ipv6 largefile pcmcia usbgadget usbhost wifi xattr nfs zeroconf pci 3g nfc x11 vfat"
DISTRO_FEATURES_FILTER_NATIVE="api-documentation"
DISTRO_FEATURES_FILTER_NATIVESDK="api-documentation"
DISTRO_FEATURES_NATIVE="x11 ipv6 xattr sota"
DISTRO_FEATURES_NATIVESDK="x11"
During debugging I also saw that poky's systemd recipe uses the update-rc.d.bbclass. From what I can see it only gets active when the DISTRO_FEATURES contain sysvinit, which is apparently not the case here. Maybe some caching issue?
Any ideas how I can debug this further?
I found it out myself (interesting how asking questions helps you thinking...):
The issue was in the systemd recipe itself and related to the systemd-compat-units recipe. I was able to fix it with this in my layer's recipes-core/systemd/systemd_%.bbappend:
# Disable all relations to update-rc.d:
PACKAGECONFIG_remove = "sysvinit"
RRECOMMENDS_${PN}_remove = "systemd-compat-units"
I'm still wondering how this issue came to be at all, though.
Would be great if somebody could explain why this happened at all.

How to compiled native_pgsql in gammu?

I have configured gammurc and gammu --identify is working. But I received error when I do gammu-smsd -c smsdrc
Here the following error :
gammu-smsd: the native_pgsql driver was not compiled in!
When I run gammu-smsd -v it's tell this :
Compiled in Features :
OS Support :
- ALARM
- WINDOWS_SERVICE
- EVENT_LOG
Backend services :
- NULL
- FILES
- ODBC
I'am using windows and pgsql
how do I fix this problem ? and
How do I compiled native_pgsql ?
thanks
You can use ODBC driver instead. It's only driver which works without additional dependencies on Windows.
To have Gammu built with native PostgreSQL driver on Windows, see our compilation instructions. Gammu will automatically search for the libraries in common locations, but you might end up needing to enter POSTGRES_INCLUDE_DIR and POSTGRES_LIBRARY manually in CMake.

Failed to start Neo4j service

I am using neo4j enterprise 3.0.3 version for windows. Following the operations manual 3.0, I have installed the neo4j service with bin\neo4j install-service. But I can't start it with bin\neo4j start. It said
Invoke-Neo4j : Failed to start service 'Neo4j Graph Database - neo4j (neo4j)'.
And I can't start the neo4j service in windows serice either. Maybe anyone have encountered this case before?
I had the same problem: I am using neo4j community 3.1.2 for windows and installed the service with the neo4j.bat file without any problems.Then i wanted to start the service with neo4j.bat and got the same error as you
I found a solution that worked for me. My neo4j files were in a folder, where the path to the folder contained spaces (C:\Program Files\Neo4j) Then i moved the folder one level up (C:\Neo4j).
After that i could start the service without problems.
Maybe this solution helps.
I am running neo4j on windows and in my case the crux of the issue was that there was an incompatibility between the installed versions of Java (32-bit) v/s OS version. The biggest clue that led me to this is the following set of lines in neo4j-service.2018-08-03 log file
[2018-08-03 14:55:42] [info] [ 1432] Starting service...
[2018-08-03 14:55:42] [error] [ 1432] %1 is not a valid Win32 application.
[2018-08-03 14:55:42] [error] [ 1432] Failed creating java C:\JavaNew\bin\server\jvm.dll
[2018-08-03 14:55:42] [error] [ 1432] %1 is not a valid Win32 application.
[2018-08-03 14:55:42] [error] [ 1432] ServiceStart returned 1
There are a fair number of potential issues, and I have made an attempt to compile all the issues with this,
Windows services cannot deal with service names in folders that have spaces; especially if there is another folder with the same name as the one with spaces.
For example - C:\Program Files... will have issues if C:\Program\Something...
To work around this, I put Neo4j in root folder c:\Neo4j
Get-Java.ps1 (under ..\bin\Neo4j-Management folder)looks in the path variable for 'JAVA_HOME' (usually found in *nix environments). If it does not find it here, it keeps looking in registry, and finally throws up its hand!
To deal with this, I simply put in a path variable. For a good measure, I uninstalled Java and re-installed Java in the root folder under C:\JavaNew
In retrospect, this step is probably not on part of the problem, and hence can be ignored. But I am leaving it here for completeness sake.
Invoke-Neo4j.ps1 (also under ..\bin\Neo4j-Management folder) has code that determines if the OS is 32-bit (or 64-bit). Based on this it determines if it should run prunsrv-i386.exe (32-bit) or prunsrv-amd64.exe (64-bit).
This has to match the Java version installed.
Upon running java -XshowSettings:all, and inspecting the sun.arch.data.model value (32, in my case), I realized that my OS is 64 bit and the Java version is 32-bit.
To deal with this, I put in code (very klugey!). I am sure there are much better ways to get to the same outcome, but this is what I used.
switch ( (Get-WMIObject -Class Win32_Processor | Select-Object -First 1).Addresswidth ) {
32 { $PrunSrvName = 'prunsrv-i386.exe' } # 4 Bytes = 32bit
#64 { $PrunSrvName = 'prunsrv-amd64.exe' } # 8 Bytes = 64bit COMMENTED as a workaround!!!
64 { $PrunSrvName = 'prunsrv-i386.exe' } # 8 Bytes = 64bit
Now, uninstall the neo4j service, install it, and start the service.
Hope this works for you.
neo4j console
Posting for latest versions > 4.x
I had the same issue using neo4j start, Neo4j console is the right command I was looking for. It is a web-based graph that acts as an interactive tutorial.
i had the same problem , after the neo4j worked for few weeks it stoop working (without any change that i made)
i have set java_home uninstall and install and now it works
neo4j-enterprise-3.3.4
I was also having weired issue as there was no error but neo4J service did not start.
[xx#ss1 bin]$ ./neo4j console
[xx#ss1 bin]$ .
The problem was with the permission on Java directory and I tried
chmod -R 777 jdk_directory
and problem got solved.
#neo4j #neo4jnotstarting

How to check if ElasticSearch is running properly

I am new to ElasticSearch and I am facing issues while connecting to ElasticSearch. Please find below details:
hq plugin and head plugin are showing different results:
Output of HQ Plugin:
Output of Head Plugin:
When I try to connect from my scala code, I get following error:
org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: []
at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:305)
at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:200)
at org.elasticsearch.client.transport.support.InternalTransportClient.execute(InternalTransportClient.java:106)
at org.elasticsearch.client.support.AbstractClient.index(AbstractClient.java:102)
at org.elasticsearch.client.transport.TransportClient.index(TransportClient.java:340)
at com.sksamuel.elastic4s.IndexDsl$IndexDefinitionExecutable$$anonfun$apply$1.apply(IndexDsl.scala:23)
at com.sksamuel.elastic4s.IndexDsl$IndexDefinitionExecutable$$anonfun$apply$1.apply(IndexDsl.scala:23)
at com.sksamuel.elastic4s.Executable$class.injectFuture(Executable.scala:21)
at com.sksamuel.elastic4s.IndexDsl$IndexDefinitionExecutable$.injectFuture(IndexDsl.scala:20)
at com.sksamuel.elastic4s.IndexDsl$IndexDefinitionExecutable$.apply(IndexDsl.scala:23)
at com.sksamuel.elastic4s.IndexDsl$IndexDefinitionExecutable$.apply(IndexDsl.scala:20)
at com.sksamuel.elastic4s.ElasticClient.execute(ElasticClient.scala:28)
Here is my Code which I use for connection:
val settings = ImmutableSettings.settingsBuilder()
.put("cluster.name", "elasticsearch")
.build()
val client = ElasticClient.remote(settings, ElasticsearchClientUri("elasticsearch://10.50.xxx.xxx:9300"))
I also checked my connection and I am able to successfully telnet 10.50.xxx.xxx on both 9200 and 9300 ports
I read somewhere that the problem might be with http.cors, So I added following lines to /etc/elasticsearch/elasticsearch.yml file on the server:
http.cors.allow-origin: "/.*/"
http.cors.enabled: true
Please suggest what am I doing wrong ?
-- Update --
Thanks # Evaldas Buinauskas, It was version problem, I had installed elastic version 2.0 and was using libraries and plugins of version 1.7. I downgraded my elastic to version 1.7 and everything worked!
The issue comes from different Elasticsearch, head plugin and Scala client versions.
In pre 2.0 Elasticsearch still supported deprecated _status endpoint (deprecated in 1.2.0)
Version 2.0 completely dropped it and replaced it with _recovery.
Both head and Scala weren't upgraded and tried to call dropped api.