Showing posts with label installation. Show all posts
Showing posts with label installation. Show all posts

Wednesday, August 3, 2022

#Install #docker on #Centos7, #Centos9, #Ubuntu20

Tested OSs: Centos7, Centos9 and Ubuntu 20


Step-1 (Optional)

*Note: Ignore this step, if you are not in installing docker in the University of Tartu's private cloud

- Create the daemon file manually. This is because of some conflict in University's Openstack Environment.

sudo mkdir -p /etc/docker && cd /etc/docker

- Create and update docker daemon file

1
2
3
4
5
6
sudo tee /etc/docker/daemon.json <<EOF
{
	
"default-address-pools": [{"base":"172.80.0.0/16","size":24}]
}
EOF

Step-2

  • Now run this command. It will add the official Docker repository, download the latest version of Docker, and install it:
curl -fsSL https://get.docker.com/ | sh
  • After installation has completed, start the Docker daemon:
sudo systemctl start docker
  • Verify that it’s running:
sudo systemctl status docker
  • Enable docker

    sudo systemctl enable docker

Step-3

To run docker commands with non-root privileges

  • Create a docker group (If it's already created then ignore): sudo groupadd docker
  • Add a user to docker group: sudo usermod -aG docker $USER
  • Activate the changes: newgrp docker
  • Check the installation by displaying docker version: docker --version

 

 

 - That's all for now.

Monday, June 20, 2022

Installing #neo4j on #centos 9 using #docker and accessing from #remote...

In this post, you will see how to install neo4j graphDB on a remote with no GUI access. We will install this db on centos9 OS and access the web-based GUI on local machine.

Steps:

  • Login to the remote VM using ssh -i <keyfile> centos@<ip of the VM> command
  • Create following directories
    • mkdir neo4j && cd neo4j
    • mkdir -p data logs import plugins
  • Execute following docker command to download and run neo4j docker image
 docker run \
    -d
    --restart always \
    --publish=7474:7474 --publish=7687:7687 \
    --env NEO4J_AUTH=neo4j/test \
    --user="$(id -u):$(id -g)" \
    --volume=$HOME/neo4j/data:/data \
    -v $HOME/neo4j/logs:/logs \
    -v $HOME/neo4j/import:/var/lib/neo4j/import \
    -v $HOME/neo4j/plugins:/plugins \
    neo4j:latest
  • Now in the local machine, open your terminal or command prompt and execute the following command
      ssh -i <keyfile> -N -f -L localhost:7474:localhost:7474 centos@<Remote VM ip>
  • Now open any web browser and enter following address
    • http://localhost:7474
 In the below video, you can get the detailed steps for more better clarity. Please reach out to me https://kodu.ut.ee/~dehury/ if you have any confusion.

Thursday, October 7, 2021

Installing python3 and pip3 on Centos7

Here I have no python3 installed

The most simplest way to install python3
=================
sudo yum install python3

Make python 3.6 as default one
=================
sudo alternatives --install /usr/bin/python python /usr/bin/python3.6 60
sudo alternatives --config python

Check the python version
==================

Check the pip version
==================

Check the pip3 version
==================

Upgrade pip3
=================
pip3 install --upgrade pip --user



 

Check the pip version

==================


Bonus: Fixing yum package manager

Now lets try to install a random package to check the yum package manager

Install nano
=============
sudo yum install nano
you will get following error

To fix this, Open the /usr/bin/yum file and in the first line, change python to python2
OLD:


NEW:

If again you got similar issue with different file, for example:

Open this file (sudo vi /usr/libexec/urlgrabber-ext-down ) and in the first line change "python" to "python2"

 

Here is the Youtube demo:


 

 

-That's all for now

Monday, September 20, 2021

Managing Kubernetes clusters using Rancher [20Sept2021]


 
Here is the Environment for me. You may go with single worker node 

Created Tuesday 07 September 2021

Rancher node: Centos 7 (better to keep this separate from cluster nodes), flavor: m3.xsmall
Master Node: Centos 7, m3.xsmall
Worker Node-1: Centos 7, m3.xsmall
Worker Node-2: Centos 7, m3.xsmall

Both Master and Work Node have allow-all security group attached
Minimal ports required are 80/TCP, 443/TCP

[src: https://rancher.com/docs/rancher/v2.x/en/quick-start-guide/deployment/quickstart-manual-setup/

Common installation

  1. Install Docker

  • Create the daemon file manually. This is also because of some conflict in University's Openstack Environment.

        sudo mkdir -p /etc/docker
        sudo tee /etc/docker/daemon.json <<EOF
	{
	  "exec-opts": ["native.cgroupdriver=systemd"],
	  "log-driver": "json-file",
	  "log-opts": {
	    "max-size": "100m"
	  },
	  "storage-driver": "overlay2",
	  "storage-opts": [
	    "overlay2.override_kernel_check=true"
	  ],

"default-address-pools": [{"base":"172.80.0.0/16","size":24}]

	}
	EOF

  • Now run this command. It will add the official Docker repository, download the latest version of Docker, and install it:
curl -fsSL https://get.docker.com/ | sh
  • After installation has completed, start the Docker daemon:
sudo systemctl start docker
ERROR if docker is unable to start, try to check the /etc/docker/daemon.json file
  • Verify that it’s running:
sudo systemctl status docker
  • enable docker to start on boot:
sudo systemctl enable docker
  • To run docker commands with non-root privileges

sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker

Rancher node

  1. Enter the following command to run rancher container
sudo docker run -d --restart=unless-stopped -p 80:80 -p 443:443 --privileged rancher/rancher
  1. Go to the web browser and hit https://<SERVER_IP_Rancher_Node>
  2. Follow the wizard for initial setup
Once it is done, you should be able to see the dashboard with local as the cluster name

Create a new cluster

src: https://rancher.com/docs/rancher/v2.5/en/quick-start-guide/deployment/quickstart-manual-setup/

  1. Go to the browser and access Rancher Dashboard
  2. From the dashboard, click on Create
  3. Click on Custom
  4. Give Cluster Name as cluster-1 and skipp other infos
  5. Click on Next
  6. Select etcd , Control Plane , Worker
  7. Select the Registration command
    1. The registration command should look like:
sudo docker run -d --privileged --restart=unless-stopped --net=host -v /etc/kubernetes:/etc/kubernetes -v /var/run:/var/run rancher/rancher-agent:v2.6.0 --server https://172.17.90.86 --token bflxwjlsvsrtbnvp8nj5xq82xx2sr5npjsxm82mbtdcfkc9g65x5d8 --ca-checksum f9bc8c23fff67155023fde69026ec83a77f632657f1049fd6ca9ae5732cf59d3 --etcd --controlplane --worker
  1. Go to master node terminal and execute the registration command

At this point you need to wait for few minutes...

  1. After this, you will see in the browser that 1 New node has registered.
  2. Now click on Done
  3. Repeat Step 6 to get the registration command for worker node. For worker node you just need to select Worker

Deleting a node

[src: https://rancher.com/docs/rancher/v2.5/en/cluster-admin/cleaning-cluster-nodes/]
Deleting Docker Containers, Images, and Volumes

Based on what role you assigned to the node, there are Kubernetes components in containers, containers belonging to overlay networking, DNS, ingress controller and Rancher agent. (and pods you created that have been scheduled to this node)

To clean all Docker containers, images and volumes:

docker rm -f $(docker ps -qa)
docker rmi -f $(docker images -q)
docker volume rm $(docker volume ls -q)

Clean the related directories

sudo rm -rf /etc/ceph \
	   /etc/cni \
	   /etc/kubernetes \
	   /opt/cni \
	   /opt/rke \
	   /run/secrets/kubernetes.io \
	   /run/calico \
	   /run/flannel \
	   /var/lib/calico \
	   /var/lib/etcd \
	   /var/lib/cni \
	   /var/lib/kubelet \
	   /var/lib/rancher/rke/log \
	   /var/log/containers \
	   /var/log/kube-audit \
	   /var/log/pods \
	   /var/run/calico

It is now good to reboot the VM with following command:

sudo reboot



-That's all

Sunday, March 11, 2018

Installing Docker on Ubuntu 14.04 OS [Update]

Steps:

  s1:    sudo apt-get update
  s2:    sudo apt-get install \
                  apt-transport-https \
                  ca-certificates \
                  curl \
                  software-properties-common
  s3:    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  s4:    sudo add-apt-repository \
                  "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
                  $(lsb_release -cs) \
                  stable edge"
  s5:    sudo apt-get update
  s6:    sudo apt-get install docker-ce
  s7:  For testing the docker
           sudo docker run hello-world

 Create the "docker" group
   sudo groupadd docker
Add the current user to the "docker" group
   sudo usermod -aG docker $USER

Now logout and then login again from the currnet session.

You can download and run the following shell script file.
InstallDocker.sh

Saturday, June 10, 2017

X11 forwarding using Xming X server for Windows

Problem statement:

Let's say, We have 2 two computers: One with Ubuntu OS and other with Windows OS
Through SSH connection, "How can we access the any application's interface (GUI) installed on Ubuntu computer from Windows computer ?". For example, we want to access the GUI of calculator application that is installed on Ubuntu from Windows computer.

Environment:

First computer:
                       OS- Ubuntu 14.04 64-bit
                       Openssh-server package
Second computer:
                       OS- Windows 8 64bit
                        Xming software tool

Here, for demonstration, we will open GUI of calculator application
The command to open the calculator in Ubuntu is gnome-calculator                      

Step-1:
On Ubuntu Computer, install openssh-server package.

Perform Step-2 to 5 on Windows computer.
Step-2:
On Windows computer: 
Download Xming for Windows 8 64bit.
Install Xming executable file. You don't have to do any changes. Leave everything to the default selection.

Step-3: 
Now open command prompt on Windows computer
Change the directory to the location where Xming is installed. In my case it is "C:\Program Files (x86)\Xming"


cd "c:\Program Files (x86)\Xming"

Step-4:
Now enter the following command to start Xming on Windows


Xming.exe -multiwindow -clipboard


Step-5:
Now its the time to connect to the Ubuntu computer through inbuilt putty. In this step, you need to provide the login information, and the command to open required application.

The command can be

plink -ssh -2 -X user1@<IP of ubuntu computer> -P <port number of SSH server> <command to open the required application>



e.g.

plink -ssh -2 -X chinmaya@120.162.56.85  -P 23 gnome-calculator


Here, I am connecting to the Ubuntu computer through ssh protocol 2.
The IP address and SSH port number of Ubuntu computer is 120.162.56.85 and 23, respectively.
gnome-calculator is the command to open the GUI of calculator application.

After entering the above command, you need to give the corresponding password. If all goes well, the required GUI will appear on Wondows computer.

Please comment if you need more information or if you have any suggestion.

-Thank you



Friday, June 9, 2017

GitLab: For private Git repository

I assume here that the reader has basic knowledge about GitHub, BitBucket or SourceForge or some other alternatives to GitHub. Now, as a member of small research team, my responsibility is to setup something like GitHub in our own private server. The objective is to store and access individual's source code used for varification and evaluation of own research projects in a secure place. It's quite similar to GitHub.

For this requirement,I found GitLab as one of the best solutions. Installation of such software tool is a straight-forward procedure.

Installation Procedures:


Environment

In our physical server, NO other webserver is installed.
OS: Ubuntu 14.04, 64-bit Desktop version

Step-1:
Open the terminal by pressing Alt + Ctrl + T.

Step-2:
Enter the following command
sudo apt-get install curl openssh-server ca-certificates postfix
 
 This will install curl to get download the required packages, openssh-server for secure connection, postfix to setup mailing server and other essential packages.

Step-3: 
Now run the following commands donwload and install community edition of GitLab
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
sudo apt-get install gitlab-ce

Pre-Final Step:
Reconfigure the gitlab-ce and start the GitLab server by running following command
sudo gitlab-ctl reconfigure

Final Step:
Once the server is ready, please open any web browser. Visit http://127.0.0.1 or http://localhost or http://<The IP of own server>
At first, enter the new password for the administrator. Once the password for the administrator is setup, other usernow can signup their account and enjoy own git repository.

For more information please visit GitLab official homepage.


-Thank you



Thursday, November 24, 2016

Installing packages (Python, R and Scala) with Anaconda.

Anaconda makes the package management of Python, R and Scala very easy. For this you need to have Anaconda-navigator package installed in your computer.



1. Open Command prompt
2. Enter conda install anaconda-navigator
3. Press Enter key to proceed.

Now open anaconda navigator application. Below is the Home screen of Anaconda navigator.
1. Home Screen


Click on Environments, as shown below
2. Environment screen


Change the Installed option to All option Select
3. Change "Installed" to "All" option

4. Differentiate "Installed", "Not installed" and "Upgradable " packages.

Now Type the required package in the Search box.
Lets install "pandasql" package . So type pandasql in the search box. Now you can see the search result.

5. Search required package


Now right click on the checkbox in the respective search result. From the options , select "Mark for installation"

6. Installation option


Click on "Apply" button.
Now click on "Ok" button.
7. Final steps.


Its finish. Repeat the same process for installing other packages.




Installing Anaconda in Windows OS.


Step 1: Download
First step is to download the latest version of Anaconda for Windows OS.

For Windows 64bit (Python 3.5): https://repo.continuum.io/archive/Anaconda3-4.2.0-Windows-x86_64.exe
For Windows 32bit (Python 3.5):  https://repo.continuum.io/archive/Anaconda3-4.2.0-Windows-x86.exe

For Windows 64bit (Python 2.7): https://repo.continuum.io/archive/Anaconda2-4.2.0-Windows-x86_64.exe
For Windows 32bit (Python 2.7):  https://repo.continuum.io/archive/Anaconda2-4.2.0-Windows-x86.exe

You can also download from official link https://www.continuum.io/downloads.

Step 2 : Install
Install Anaconda 3.5 (Python 3.5)
  1. Double click on the downloaded file.
  2. Follow the wizard.
  3. Select "Just me..." option, and click on "Next" button.
  4. In the "Advanced Installation Options", please make sure that "Add Anaconda to my PATH...." and "Register Anaconda....."  options are checked.
  5. now just follow the wizard and finish the installation process.

Step 3: Verify the installation
Open command prompt
Enter following command
 conda --version

Thursday, October 20, 2016

Accessing remote printer [Fuji Xerox DocuPrint m215b]

In this post we will see, how to access a shared remote printer. Below picture describes the concern environment.


Let's say you as the user want to access the printer attached to another computer which is connected to internet. Its assume that the printer is already shared. So this post is all about configuring the user's computer to access the remote printer.

Environment :

OS: Windows 8 (The steps may vary slightly in other versions of Windows)
Printer Driver: In this demonstration Fuji Xerox DocuPrint m215b is used.
                           Driver for Windows 64bit  OS
                            (Compatible OS: Windows 7, Windows 10, Windows Server 2003, Windows Server 2003 64bit, Windows Vista, Windows Vista 64bit, Windows Server 2008, Windows Server 2008 64bit, Windows Server 2008 R2, Windows 7 64bit, Windows 8, Windows 8 64bit, Windows 8.1, Windows 8.1 64bit, Windows Server 2012, Windows Server 2012 R2, Windows 10 64bit )
                             (Click here to download the driver from official website)



 Driver Installation steps



Step1:  Download the Printer driver
Step 2: Now extract the content of the downloaded driver. Open the newly created Folder.

Step 3: Right click on the application and click on "Run As Administrator"

Step 4: Click on Unzip

Step 5: Now you will see another folder. Now close the dialog box and open the newly created folder.

Step 6 :  Now run the "install" application by double clicking on it.

Step 7:  Select "Personal installation" radio button and click on next button.

Step 8:  Click on "next" button after accepting the license agreement.

Step 9: Now wait for few mins

Step 10 : Click on "Finish" button to finish the installation process.




Adding Remote printer



Step 1: Open the control panel, and click on "Devices and Printers"

Step 2:  Click on "Add a printer"

Step 3:  Wait for auto search. Or you can click on "The printer that I want isn't listed"

Step 4:  Give the printer name (including computer name) and click on "Next" button.

Step 5:  You must see the printer name. Click on "Next" button.

Step 6: Click on "Print a test page" to check the accessibility of the printer. click "Finish" button to finish the configuration process.


That's all for now...Please comment if you encounter any problem.

-Thank you





Thursday, October 6, 2016

Installing OpenCV and Python in Windows


1. Download and install Python 2.7.x in windows
             windows install : http://python.org/ftp/python/2.7.5/python-2.7.5.msi
2.  The default installation directory C:\Python27


3. Download and install python package manager pip if NOT installed
                  A. Download get-pip.py script from  https://bootstrap.pypa.io/get-pip.py
                  B. Open command prompt
                  C. Enter following command to run the downloaded script
                                    python <path to get-pip.py file>

4.  Go to http://www.lfd.uci.edu/~gohlke/pythonlibs/ to download and install python packages

5.  Now, Download Numpy python package (choose the .whl file based on your requirement)
                  A. Open command prompt
                  B. Go to the local directory where numpy-1.11.2+mkl*.whl file is present
                  C. Enter following command to Install Numpy
                                    pip install numpy-1.11.2*.whl
6. You can repeat Step-5 to install other required packages


7. Download and install OpenCV
                  A. Folllow the link to download OpenCV-3.1.0
                  B. Open the .exe file to install (in C drive)
                  C. Goto C:\opencv\build\python
                  D. Copy cv2.d to C:\Python27\Lib\site-packages

Please comment if you encounter any error....

-Thank you 

Tuesday, September 13, 2016

How to install TexStudio with Miktex ?

In order to work with Latex,  texStudio is one of the best solutions as TeX editor.
See the comparison of TexStudio with other other text editor.

Download the following software.

  1. Latex editor: TeXstudio 
    1. Select according to your OS environment.
  2. Repository: miktex repository 
    •  
      select the version according your OS environment
    •  Save the installer file, such as "setup-2.9.6050.exe"
    • If you have very good internet connection, better you download 'net install' which allow you to download the complete MikTeX repository.
So, now you must have the following software packages

Downloading and Installing MikTeX repository

1.  Open the miktex installer file. Here it is "Setup-2.9.6050.exe"
2.  Click on 'Next' button....

3.  Select 'Download MiKTeX' option to keep the repository for future purpose. <4.JPG>
4.  Select "Complete MiKTeX" option to install all packages.

5.  Now the choose the download source and click on 'Next' button.

6.  Give the location, where you want to keep the downloaded repository.

7.  Now the final step to download the repository. Click on "Start" button.

8. Now you need to wait until the download finish.
9. Once the download is finished, click on "Next" button.

10. Click on "Close" button.

      Here we finish downloading the MiKTeX repository. Now we perform the installation process.
11. Open the same miktex installer file again and follow step 2. Here it is "Setup-2.9.6050.exe"
12. Now Select "Install MiKTeX" option and click on "Next" button.

13. Now select "Complete MiKTeX" option and click on "Next" button.
14. Select the user based on your requirement and click on "Next" option.

15. Now you need to specify the path of already downloaded MikTeX repository. Click on "Next" button.

16. Now click on "Next" button, leaving the default installation directory.
17. Leave the default setting, and press "Next" button.
18. Click on "Start" button after reviewing the settings.
19. After the installation process finish, click on "Next" button and then click on "Close" button.

Installing TeXstudio   
Now install TeXstudio editor. Installing TeXstudio is quite easy. Just follow the installation wizard and leave all the setting as default. Below are some screenshot given for reference.
1
2

3

4

5

6

7