Opensource – TecAdmin https://tecadmin.net How to guide for System Administrator's and Developers Wed, 03 Aug 2022 11:49:11 +0000 en-US hourly 1 https://wordpress.org/?v=6.1.1 How To Install Git on Fedora Linux https://tecadmin.net/install-git-on-fedora/ https://tecadmin.net/install-git-on-fedora/#comments Thu, 10 Feb 2022 10:47:49 +0000 https://tecadmin.net/?p=5609 Git is a free and open-source distributed version control system. It is designed to handle small to very large projects with speed and efficiency. This article will help you to install the latest Git client on Fedora Linux systems. Method 1. Installing Git using DNF The default Fedora repositories also contain the Git packages. But [...]

The post How To Install Git on Fedora Linux appeared first on TecAdmin.

]]>
Git is a free and open-source distributed version control system. It is designed to handle small to very large projects with speed and efficiency.

This article will help you to install the latest Git client on Fedora Linux systems.

Method 1. Installing Git using DNF

The default Fedora repositories also contain the Git packages. But it contains an older version. You can use the following command to install the available git client on the Fedora system.

sudo dnf install git 

Method 2. Installing Latest Git from Source

  1. Firstly we need to make sure that we have installed the required packages on your system. Use the following command to install all the required packages for source code compilation.
    sudo dnf install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker 
    
  2. Now remove any prior installation of Git through RPM file or Yum package manager. If your older version is also compiled through source, then skip this step.
    yum remove git 
    
  3. Download git source code from kernel git or simply use following command to download Git 2.0.5.
    cd /usr/src 
    wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.36.1.tar.gz 
    tar xzf git-2.36.1.tar.gz 
    
  4. After downloading and extracting the Git source code, Use the following command to compile the source code.
    cd git-2.36.1 
    sudo make prefix=/usr/local/git all 
    sudo make prefix=/usr/local/git install 
    
  5. Now, configure the PATH environment variable.
    echo "PATH=$PATH:/usr/local/git/bin" | sudo tee -a /etc/environment 
    source /etc/environment 
    
  6. Once completing the above steps, you have successfully installed Git in your system. Let’s use the following command to check the git version
    git --version 
    
    git version 2.36.1
    

Conclusion

This tutorial helped you to install the latest Git client on the Fedora Linux system.

The post How To Install Git on Fedora Linux appeared first on TecAdmin.

]]>
https://tecadmin.net/install-git-on-fedora/feed/ 15
How to Install OpenCV on Ubuntu 20.04 https://tecadmin.net/how-to-install-opencv-on-ubuntu-20-04/ https://tecadmin.net/how-to-install-opencv-on-ubuntu-20-04/#comments Fri, 17 Sep 2021 16:25:01 +0000 https://tecadmin.net/?p=27782 A developer is working on computer vision and he needs some 3D modeling algorithms but he does not have much time so what can he do? He can go to OpenCV, and can have the required algorithm from there. So what is OpenCV? OpenCV is a platform having a huge number of algorithms. It was [...]

The post How to Install OpenCV on Ubuntu 20.04 appeared first on TecAdmin.

]]>
A developer is working on computer vision and he needs some 3D modeling algorithms but he does not have much time so what can he do? He can go to OpenCV, and can have the required algorithm from there. So what is OpenCV? OpenCV is a platform having a huge number of algorithms. It was initially introduced as a research project by Intel in 2006 but today it is the largest platform having 2500+ algorithms and a huge number of interfaces which can be utilized in different languages such as Python, Java etc. moreover, it is an open-source which means anyone can access it free of cost. It contains a variety of algorithms related to 3D modeling, real time functions, support vector machines (SVM) and many more.

Steps involved in installing OpenCV in Ubuntu are discussed in this article

How to install OpenCV on Ubuntu 20.04

OpenCV is among the best platforms which provides ease to developers in their work. The latest version which is being used nowadays is 4.5.3 released on 17th of July, 2021. It is in C++ but it can be used in other languages with the help of bindings.

Here we will discuss about two methods to install OpenCV in Ubuntu either from its own repository or by downloading it from source.

Method 1: Install OpenCV from Default Repository

We can install OpenCV from its own repository and the steps involved in it are discussed.

Step 1: First we will update the repository:

sudo apt update 

Step 2: We will install the OpenCV library and python library from the repository by using a single command:

sudo apt install python3-opencv libopencv-dev  

Step 3: Installation is verified by checking the version of OpenCV by using the “cv2 module”:

python3 -c "import cv2; print(cv2.__version__)" 
Output
4.5.3-dev

In the output it will display the version of the OpenCV.

Method 2: Install OpenCV using Source Code

We can install OpenCV from its original source as well. For this purpose, we have to follow the following steps.

Step 1: First we install the files which are necessary for the installation of the OpenCV and for this purpose we install the build tool:

sudo apt install build-essential cmake git pkg-config libpng-dev libtiff-dev gfortran openexr libgtk-3-dev libavcodec-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev libavformat-dev libswscale-dev libv4l-dev libxvidcore-dev libx264-dev libjpeg-dev libatlas-base-dev python3-dev python3-numpy libtbb2 libtbb-dev libdc1394-22-dev libopenexr-dev 

Step 2: Now first make the directory using “mkdir” and then clone the OpenCV and OpenCV contribution repository.Clone both of them from the website of github.com:

mkdir ~/opencv_build && cd ~/opencv_build 
git clone https://github.com/opencv/opencv.git 
git clone https://github.com/opencv/opencv_contrib.git 

Step 3: We will navigate the file and make a directory there using “mkdir”:

cd ~/opencv_build/opencv 
mkdir -p build && cd build 

Now we will configure and setup the OpenCV build by using “make”:

cmake -D CMAKE_BUILD_TYPE=RELEASE \ 
        -D CMAKE_INSTALL_PREFIX=/usr/local \
        -D INSTALL_PYTHON_EXAMPLES=ON \
        -D BUILD_EXAMPLES=ON \
        -D OPENCV_GENERATE_PKGCONFIG=ON \
        -D OPENCV_EXTRA_MODULES_PATH=~/opencv_build/opencv_contrib/modules \
        -D INSTALL_C_EXAMPLES=ON  .. 

Step 4: Now we should know the number of cores of processor, we can find them out by:

nproc 
Output
1

In my case it has one core. So now, we start the compilation process by using make command but we will enter the number of cores of the processor with “j” for example in my case I have one core so I’ll write “j1”, likewise if you have 8 cores of processor you can write j8.

make -j1 

It will take some time to compile.
Step 5: Start the installation setup:

sudo make install 

To verify the installation of OpenCV we will check the versions of C++ and Python bindings.

pkg-config --modversion opencv4 
Output
4.5.3

Similarly, check the version of OpenVC python library.

python3 -c "import cv2; print(cv2.__version__)" 
Output
4.5.3-dev

To Conclude

Instead of spending a lot of time developing code for algorithms, developers use the algorithm from the OpenCV library. It not only provides ease in their job but also saves a lot of time. In this article, we have discussed different methods to install OpenCV either from its repository or from the original source. To download it from its own repository is a little bit fast but from the original source is more reliable as it can access all the latest versions of libraries.

The post How to Install OpenCV on Ubuntu 20.04 appeared first on TecAdmin.

]]>
https://tecadmin.net/how-to-install-opencv-on-ubuntu-20-04/feed/ 2
How to Install Mattermost with MySQL on Ubuntu 14.04 & Debian 8 https://tecadmin.net/install-mattermost-mysql-ubuntu-debian/ https://tecadmin.net/install-mattermost-mysql-ubuntu-debian/#comments Fri, 29 Apr 2016 03:38:22 +0000 https://tecadmin.net/?p=10284 Install Mattermost with MySQL on Ubuntu 14.04 & Debian 8. Mattermost is a best alternative of Slack messaging application. It provides you option for all communications at one place with easy to use interface. You can easily share messages, files over desktops and mobile devices. Step 1 – Setup MySQL Database Server First you need [...]

The post How to Install Mattermost with MySQL on Ubuntu 14.04 & Debian 8 appeared first on TecAdmin.

]]>
Install Mattermost with MySQL on Ubuntu 14.04 & Debian 8. Mattermost is a best alternative of Slack messaging application. It provides you option for all communications at one place with easy to use interface. You can easily share messages, files over desktops and mobile devices.

Step 1 – Setup MySQL Database Server

First you need to install MySQL database server on your system. Use following command to install default available version of mysql or read this tutorial.

$ sudo apt-get install mysql-server

Now create a database for mattermost installation and a mysql user for authentication.

$ mysql -u root -p

mysql> CREATE DATABASE mattermost;
mysql> GRANT ALL on mattermost.* to mmuser@localhost IDENTIFIED BY 'password';
mysql> FLUSH PRIVILEGES;

Step 2 – Download Mattermost Archive

Now you can use root account or a separate account for your mattermost installation. Use below commands to create separate account.

$ sudo adduser mmuser
$ sudo passwd mmuser

Now switch to newly created account and download the mattermost compiled edition using below command. To find latest version visit here. Also extract the downloaded archive file.

$ sudo su - mmuser
$ wget https://releases.mattermost.com/2.2.0/mattermost-team-2.2.0-linux-amd64.tar.gz
$ tar xzf mattermost-team-2.2.0-linux-amd64.tar.gz

Step 3 – Configure Mattermost

Now edit mattermost configuration file config/config.json and update below details under SqlSettings section. Update DataSource values as per created records in step 1.

  "DriverName": "mysql",
  "DataSource": "mmuser:password@tcp(localhost:3306)/mattermost?charset=utf8mb4,utf8",

Now create data directory for mattermost installation. This is the location where mattermost keeps data of teams like uploaded files etc.

$ mkdir ~/mattermost/data

Step 4 – Start Mattermost Server

You mattermost setup has been completed. Now use following commands to start mattermost service.

$ cd ~/mattermost/bin
$ ./platform

Default mattermost runs on port 8065, which can be changed in config/config.json file. Access your server on port 8065 (or customized port) through web browser.

 http://svr1.tecadmin.net:8065/

Now you may need to create your first team in mattermost. To create team enter email address for team administrator account and click Create Team.

Install Mattermost with MySQL - 1

Make sure administrator email is correct and click “Yes, this address is correct”.

Install Mattermost with MySQL - 2

Now enter name of you team in box and click Next.

Install Mattermost with MySQL - -3

You can customized your team url here. Input required team url and click Next.

Install Mattermost with MySQL - 4

Now choose a username for your administrator account and click Next.

Install Mattermost with MySQL - 5

Enter a secured password for you administrator account and click Finish.

Install Mattermost with MySQL - 6

You team has been successfully created and you will be redirected to you account.

Install Mattermost with MySQL - 7

Step 5 – Setup Mattermost with Upstart

Now create a mattermost startup script for Upstart daemon. Edit /etc/init/mattermost.conf file in text editor and add following content.

start on runlevel [2345]
stop on runlevel [016]
respawn
chdir /home/mmuser/mattermost
setuid mmuser
exec bin/platform

Now you can use following commands to start and stop mattermost .

$ sudo start mattermost
$ sudo stop mattermost

The post How to Install Mattermost with MySQL on Ubuntu 14.04 & Debian 8 appeared first on TecAdmin.

]]>
https://tecadmin.net/install-mattermost-mysql-ubuntu-debian/feed/ 2
How to Install Wine 7.x on CentOS, RHEL and Fedora https://tecadmin.net/steps-install-wine-centos-rhel-fedora-systems/ https://tecadmin.net/steps-install-wine-centos-rhel-fedora-systems/#comments Sun, 10 Apr 2016 20:29:34 +0000 https://tecadmin.net/?p=2609 Why use Wine: With the increasing popularity of Linux desktops, There is another requirement occurred that we should have an application that can be used to run Windows applications. Windows has a long list of beautiful applications for users which are not available to Linux users. As we know that Linux does not support windows [...]

The post How to Install Wine 7.x on CentOS, RHEL and Fedora appeared first on TecAdmin.

]]>
Why use Wine:

With the increasing popularity of Linux desktops, There is another requirement occurred that we should have an application that can be used to run Windows applications. Windows has a long list of beautiful applications for users which are not available to Linux users. As we know that Linux does not support windows executable so WineHQ is a solution to run Windows applications and Linux systems.

The latest Wine 5.6 Development Release has been released on April 10, 2020. The main highlights of this release are full support for window transparency, and the new Mono package for .NET applications support.

This article will help you to install Wine 3.0 Stable Release on RHEL based systems. The Fedora users can use official yum repository provided by Wine team for the installation of latest Wine packages.

Step 1 – Prerequisite

Wine required many development packages. First, we recommend upgrading all system packages using the following commands.

yum clean all
yum update

Now install the required packages for Wine using the yum package manager using the following commands.

yum groupinstall 'Development Tools'
yum install libX11-devel freetype-devel zlib-devel libxcb-devel \ 
      libxslt-devel libgcrypt-devel libxml2-devel gnutls-devel \
      libpng-devel libjpeg-turbo-devel libtiff-devel gstreamer-devel \ 
      dbus-devel fontconfig-devel

Step 2 – Install Wine

RPM packages for wine are not available for the latest versions, So we need to download the wine source code. Use the below commands to download it.

cd /usr/src
wget https://dl.winehq.org/wine/source/7.x/wine-7.14.tar.xz
tar -Jxf wine-7.14.tar.xz
cd wine-7.14

Configure wine using one of the following commands based on your system architecture. This will set the installation environment for Wine according to your system.

For 32-Bit Systems:
./configure

For 64-Bit Systems:
./configure  --enable-win64

Finally, run the make and make install command to compile the wine source and install it on your system.

make
make install

Step 3 – Check Wine Version

Use the following command to check the version of wine installed on your system

On 32-Bit Systems:
wine --version

On 64-Bit Systems:
wine64 --version

How to Use Wine?

To use wine we need to log in to the GUI desktop. After that Download a windows executable (.exe) file like PuTTY on your system and open it with Wine as below screenshot or use following command.

wine putty.exe

Install Wine

The post How to Install Wine 7.x on CentOS, RHEL and Fedora appeared first on TecAdmin.

]]>
https://tecadmin.net/steps-install-wine-centos-rhel-fedora-systems/feed/ 81
How to Install Wine 5.0 on Ubuntu 18.04 & 16.04 LTS https://tecadmin.net/install-wine-on-ubuntu/ https://tecadmin.net/install-wine-on-ubuntu/#comments Sun, 10 Apr 2016 08:00:07 +0000 https://tecadmin.net/?p=5890 Wine 5.0 Stable Released. Wine team has announced the latest stable release 5.0 on Jan 21, 2020. Its source code is available for download from its official site. You may also use the package manager to install wine. Wine is an Open Source implementation of the Windows API and will always be free software. Approximately [...]

The post How to Install Wine 5.0 on Ubuntu 18.04 & 16.04 LTS appeared first on TecAdmin.

]]>
Wine 5.0 Stable Released. Wine team has announced the latest stable release 5.0 on Jan 21, 2020. Its source code is available for download from its official site. You may also use the package manager to install wine. Wine is an Open Source implementation of the Windows API and will always be free software. Approximately half of the source code is written by its volunteers, and remaining effort sponsored by commercial interests, especially CodeWeavers.

An official PPA is available to install Wine on Ubuntu systems. You just need to enable the PPA in your Ubuntu system and install latest Wine packages using apt-get.

winehq_logo_glass

This tutorial described you to how to install Wine on Ubuntu 18.04 LTS Linux systems.

Step 1 – Setup PPA

First of all, If you are running with a 64-bit system enable 32-bit architecture. Also, install the key which was used to sign packages of wine.

sudo dpkg --add-architecture i386
wget -qO - https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add -

Use one of the following commands to enable the Wine apt repository in your system based on your operating system and version.

### On Ubuntu 19.10 
sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ eoan main'

### On Ubuntu 18.04 
sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main'
sudo add-apt-repository ppa:cybermax-dexter/sdl2-backport

### On Ubuntu 16.04 
sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main'

Step 2 – Install Wine on Ubuntu

Use below commands to install Wine packages from the apt repository. The –install-recommends option will install all the recommended packages by winehq stable versions on your Ubuntu system.

sudo apt update
sudo apt install --install-recommends winehq-stable

If you face unmet dependencies error during installation, use the following commands to install winehq using aptitude.

sudo apt install aptitude
sudo aptitude install winehq-stable

Step 3 – Check Wine Version

Wine installation successfully completed. Use the following command to check the version of wine installed on your system.

wine --version

wine-5.0

How to Use Wine (Optional)?

To use wine we need to login to the GUI desktop of your Ubuntu system. After that Download a windows .exe file like PuTTY on your system and open it with Wine as below screenshot or use following command.

wine putty.exe

You can also launch by right click on the application and click Open With Wine Windows Program as shown in the below screenshot.

Install Wine Ubuntu

Conclusion

This tutorial helped you to install Wine on Ubuntu systems.

The post How to Install Wine 5.0 on Ubuntu 18.04 & 16.04 LTS appeared first on TecAdmin.

]]>
https://tecadmin.net/install-wine-on-ubuntu/feed/ 77
How to Install Mean.io On Ubuntu, Debian & LinuxMint https://tecadmin.net/install-mean-io-on-ubuntu/ https://tecadmin.net/install-mean-io-on-ubuntu/#comments Fri, 27 Nov 2015 12:08:04 +0000 https://tecadmin.net/?p=9233 MEAN is a full-stack JavaScript-based framework, which accelerates web application development much faster than other frameworks. This tutorial will help you to install Mean stack on Ubuntu, Debian and LinuxMint systems. MEAN.IO have following requirements, to be pre-installed on the system. Node.js MongoDB Git client Prerequsities First of all, install Nodejs and NPM on your [...]

The post How to Install Mean.io On Ubuntu, Debian & LinuxMint appeared first on TecAdmin.

]]>
MEAN is a full-stack JavaScript-based framework, which accelerates web application development much faster than other frameworks. This tutorial will help you to install Mean stack on Ubuntu, Debian and LinuxMint systems.

MEAN.IO have following requirements, to be pre-installed on the system.

  • Node.js
  • MongoDB
  • Git client

Prerequsities

First of all, install Nodejs and NPM on your system by running the following commands on your system.

curl -sL https://deb.nodesource.com/setup_10.x | sudo bash -
sudo apt-get install nodejs

Now execute the following commands to install MongoDB on your system. Visit here for detailed installation instructions about latest mongodb.

sudo apt-get install mongodb mongodb-server

Now install some more required packages for working with Mean.io.

sudo apt-get install git
sudo npm install gulp

Setup Mean.io Stack

Let’s clone the mean.io source code from its official git repository and install the required node modules.

git clone --depth 1 https://github.com/linnovate/mean.git
cd mean && npm install

Start Application

Now use the following command to start the node development server. This option is not recommended for production use.

npm start

Start Mean stack Ubuntu

Then, open a browser and go to:

 http://localhost:3000

Mean.io stack Ubuntu

The post How to Install Mean.io On Ubuntu, Debian & LinuxMint appeared first on TecAdmin.

]]>
https://tecadmin.net/install-mean-io-on-ubuntu/feed/ 2
How to Install VMware Player on CentOS/RHEL and Ubuntu https://tecadmin.net/install-vmware-player-in-linux/ https://tecadmin.net/install-vmware-player-in-linux/#comments Mon, 10 Aug 2015 22:24:53 +0000 https://tecadmin.net/?p=3208 VMware Player is used for creating virtual machines on any desktop systems. If you are an windows user and learning Linux, It can be much useful for you. Using vmware you can easily create a guest machine within few minutes and start working. After completing your work you can simply delete it. Step 1: Download [...]

The post How to Install VMware Player on CentOS/RHEL and Ubuntu appeared first on TecAdmin.

]]>
VMware Player is used for creating virtual machines on any desktop systems. If you are an windows user and learning Linux, It can be much useful for you. Using vmware you can easily create a guest machine within few minutes and start working. After completing your work you can simply delete it.

Step 1: Download VMware bundle File

First go to vmware download page and download latest available version in bundle file. You can also use below url to download it.

# cd /opt
# https://download3.vmware.com/software/player/file/VMware-Player-7.1.2-2780323.x86_64.bundle

vmware-player-7-download-page

Step 2: Install VMware Player

After downloading vmware bundle file, install it using following command.

# chmod +x VMware-Player-7.1.2-2780323.x86_64.bundle
# ./VMware-Player-7.1.2-2780323.x86_64.bundle

Installation startup will show you the license agreement. Accept the agreement and complete the installation.

Install VMWare Player

Install VMWare Player

Step 3: Start VMware Player

After successfully installation of vmware player, lets start vmware from Applications >> System Tools >> Vmware Player Menu .

vmware-install-on-linux

Congratulation’s! You have successfully install VMware player on you linux system.

The post How to Install VMware Player on CentOS/RHEL and Ubuntu appeared first on TecAdmin.

]]>
https://tecadmin.net/install-vmware-player-in-linux/feed/ 6
How to Install ElasticSearch (Multi Node) Cluster on CentOS/RHEL, Ubuntu & Debian https://tecadmin.net/install-elasticsearch-multi-node-cluster-on-linux/ https://tecadmin.net/install-elasticsearch-multi-node-cluster-on-linux/#comments Fri, 16 Jan 2015 14:28:26 +0000 https://tecadmin.net/?p=6819 ElasticSearch is flexible and powerful open source, distributed real-time search and analytic engine. Using a simple set of APIs, it provides the ability for full-text search. Elastic search is freely available under the Apache 2 license, which provides most flexibility. This article will help you for configuring ElasticSearch Multi Node Cluster on CentOS, RHEL, Ubuntu [...]

The post How to Install ElasticSearch (Multi Node) Cluster on CentOS/RHEL, Ubuntu & Debian appeared first on TecAdmin.

]]>
ElasticSearch is flexible and powerful open source, distributed real-time search and analytic engine. Using a simple set of APIs, it provides the ability for full-text search. Elastic search is freely available under the Apache 2 license, which provides most flexibility.

ElasticSearch

This article will help you for configuring ElasticSearch Multi Node Cluster on CentOS, RHEL, Ubuntu and Debian Systems. In ElasticSearch multi node cluster is just configuring multiple single node clusters with same cluster name in same network.

Network Scenerio

We have three server with following ips and host names. All server are running in same LAN and have full access to each other server using ip and hostname both.

  192.168.10.101  NODE_1
  192.168.10.102  NODE_2
  192.168.10.103  NODE_3

Verify Java (All Nodes)

Java is the primary requirement for installing ElasticSearch. So make sure you have Java installed on all nodes.

# java -version 

java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)

If you don’t have Java installed on any node system, use one of following link to install it first.

Install Java 8 on CentOS/RHEL 7/6/5
Install Java 8 on Ubuntu

Download ElasticSearch (All Nodes)

Now download the latest ElasticSearch archive on all node systems from its official download page. At the time of last update of this article ElasticSearch 1.4.2 version is latest version available to download. Use following command to download ElasticSearch 1.4.2.

$ wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.4.2.tar.gz

Now extract ElasticSearch on all node systems.

$ tar xzf elasticsearch-1.4.2.tar.gz

Configure ElasticSearch

Now we need to setup ElasticSearch on all node systems. ElasticSearch uses “elasticsearch” as default cluster name. We recommend to change it as per your naming conversation.

$ mv elasticsearch-1.4.2 /usr/share/elasticsearch
$ cd /usr/share/elasticsearch

To change cluster named edit config/elasticsearch.yml file in each node and update following values. Node names are dynamically generated, but to keep a fixed user-friendly name change it also.

On NODE_1

Edit elasticsearch cluster configuration on NODE_1 (192.168.10.101) system.

$ vim config/elasticsearch.yml
  cluster.name: TecAdminCluster
  node.name: "NODE_1"

On NODE_2

Edit elasticsearch cluster configuration on NODE_2 (192.168.10.102) system.

$ vim config/elasticsearch.yml
  cluster.name: TecAdminCluster
  node.name: "NODE_2"

On NODE_3

Edit elasticsearch cluster configuration on NODE_3 (192.168.10.103) system.

$ vim config/elasticsearch.yml
  cluster.name: TecAdminCluster
  node.name: "NODE_3"

Install ElasticSearch-Head Plugin (All Nodes)

elasticsearch-head is a web front end for browsing and interacting with an Elastic Search cluster. Use the following command to install this plugin on all node systems.

$ bin/plugin --install mobz/elasticsearch-head

Starting ElasticSearch Cluster (All Nodes)

As the ElasticSearch cluster setup has been completed. Let start ElasticSearch cluster using following command on all nodes.

$ ./bin/elasticsearch &

By default elasticserch listen on port 9200 and 9300. So connect to NODE_1 on port 9200 like following url, You will see all three nodes in your cluster.

http://NODE_1:9200/_plugin/head/

Elasticsearch multinode cluster

Verify Multi Node Cluster

To verify that cluster is working properly. Insert some data in one node and if the same data is available in other nodes, it means cluster is working properly.

Insert Data on NODE_1

To verify cluster create a bucket in NODE_1 and add some data.

$ curl -XPUT http://NODE_1:9200/mybucket
$ curl -XPUT 'http://NODE_1:9200/mybucket/user/rahul' -d '{ "name" : "Rahul Kumar" }'
$ curl -XPUT 'http://NODE_1:9200/mybucket/post/1' -d '
{
    "user": "rahul",
    "postDate": "01-16-2015",
    "body": "Adding Data in ElasticSearch Cluster" ,
    "title": "ElasticSearch Cluster Test"
}'

Search Data on All Nodes

Now search same data from NODE_2 and NODE_3 and check if same data is replicated to other nodes of cluster. As per above commands we have created a user named rahul and added some data there. So use following commands to search data associated with user rahul.

$ curl 'http://NODE_1:9200/mybucket/post/_search?q=user:rahul&pretty=true'
$ curl 'http://NODE_2:9200/mybucket/post/_search?q=user:rahul&pretty=true'
$ curl 'http://NODE_3:9200/mybucket/post/_search?q=user:rahul&pretty=true'

and you will get results something like below for all above commands.

{
  "took" : 69,
  "timed_out" : false,
  "_shards" : {
    "total" : 5,
    "successful" : 5,
    "failed" : 0
  },
  "hits" : {
    "total" : 1,
    "max_score" : 1.0,
    "hits" : [ {
      "_index" : "mybucket",
      "_type" : "post",
      "_id" : "1",
      "_score" : 1.0,
      "_source":
{
    "user": "rahul",
    "postDate": "01-16-2015",
    "body": "Adding Data in ElasticSearch Cluster" ,
    "title": "ElasticSearch Cluster Test"
}
    } ]
  }
}

View Cluster Data on Web Browser

To view data on ElasticSearch cluster access of elasticsearch-head plugin using one of cluster ip at below url. Then click on Browser tab.

http://NODE_1:9200/_plugin/head/

data in elasticsearch cluster

The post How to Install ElasticSearch (Multi Node) Cluster on CentOS/RHEL, Ubuntu & Debian appeared first on TecAdmin.

]]>
https://tecadmin.net/install-elasticsearch-multi-node-cluster-on-linux/feed/ 8
How to Setup Hadoop 2.6.5 (Single Node Cluster) on Ubuntu, CentOS And Fedora https://tecadmin.net/setup-hadoop-2-4-single-node-cluster-on-linux/ https://tecadmin.net/setup-hadoop-2-4-single-node-cluster-on-linux/#comments Sat, 10 Jan 2015 15:48:18 +0000 https://tecadmin.net/?p=5170 Apache Hadoop 2.6.5 noticeable improvements over the previous stable 2.X.Y releases. This version has many improvements in HDFS and MapReduce. This how-to guide will help you to install Hadoop 2.6 on CentOS/RHEL 7/6/5, Ubuntu and other Debian-based operating system. This article doesn’t include the overall configuration to setup Hadoop, we have only basic configuration required [...]

The post How to Setup Hadoop 2.6.5 (Single Node Cluster) on Ubuntu, CentOS And Fedora appeared first on TecAdmin.

]]>
Apache Hadoop 2.6.5 noticeable improvements over the previous stable 2.X.Y releases. This version has many improvements in HDFS and MapReduce. This how-to guide will help you to install Hadoop 2.6 on CentOS/RHEL 7/6/5, Ubuntu and other Debian-based operating system. This article doesn’t include the overall configuration to setup Hadoop, we have only basic configuration required to start working with Hadoop.

Hadoop on Linux

Step 1: Installing Java

Java is the primary requirement to setup Hadoop on any system, So make sure you have Java installed on your system using the following command.

# java -version 

java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

If you don’t have Java installed on your system, use one of the following links to install it first.

Install Java 8 on CentOS/RHEL 7/6/5
Install Java 8 on Ubuntu

Step 2: Creating Hadoop User

We recommend creating a normal (nor root) account for Hadoop working. So create a system account using the following command.

# adduser hadoop
# passwd hadoop

After creating an account, it also required to set up key-based ssh to its own account. To do this use execute following commands.

# su - hadoop
$ ssh-keygen -t rsa
$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
$ chmod 0600 ~/.ssh/authorized_keys

Let’s verify key based login. Below command should not ask for the password but the first time it will prompt for adding RSA to the list of known hosts.

$ ssh localhost
$ exit

Step 3. Downloading Hadoop 2.6.5

Now download hadoop 2.6.0 source archive file using below command. You can also select alternate download mirror for increasing download speed.

$ cd ~
$ wget http://www-eu.apache.org/dist/hadoop/common/hadoop-2.6.5/hadoop-2.6.5.tar.gz 
$ tar xzf hadoop-2.6.5.tar.gz 
$ mv hadoop-2.6.5 hadoop

Step 4. Configure Hadoop Pseudo-Distributed Mode

4.1. Setup Hadoop Environment Variables

First, we need to set environment variable uses by Hadoop. Edit ~/.bashrc file and append following values at end of file.

export HADOOP_HOME=/home/hadoop/hadoop
export HADOOP_INSTALL=$HADOOP_HOME
export HADOOP_MAPRED_HOME=$HADOOP_HOME
export HADOOP_COMMON_HOME=$HADOOP_HOME
export HADOOP_HDFS_HOME=$HADOOP_HOME
export YARN_HOME=$HADOOP_HOME
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
export PATH=$PATH:$HADOOP_HOME/sbin:$HADOOP_HOME/bin

Now apply the changes in current running environment

$ source ~/.bashrc

Now edit $HADOOP_HOME/etc/hadoop/hadoop-env.sh file and set JAVA_HOME environment variable. Change the JAVA path as per install on your system.

export JAVA_HOME=/opt/jdk1.8.0_131/

4.2. Edit Configuration Files

Hadoop has many of configuration files, which need to configure as per requirements to setup Hadoop infrastructure. Let’s start with the configuration with basic Hadoop single node cluster setup. first, navigate to below location

$ cd $HADOOP_HOME/etc/hadoop

Edit core-site.xml

<configuration>
<property>
  <name>fs.default.name</name>
    <value>hdfs://localhost:9000</value>
</property>
</configuration>

Edit hdfs-site.xml

<configuration>
<property>
 <name>dfs.replication</name>
 <value>1</value>
</property>

<property>
  <name>dfs.name.dir</name>
    <value>file:///home/hadoop/hadoopdata/hdfs/namenode</value>
</property>

<property>
  <name>dfs.data.dir</name>
    <value>file:///home/hadoop/hadoopdata/hdfs/datanode</value>
</property>
</configuration>

Edit mapred-site.xml

<configuration>
 <property>
  <name>mapreduce.framework.name</name>
   <value>yarn</value>
 </property>
</configuration>

Edit yarn-site.xml

<configuration>
 <property>
  <name>yarn.nodemanager.aux-services</name>
    <value>mapreduce_shuffle</value>
 </property>
</configuration>

4.3. Format Namenode

Now format the namenode using the following command, make sure that Storage directory is

$ hdfs namenode -format

Sample output:

15/02/04 09:58:43 INFO namenode.NameNode: STARTUP_MSG:
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG:   host = svr1.tecadmin.net/192.168.1.133
STARTUP_MSG:   args = [-format]
STARTUP_MSG:   version = 2.6.5
...
...
15/02/04 09:58:57 INFO common.Storage: Storage directory /home/hadoop/hadoopdata/hdfs/namenode has been successfully formatted.
15/02/04 09:58:57 INFO namenode.NNStorageRetentionManager: Going to retain 1 images with txid >= 0
15/02/04 09:58:57 INFO util.ExitUtil: Exiting with status 0
15/02/04 09:58:57 INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at svr1.tecadmin.net/192.168.1.133
************************************************************/

Step 5. Start Hadoop Cluster

Now start your Hadoop cluster using the scripts provides by Hadoop. Just navigate to your Hadoop sbin directory and execute scripts one by one.

$ cd $HADOOP_HOME/sbin/

Now run start-dfs.sh script.

$ start-dfs.sh

Sample output:

15/02/04 10:00:34 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Starting namenodes on [localhost]
localhost: starting namenode, logging to /home/hadoop/hadoop/logs/hadoop-hadoop-namenode-svr1.tecadmin.net.out
localhost: starting datanode, logging to /home/hadoop/hadoop/logs/hadoop-hadoop-datanode-svr1.tecadmin.net.out
Starting secondary namenodes [0.0.0.0]
The authenticity of host '0.0.0.0 (0.0.0.0)' can't be established.
RSA key fingerprint is 3c:c4:f6:f1:72:d9:84:f9:71:73:4a:0d:55:2c:f9:43.
Are you sure you want to continue connecting (yes/no)? yes
0.0.0.0: Warning: Permanently added '0.0.0.0' (RSA) to the list of known hosts.
0.0.0.0: starting secondarynamenode, logging to /home/hadoop/hadoop/logs/hadoop-hadoop-secondarynamenode-svr1.tecadmin.net.out
15/02/04 10:01:15 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

Now run start-yarn.sh script.

$ start-yarn.sh

Sample output:

starting yarn daemons
starting resourcemanager, logging to /home/hadoop/hadoop/logs/yarn-hadoop-resourcemanager-svr1.tecadmin.net.out
localhost: starting nodemanager, logging to /home/hadoop/hadoop/logs/yarn-hadoop-nodemanager-svr1.tecadmin.net.out

Step 6. Access Hadoop Services in Browser

Hadoop NameNode started on port 50070 default. Access your server on port 50070 in your favorite web browser.

http://svr1.tecadmin.net:50070/

hadoop single node namenode

Now access port 8088 for getting the information about cluster and all applications

http://svr1.tecadmin.net:8088/

hadoop single node applications

Access port 50090 for getting details about secondary namenode.

http://svr1.tecadmin.net:50090/

Hadoop single node secondary namenode

Access port 50075 to get details about DataNode

http://svr1.tecadmin.net:50075/

hadoop-2-6-single-node-datanode

Step 7. Test Hadoop Single Node Setup

7.1 – Make the HDFS directories required using following commands.

$ bin/hdfs dfs -mkdir /user
$ bin/hdfs dfs -mkdir /user/hadoop

7.2 – Now copy all files from local file system /var/log/httpd to hadoop distributed file system using below command

$ bin/hdfs dfs -put /var/log/httpd logs

7.3 – Now browse hadoop distributed file system by opening below url in browser.

 http://svr1.tecadmin.net:50070/explorer.html#/user/hadoop/logs

hadoop-test-uploaded-files

7.4 – Now copy logs directory for hadoop distributed file system to local file system.

$ bin/hdfs dfs -get logs /tmp/logs
$ ls -l /tmp/logs/

You can also check this tutorial to run wordcount mapreduce job example using command line.

The post How to Setup Hadoop 2.6.5 (Single Node Cluster) on Ubuntu, CentOS And Fedora appeared first on TecAdmin.

]]>
https://tecadmin.net/setup-hadoop-2-4-single-node-cluster-on-linux/feed/ 72
How to Setup Moodle 2.8 on CentOS/RHEL 7/6/5 https://tecadmin.net/setup-moodle-on-linux/ https://tecadmin.net/setup-moodle-on-linux/#comments Mon, 29 Dec 2014 10:18:44 +0000 https://tecadmin.net/?p=1847 Moodle is an Open Source Course Management System, It’s also known as a Learning Management System (LMS) or a Virtual Learning Environment (VLE). This tutorial will help you to install Moodle on CentOS/RHEL Systems Installing Required Packages Install order to setup Moodle we need a Web Server, Database Server and PHP with required modules. Use [...]

The post How to Setup Moodle 2.8 on CentOS/RHEL 7/6/5 appeared first on TecAdmin.

]]>
Moodle is an Open Source Course Management System, It’s also known as a Learning Management System (LMS) or a Virtual Learning Environment (VLE). This tutorial will help you to install Moodle on CentOS/RHEL Systems

Installing Required Packages

Install order to setup Moodle we need a Web Server, Database Server and PHP with required modules. Use below link to install following packages.

Installing Apache, MySQL and PHP on CentOS/RedHat 6/5

Install required PHP modules using yum package manager.

# yum install git php-common php-mysql php-gd php-intl php-curl
# yum install php-ldap php-apc php-mbstring php-dom php-soap php-xmlrpc

To install git version 1.9 use article Install Git 1.9 on CentOS/RHEL

Download Moodle Latest Source

Moodle complete code is available under git repository. So we can directory make a clone of repository to our local system using following commands.

# mkdir /var/moodle
# cd /var/moodle
# git clone git://git.moodle.org/moodle.git www

After finishing Moodle git clone, checkout the latest branch of Moodle available in git. At the time of updating this article current Moodle version is 2.8.3 so we specified in below command.

# cd www
# git checkout origin/MOODLE_28_STABLE

Click here to find latest available version of Moodle.

Create Moodle Data directory using following command. Moodle use this directory for storing data of application. We recommend to keep this directory outside of Moodle application.

# mkdir /var/moodle/data

Create Moodle Database in MySQL

Moodle supports MySQL 5.1.33, Postgres 8.3, MSSQL 2005, Oracle 10.2 or its higher versions. For this tutorial we are using MySQL.

Use below commands to create Moodle database and user to access database.

# mysql -u root -p

mysql> CREATE DATABASE moodle;
mysql> GRANT ALL ON moodle.* TO 'moodle'@'localhost' IDENTIFIED BY 'secretpassword';
mysql> FLUSH PRIVILEGES;
mysql> quit

Create Moodle Configuration File

Create Moodle configuration file by creating copy of config-dist.php with name config.php in www directory.

# cd /var/moodle/www
# cp config-dist.php config.php

Now edit config.php and make following changes as per you setup details.

$CFG->dbtype    = 'mysqli';
$CFG->dblibrary = 'native';
$CFG->dbhost    = 'localhost';
$CFG->dbname    = 'moodle';
$CFG->dbuser    = 'moodle';
$CFG->dbpass    = 'secretpassword';
$CFG->prefix    = 'mdl_';
$CFG->wwwroot   = 'http://moodle.tecadmin.net';
$CFG->dataroot  = '/var/moodle/data';

Configure Web Server VirtualHost

Add a virtual host in Apache configuration file /etc/httpd/conf/httpd.conf like below.

<VirtualHost *:80>
    ServerAdmin webmaster@tecadmin.net
    DocumentRoot /var/moodle/www
    ServerName moodle.tecadmin.net
    CustomLog logs/moodle.tecadmin.net_log combined
</VirtualHost>

Updating Moodle web and data directory permissions so that web server can write in it.

# chown -R apache:apache /var/moodle
# chmod -R 755 /var/moodle

Restart Apache Server to reload newly changes made.

# service apache restart

Finally Start Moodle Web Installer

Open Moodle url in browser and follow the steps to complete setup.

moodle-1

Checking required modules are installed.

moodle-2

Installing all Moodle modules. Click continue when complete.

moodle-3

You will get few more steps while running web installer complete all the steps. Finally you will get Moodle running like below.

moodle-4

The post How to Setup Moodle 2.8 on CentOS/RHEL 7/6/5 appeared first on TecAdmin.

]]>
https://tecadmin.net/setup-moodle-on-linux/feed/ 1