UBUNTU14.04 Install root cluster configuration

Source: Internet
Author: User
Tags join mkdir zip ssh ssh config


Previous attempts to deploy the root cluster on CentOS7 found that both the source package installation and the official binary package lacked critical xproofd executables, causing the pod to run. There's no way to try to deploy on the other OS, I chose Ubuntu14.04.

Deployment Readiness
Modify APT Source
Modify/etc/apt/sources.list, replace the domestic 163 source, download will be faster and more stable.

# vim/etc/apt/sources.list
Deb http://mirrors.163.com/ubuntu/precise main restricted universe multiverse
Deb Http://mirrors.163.com/ubuntu/precise-security main restricted universe Multiverse
Deb Http://mirrors.163.com /ubuntu/precise-updates main restricted universe Multiverse
Deb http://mirrors.163.com/ubuntu/precise-proposed Main restricted universe Multiverse
Deb Http://mirrors.163.com/ubuntu/precise-backports main restricted universe Multiverse
Deb-src http://mirrors.163.com/ubuntu/precise main restricted universe Multiverse
Deb-src http:// Mirrors.163.com/ubuntu/precise-security main restricted universe multiverse
Deb-src http://mirrors.163.com/ Ubuntu/precise-updates main restricted universe multiverse
Deb-src http://mirrors.163.com/ubuntu/ precise-proposed main restricted universe Multiverse
Deb-src Http://mirrors.163.com/ubuntu/precise-backports Main Restricted Universe Multiverse
then call apt-get Update Update index.

Install gcc,g++
If the system has GCC and g++ installed, you can skip this step.

# apt-get Install GCC
# Apt-get Install g++
Install CMake
CMake installed directly through the Apt-get will have problems installing the root component, so it is recommended that the source code be installed here, I use the version 2.8.8. Website Download Address: https://cmake.org/files/, you can choose their own version of the appropriate.

-Decompression: Tar xvf cmake-2.8.8.tar.gz
-Into the Decompression directory: CD cmake-2.8.8
-/bootstrap
-Make
-Make Install
Installing the Zlib Library
GitHub (https://github.com/madler/zlib) can download the corresponding zlib library, I use the 1.2.3 version, download the address is: Https://github.com/madler/zlib/archive/v1.2.3.zip
-Decompression: Unzip Zlib-1.2.3.zip
-Into the Decompression directory: CD zlib-1.2.3
-/configure
Note: Before make, you need to modify the makefile, otherwise there will be an error calling the library. Find Cflags=-o3-duse_mmap this line, add-fpic in the back, that becomes cflags=-o3-duse_mmap-fpic
-Make
-Make Install

Other libraries
Apt-get Install Procmail

Deploy root cluster
Install root
Binary installation: https://root.cern.ch/content/release-60606. Select the corresponding OS system compilation package. Unzip and move it to the/OPT directory:

# tar ZXVF root_v6.06.06.linux-ubuntu14-x86_64-gcc4.8.tar.gz
# MV Root/opt
The root-related configuration is then written to the initialization file, where the following statement is added at the end of/etc/profile.d/root.sh:

Export Rootsys=/opt/root
Export path= $PATH: $ROOTSYS/bin
SOURCE $ROOTSYS/bin/thisroot.sh
Source/etc/profile.d/root.sh lets the configuration take effect. Run the command root-b test root to see if it works:

#root-B
Root:error while loading shared libraries:libxpm.so.4:cannot open Shared object file:no such file or directory
Missing LIBXPM Library, running apt-get install LIBXPM4 command installation. Installation may be prompted by the lack of installation package, which is related to the local source index, you need to first sync to the remote source (run the apt-get Update command), and then install the XPM package. The installation was successful.

# Apt-get Install LIBXPM4
Reading Package Lists ... Done
Building Dependency Tree
Reading state information ... Done
The following NEW packages would be installed:
Libxpm4
0 upgraded, 1 newly installed, 0 to remove and 5 not upgraded.
Need to get 37.0 KB of archives.
......
Run the Root-b command again to test the error again.

# Root-b
ERROR in Cling::cifactory::createci (): Cannot extract standard library include paths!
Invoking:
echo | Lc_all=c C + +-pipe-m64-wall-w-woverloaded-virtual-fsigned-char-fpic-pthread-std=c++11-wno-deprecated-declaration S-wno-comment-wno-unused-parameter-wno-maybe-uninitialized-wno-unused-but-set-variable- Wno-missing-field-initializers-fpic-fvisibility-inlines-hidden-std=c++11-ffunction-sections-fdata-sections- Fno-common-woverloaded-virtual-wcast-qual-fno-strict-aliasing-pedantic-wno-long-long-wall-w- Wno-unused-parameter-wwrite-strings-wno-unused-local-typedefs-o2-dndebug-xc++-e-v-2>&1 >/dev/null | awk '/^ #include </,/^end of Search/{if (!/^ #include </&&!/^end of search/) {print}} ' | Grep-e "(c|g) \+\+"
Results in
Results in
With exit code 256
Input_line_1:1:10:fatal error: ' New ' File not found
#include <new>
Lack of C + + new package, this error is most likely not installed C + +, because root and other components are written in C + +. Therefore, you need to install GCC and gcc-c++.

# apt-get Install GCC
......
# Apt-get Install g++
......
Run Root-b command, finally succeeded, no error.

Install XROOTD
There are two ways to install XROOTD, either through the script installation in the root source package or by downloading the source code directly from the official website.

Install XROOTD through the script in the root source package
Enter the root source package directory and execute the following statement:

./build/unix/installxrootd.sh-v 3.0.0/opt
Source Code Installation XROOTD:
After decompression and access to the source directory:

# mkdir build; CD Build
# CMAKE/ROOT/XROOTD-3.3.0-DCMAKE_INSTALL_PREFIX=/OPT/XROOTD
# make
# make Install
If it is completely successful, you can write the initialization file with the related configuration, and you can continue to join the end of the/etc/profile.d/root.sh:

SOURCE $ROOTSYS/bin/setxrd.sh/opt/xrootd/
Install pod
The official website (http://pod.gsi.de) downloads the source code, here downloads uses is 3.16 version the source code: pod.gsi.de/releases/pod/3.16/pod-3.16-source.tar.gz. If the connection fails, you can find it yourself. Unpack the source code after the package, and enter the source directory:

CMake command
mkdir Build
CD Build
Cmake-c.. /buildsetup.cmake..
When running CMake, you are prompted for a missing boost library, where you need to install the boost library.

Apt-get Install Libboost-dev
After installation, continue to run the above CMake command, or an error, prompted the following library missing:

The following Boost libraries could is found:

Boost_thread
Boost_program_options
Boost_filesystem
Boost_system
Boost_unit_test_framework
There is a small tips: These libraries directly using the Apt-get install + library name is not successful, because the installation package and this name does not exactly match, here you can use the Apt-cache search method to find the installation package name reinstall, to Boost_thread for example.

# Apt-cache Search Boost | grep thread
Libboost-thread-dev-portable C + + multi-threading (default version)
Libboost-thread1.46-dev-portable C + + multi-threading
Libboost-thread1.46.1-portable C + + multi-threading
Libboost-thread1.48-dev-portable C + + multi-threading
Libboost-thread1.48.0-portable C + + multi-threading
Based on this hint, I can directly install Apt-get install Libboost-thread-dev. Following:

Apt-get Install Libboost-thread-dev
Apt-get Install Libboost-program-options-dev
Apt-get Install Libboost-filesystem-dev
Apt-get Install Libboost-system-dev
Apt-get Install Libboost-test-dev
And then run CMAKE-C. /buildsetup.cmake.. command, and finally succeeded.

Make command
Run make command with an error.

/usr/include/boost/thread/xtime.hpp:23:5: error:expected identifier before numeric constant
Time_utc=1
This is an intrinsic bug below the boost1.5 version, and the variable name repeats. It is very simple to modify, open/usr/include/boost/thread/xtime.hpp, 23 rows and 71 lines of TIME_UTC are modified to TIME_UTC_ can, that is, to ensure that no renaming.
Run the make command again, prompting the error again.

/root/pod-3.16-source/app/misccommon/proof_status_file/proofstatusfile.h:88:13:error: ' uint16_t ' does not name a Type
uint16_t Xpdport () const
It seems that the compiler does not recognize uint16_t this alias, the modification is very simple, the header file contains. Add #include <stdint.h> to the 19th line in/root/pod-3.16-source/app/misccommon/proof_status_file/proofstatusfile.h. The location of the specific insertion may vary depending on the pod code version, but people with C or C + + base should be able to find the right location easily.
Run the make command again, and finally pass it perfectly.

Make Install command
The command runs without any errors. If no configuration is specified, POD will be installed in the user directory's pod directory, if I install as root user, install in the/root/pod directory.

Pod Installation last step
The related configuration is written to the initialization file, where you can continue to join the end of the/etc/profile.d/root.sh:

source/root/pod/3.16/pod_env.sh
Source/etc/profile.d/root.sh lets the configuration take effect. Run Pod-server start, and if this is the first run, download the related component Wn_bins directory to/root/pod/3.16/bin/. If the server does not have access to the extranet, you can use the virtual machine to build all of the above steps and download the Wn_bins directory. No matter what OS, the downloaded Wn_bins directory is the same and can be copied directly.

Make up the root cluster
After you run Pod-server start, when you download the Wn_bins directory, the following results occur if no errors occur:

# Pod-server Start
Starting PoD Server ...
Updating XPROOFD configuration file ...
Starting XPROOFD ...
Starting PoD agent ...
Preparing PoD Worker Package ...
Selecting pre-compiled bins to is added to worker package ...
PoD worker Package:/root/. pod/wrk/podworker.sh
------------------------
XPROOFD [1809] port:21001
PoD Agent [1848] port:22002
PROOF Connection string:root@mac00000102030a.hostname.com:21001
Using all of the above methods, build two server environments to build a small cluster with one server and one client. There are multiple modes of communication between root servers, and here we use the simplest direct SSH approach. First of all, the two servers need to establish the SSH login trust, so as to achieve SSH login password-free. Construction method can be seen: http://chenlb.iteye.com/blog/211809.
After that, select Server A as servers and Server B as client (worker). On the server, edit the/root/pod_ssh.cfg file, which reads as follows:

@bash_begin @
. /etc/profile.d/root.sh
@bash_end @

R1, Root@109.105.115.249,,/tmp/test, 2
The first three lines are SSH to client, need to execute the script file, here is the client on the implementation of the root system parameter configuration, set environment variables. Line Five is the configuration that accesses the client, and each client corresponds to a row, because we have only one client here, so we have one line. The format of this line is:

1 2 3 4 5
Client Unique identifier, cannot duplicate username @ip or hostname ssh parameter, can be the number of client-side workers expected for null client-side working directory, can be null

Then, execute pod-ssh-c/root/pod_ssh.cfg submit--debug on the server side to build the cluster. Shown below, the server side is successful:

# pod-ssh-c/root/pod_ssh.cfg Submit--debug
* * [Mon, Aug 2016 10:40:18 +0800] preparing PoD worker Package ...
* * [Mon, Aug 2016 10:40:18 +0800] Selecting pre-compiled to is bins to worker added ...
* * [Mon, Aug 2016 10:40:18 +0800] PoD worker package:/root/. pod/wrk/podworker.sh
* * [Mon, Aug 2016 10:40:18 +0800] pod-ssh config contains an inline shell script. It is injected it into wrk. Package
* * [Mon, Aug 2016 10:40:18 +0800] preparing PoD worker Package ...
* * [Mon, Aug 2016 10:40:18 +0800] Inline shell script is found and would be added to the package ...
* * [Mon, Aug 2016 10:40:18 +0800] Selecting pre-compiled to is bins to worker added ...
* * [Mon, Aug 2016 10:40:18 +0800] PoD worker package:/root/. pod/wrk/podworker.sh
* * [Mon, Aug 2016 10:40:18 +0800] There are 5 threads in the Tread-pool.
* * [Mon, Aug 2016 10:40:18 +0800] number of PoD workers:1
* * [Mon, Aug 2016 10:40:18 +0800] number of PROOF Workers:2
* * [Mon, Aug 2016 10:40:18 +0800] workers list:
* * [Mon, Aug 2016 10:40:18 +0800] [R1] with 2 workers at ROOT@109.105.115.249:/TMP/TEST/R1
R1 [Mon Aug 2016 10:40:18 +0800] Pod-ssh-submit-worker is started for root@109.105.115.249 (dir:/tmp/test/r1, Nwor Kers:2, sshopt:)
* * [Mon, Aug 2016 10:40:19 +0800]
*******************
Successfully processed TASKS:1
Failed tasks:0
*******************
We then login to the client side and enter the client-side working directory working directory set in/root/pod_ssh.cfg.

# ls
Libboost_filesystem-mt.so.5 libpod_protocol.so pod.cfg podworker.sh PR oof.conf user_worker_env.sh Xpd.log
Libboost_program_options-mt.so.5 libproof_status_file.so Pod-user-defaults pod-wrk-bin-3.16-darwin-universal.tar.gz server_info.cfg Version
Libboost_system-mt.so.5 libsshtunnel.so Podworker.lock pod-wrk-bin-3.16-linux-amd64.tar.gz SS H-tunnel XPD.CF
Libboost_thread-mt.so.5 pod-agent podworker.pid pod-wrk-bin-3.16-linux-x86.tar.gz SS H_worker.log Xpd.cf.bup
Visible, are some libraries, configuration files and logs. Our primary focus is on the log file Ssh_worker.log, which appears at the end of the log as complete success:

***     [Mon Aug 2016 10:44:48 +0800]       Attempt to start Pod-agent (1 out of 3)
***     [Mon) Aug 2016 10:44:48 +0800]&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NB Sp Attempt to start and detect XPROOFD (1 out of)
***     [Mon, MB Aug 2016 10:44:48-+0800] & nbsp;     trying to use xproof port:21002
***     [Mon, Aug 2016 10:44:48 +0800]       starting XPROOFD ...
***     [Mon Aug 2016 10:44:48 +0800]       XPROOFD is Running. PID=[2794] port=[21002]
***     [Mon, Aug 2016, 10:44:48 +0800]        starting pod-agent ...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.