Building libssh for HBase workloads

Article: 100042848
Last Published: 2018-04-24
Ratings: 0 0
Product(s): NetBackup & Alta Data Protection

Prerequisites

Install the following software:

On Red Hat Enterprise Linux Server

  • Operating System: Red Hat Enterprise Linux Server release 5.4 (Tikanga)
  • Compiler: gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-46)

On SUSE Linux Enterprise Server

  • Operating System: SUSE Linux Enterprise Server 11 (x86_64)
  • Compiler: gcc (SUSE Linux) 4.3.4 (gcc-4_3-branch revision 152973)

License required

You need to have license for Libssh 0.7.5 (LGPL).

To build libssh

  1.  Install cmake2.8.6 (version must be greater than 2.6.0) at the following customized path:
    /home/user/cmake
    1. Download cmake-2.8.6.tar.gz from the following path:
      https://cmake.org/files/v2.8/ 
    2. Untar and go to directory
    3. Then run the following command to install cmake on the customized path:
      ./bootstrap
      make
      make install

  2. Link the renamed openssl to libssh and build and install openssl-1.0.2n (version must be greater than 0.9.8) at a custom path. For example:
    /home/user/openssl
    1. Download openssl-1.0.2n.tar.gz from the following path:
      https://www.openssl.org/source/old/1.0.2/
    2. Extract files from the downloaded package. Run the following command:
      tar -xvf openssl-1.0.2n.tar.gz
    3. Enter the directory where you extract the package. Run the following command:
      cd openssl-1.0.2n
    4. Configure OpenSSL. Run the following command:
      ./config shared no-ssl2 no-ssl3 no-comp --prefix=/home/user/openssl --openssldir=/home/user/openssl
       Replace /home/user/openssl with the directory path where you want to copy the files (lib and include).
      /home/user/openssl is an example, you can replace it with the the directory you are using.
    5. Compile OpenSSL. Run the following command: 
      make depend
    6. Open the Makefile and set value for the variable SHLIB_MAJOR as nb (Orginally the value would be as per the version.) and SHLIB_MINOR as 0.0
    7. Save the make file and run the following command:
      make all
    8. Run make install.
      This will place all binaries under: /home/user/openssl/lib
      Note: If make install fails, then you need to copy all the binaries manually in the dircetory.
    9. Binaries are created with the changed name libcrypto.so.nb.0.0.
  3. Download the libssh-0.7.5.tar.xz package from the following location: 
    https://red.libssh.org/projects/libssh/files and extract it.

    If the default version for openssl is not openssl-1.0.2n then run the following steps:
    1. Create a build directory inside the libssh-0.7.5 directory and run the following command inside build directory:
    2. /home/user/cmake/bin/cmake -DOPENSSL_ROOT_DIR=/home/user/openssl -DOPENSSL_LIBRARIES=/home/user/openssl/lib -DCMAKE_INSTALL_PREFIX=/usr.
    3. Open the CMakeCache.txt file.  
      Verify if the file is pointing to /home/user/ openssl directory in the include and the lib of openssl. If not, replace the standard path for "libcrypto" with customized "libcrypto" path.
      Search for "libcrypto" variable to replace the /usr/lib64/libcrypto.so instances with /home/user/openssl/lib/libcrypto.so.
      Set the customized path as

      OPENSSL_INCLUDE_DIR:PATH=/home/user/openssl/include
      _OPENSSL_INCLUDEDIR:INTERNAL=/home/user/openssl/include
      FIND_PACKAGE_MESSAGE_DETAILS_OpenSSL:INTERNAL=[/home/user/openssl/lib/libssl.so;/home/user/openssl/lib/libcrypto.so][/home/user/openssl/include][v1.0.2()]
       
    4. Save the file and run the following command:
      make
      All binaries are placed in the src folder as you are already inside the build folder. The binaries are placed in the following directory:
      /home/user/libssh-0.7.5/build/src for libssh.so, libssh.so.4 and libssh.so.4.4.2
      and
      /home/user/libssh-0.7.5/build/src/threads for libssh_threads.so, libssh_threads.so.4 and libssh_threads.so.4.4.2
    5. The libssh binaries are ready.
  4. Download chrpath-0.16.tar.gz from the following link:
    http://www.linuxfromscratch.org/blfs/view/svn/general/chrpath.html
    1. Extract the tar and run the following commands to build chrpath for RHEL:
      ./configure
      make

      The binary is created in the ;/home/user/chrpath/chrpath-0.16 directory.
    2. To change the rpath for libssh use the following command:
      Go to the libssh path /home/user/libssh-0.7.5/build/src and run:
      /home/user/chrpath/chrpath-0.16/chrpath -r "/usr/openv/lib" libssh.so
    3. Go inside the folder threads and run:
      /home/user/chrpath/chrpath-0.16/chrpath -r "/usr/openv/lib" libssh_threads.so

NOTE: The compiler flags and source code for libssh are attached with the technote.

Was this content helpful?