Skip to content

Instantly share code, notes, and snippets.

@beheerderdag
Last active July 19, 2018 07:23
Show Gist options
  • Save beheerderdag/d73ff107d52762a04ce03dfad4360bb5 to your computer and use it in GitHub Desktop.
Save beheerderdag/d73ff107d52762a04ce03dfad4360bb5 to your computer and use it in GitHub Desktop.
irods-cockroachdb install
Environment
[root@145 ~]# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
install cockroach db
wget -qO- https://binaries.cockroachdb.com/cockroach-v2.0.4.linux-amd64.tgz | tar xvz
cp -i cockroach-v2.0.4.linux-amd64/cockroach /usr/local/bin
Add the renci repo
#rpm --import https://packages.irods.org/irods-signing-key.asc
# wget -qO - https://packages.irods.org/renci-irods.yum.repo | tee /etc/yum.repos.d/renci-irods.yum.repo
# yum install irods-server
# yum install irods-devel
# yum groupinstall development tools
# yum install irods-externals*
# yum install git
# yum install ninja-build
yum install openss-devel
ln -s /usr/lib64/libboost_system.so /lib/libboost_system.so
ln -s /usr/lib64/libboost_regex.so /lib/libboost_regex.so
We need cmake 3.5 or higher
we can use the one from irods-externals
export PATH=/opt/irods-externals/cmake3.5.2-0/bin/:$PATH
Run cmake:
[root@145 build]# cmake .. -GNinja
First error:
CMake Error at CMakeLists.txt:3 (find_package):
Could not find a configuration file for package "IRODS" that exactly
matches requested version "4.3.0".
The following configuration files were considered but not accepted:
/lib/irods/cmake/IRODSConfig.cmake, version: 4.2.3
/usr/lib/irods/cmake/IRODSConfig.cmake, version: 4.2.3
change it to 4.2.3.
yum remove boost
Clean start
[root@145 build]# ninja-build package
[1/2] Run CPack packaging tool...
CPack: Create package using RPM
CPack: Install projects
CPack: - Install project: irods-api-plugin-bulkreg-common
CPack: Create package
CMake Warning (dev) at /opt/irods-externals/cmake3.5.2-0/share/cmake-3.5/Modules/CPackRPM.cmake:667 (list):
Policy CMP0007 is not set: list command no longer ignores empty elements.
Run "cmake --help-policy CMP0007" for policy details. Use the cmake_policy
command to set the policy and suppress this warning. List has value = [
;].
Call Stack (most recent call first):
/opt/irods-externals/cmake3.5.2-0/share/cmake-3.5/Modules/CPackRPM.cmake:1505 (cpack_rpm_prepare_content_list)
/opt/irods-externals/cmake3.5.2-0/share/cmake-3.5/Modules/CPackRPM.cmake:1787 (cpack_rpm_generate_package)
This warning is for project developers. Use -Wno-dev to suppress it.
CPackRPM: Will use GENERATED spec file: /root/irods_api_bulkreg_common/build/_CPack_Packages/Linux/RPM/SPECS/irods-api-plugin-bulkreg-common.spec
CPack: - package: /root/irods_api_bulkreg_common/build/irods-api-plugin-bulkreg-common-4.2.3-1.x86_64.rpm generated.
sql.h missing
[2/11] Building CXX object CMakeFiles/cockroachdb.dir/src/db_plugin.cpp.o
FAILED: CMakeFiles/cockroachdb.dir/src/db_plugin.cpp.o
/opt/irods-externals/clang3.8-0/bin/clang++ -DBOOST_SYSTEM_NO_DEPRECATED -DENABLE_RE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D_LARGE_FILES -Dcockroachdb_EXPORTS -Dlinux_platform -I/opt/irods-externals/clang3.8-0/include/c++/v1 -I/usr/include/irods -I/usr/include/postgresql -I../include -I/opt/irods-externals/boost1.60.0-0/include -I/opt/irods-externals/jansson2.7-0/include -I/opt/irods-externals/avro1.7.7-0/include -O3 -DNDEBUG -fPIC -nostdinc++ -std=c++14 -Wno-write-strings -std=gnu++14 -MMD -MT CMakeFiles/cockroachdb.dir/src/db_plugin.cpp.o -MF CMakeFiles/cockroachdb.dir/src/db_plugin.cpp.o.d -o CMakeFiles/cockroachdb.dir/src/db_plugin.cpp.o -c ../src/db_plugin.cpp
In file included from ../src/db_plugin.cpp:10:
In file included from ../include/mid_level.hpp:14:
In file included from ../include/low_level.hpp:7:
../include/low_level_libpq.hpp:11:10: fatal error: 'sql.h' file not found
#include "sql.h"
^
1 error generated.
yum install unixODBC unixODBC-devel
then
1 error generated.
[2/11] Building CXX object CMakeFiles/cockroachdb.dir/src/db_plugin.cpp.o
FAILED: CMakeFiles/cockroachdb.dir/src/db_plugin.cpp.o
/opt/irods-externals/clang3.8-0/bin/clang++ -DBOOST_SYSTEM_NO_DEPRECATED -DENABLE_RE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D_LARGE_FILES -Dcockroachdb_EXPORTS -Dlinux_platform -I/opt/irods-externals/clang3.8-0/include/c++/v1 -I/usr/include/irods -I/usr/include/postgresql -I../include -I/opt/irods-externals/boost1.60.0-0/include -I/opt/irods-externals/jansson2.7-0/include -I/opt/irods-externals/avro1.7.7-0/include -O3 -DNDEBUG -fPIC -nostdinc++ -std=c++14 -Wno-write-strings -std=gnu++14 -MMD -MT CMakeFiles/cockroachdb.dir/src/db_plugin.cpp.o -MF CMakeFiles/cockroachdb.dir/src/db_plugin.cpp.o.d -o CMakeFiles/cockroachdb.dir/src/db_plugin.cpp.o -c ../src/db_plugin.cpp
In file included from ../src/db_plugin.cpp:10:
In file included from ../include/mid_level.hpp:14:
In file included from ../include/low_level.hpp:7:
../include/low_level_libpq.hpp:21:10: fatal error: 'libpq-fe.h' file not found
#include <libpq-fe.h>
yum install postgresql postgresql-devel
[root@145 build]# rpm -ivh irods-database-plugin-cockroachdb-4.2.3-1.x86_64.rpm
Preparing... ################################# [100%]
Updating / installing...
1:irods-database-plugin-cockroachdb################################# [100%]
=======================================================================
iRODS Postgres Database Plugin installation was successful.
To configure this plugin, the following prerequisites need to be met:
- an existing database user (to be used by the iRODS server)
- an existing database (to be used as the iCAT catalog)
- permissions for existing user on existing database
Then run the following setup script:
sudo python /var/lib/irods/scripts/setup_irods.py
=======================================================================
cockroach secure start
mkdir certs
1054 mkdir my-safe-directory
1055 cockroach cert create-ca --certs-dir=certs --ca-key=my-safe-directory/ca.key
1056 cockroach cert create-client root --certs-dir=certs --ca-key=my-safe-directory/ca.key
1057 cockroach cert create-node localhost $(hostname) --certs-dir=certs --ca-key=my-safe-directory/ca.key
1058 cockroach start --certs-dir=certs --host=localhost --http-host=localhost
create database icat;
create user irods with password 'irods'
grant all on database icat to irods;
cockroach sql --certs-dir=certs --user=irods
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/your/custom/path/
IrodsError: pypyodbc registered a 'file not found' error when connecting to the database. If your driver path exists, this is most commonly caused by a library required by the driver being unable to be found by the linker. Try running ldd on the odbc driver binary (or sudo ldd if you are running in sudo) to see which libraries are not being found and add any necessary library paths to the LD_LIBRARY_PATH environment variable. If you are running setup_irods.py, instead set the LD_LIBRARY_PATH with the --ld_library_path command line option.
The specific error pypyodbc reported was:
('01000', "[01000] [unixODBC][Driver Manager]Can't open lib '/usr/lib64/psqlodbcw.so' : file not found")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment