Closed mrkent closed 5 years ago
but not on the ec2 after an npm install
Could you share the output of npm install
?
I reorganized my package.json and reinstalled and problem fixed itself. Thanks @vweevers.
I'm still unclear on how the this package knows where to find rocksdb after I built using make static_lib
. Feel free to close this.
I reorganized my package.json and reinstalled and problem fixed itself.
👍
I'm still unclear on how the this package knows where to find rocksdb after I built using make static_lib
Building manually is not necessary; the npm package has an install script that either downloads a prebuilt binary or compiles it, depending on the platform.
@vweevers is it installed in production or debug mode?
Not sure what you mean.
According to the fb repo:
Important: If you plan to run RocksDB in production, don't compile using default make or make all. That will compile RocksDB in debug mode, which is much slower than release mode.
I would guess release mode, cc-ing @ralphtheninja @filoozom to confirm.
We're not using make
to build it, it's node-gyp
.
@ralphtheninja I noticed in the makefile that RocksDB, besides the traditional debug and release mode, has a DEBUG_LEVEL
that affects compiler flags: Makefile#L30.
In our builds, do we end up calling the compiler with the same flags?
Here's an excerpt from npm i --verbose
when building rocksdb
:
g++ '-DNODE_GYP_MODULE_NAME=leveldb' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1'
'-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64'
'-DSNAPPY=1' '-DROCKSDB_PLATFORM_POSIX=1' '-DOS_LINUX=1' '-DROCKSDB_LIB_IO_POSIX=1'
-I/home/lms/.node-gyp/11.3.0/include/node -I/home/lms/.node-gyp/11.3.0/src -I/home/lms/.node-gyp/11.3.0/deps/openssl/config -I/home/lms/.node-gyp/11.3.0/deps/openssl/openssl/include -I/home/lms/.node-gyp/11.3.0/deps/uv/include -I/home/lms/.node-gyp/11.3.0/deps/zlib -I/home/lms/.node-gyp/11.3.0/deps/v8/include -I../deps/leveldb/leveldb-rocksdb -I../deps/leveldb/leveldb-rocksdb/include -I../deps/snappy/linux -I../deps/snappy/snappy-1.1.7 -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -std=c++0x -Wno-sign-compare -Wno-unused-but-set-variable -O3 -fno-omit-frame-pointer -std=gnu++1y -MMD -MF ./Release/.deps/Release/obj.target/leveldb/deps/leveldb/leveldb-rocksdb/db/auto_roll_logger.o.d.raw -c -o Release/obj.target/leveldb/deps/leveldb/leveldb-rocksdb/db/auto_roll_logger.o ../deps/leveldb/leveldb-rocksdb/db/auto_roll_logger.cc
So it seems we're not setting D_DEBUG_LEVEL
to anything, which means it defaults to 1.
I'm trying to put my code on an AWS ubuntu ec2 instance. Built rocksdb via
make static_lib
in~/rocksdb
.When I try to start my express server, I get the following error. I'm not sure how to hook rocks up properly. Also, why is
leveldown.node
available in node_modules on my localmachine, but not on the ec2 after an npm install?