Cloud Network

Networking | Support | Tricks | Troubleshoot | Tips

Buymecoffe

Buy Me A Coffee
Showing posts with label Kubuntu. Show all posts
Showing posts with label Kubuntu. Show all posts

Monday, November 2, 2020

How Ubuntu used in government sector?

November 02, 2020
How Ubuntu used in government sector?

Is 700mb DVD sufficient to burn ubuntu in it?

November 02, 2020
Is 700mb DVD sufficient to burn ubuntu in it?

Wednesday, September 2, 2020

How to Setup Monitoring for Docker Containers using Prometheus on Ubuntu 18.04

September 02, 2020
How to Setup Monitoring for Docker Containers using Prometheus on Ubuntu 18.04

 Requirment 

1. docker should be installed

2. docker-compose also be installed


Installation of docker

1.  sudo apt-get install docker.io or sudo apt  install docker.io

2. docker --version

3. sudo apt-get install docker-compose

 

Creating a Configuration files of prometheus

1. create a new file prometheus.yml and copy paste below

sudo nano ~/ prometheus.yml  or sudo nano /etc/prometheus/prometheus.yml

# prometheus.yml
global:
 scrape_interval: 5s
 external_labels:
   monitor: 'my-monitor'
rule_files:
 - 'alert.rules'
scrape_configs:
 - job_name: 'prometheus'
   static_configs:
     - targets: ['your_server_ip:9090']

2. create a new file docker-compose.yml and copy paste below

sudo nano ~/docker-compose.yml or sudo nano /etc/prometheus/docker-compose.yml

# docker-compose.yml
version: '2'
services:
  prometheus:
     image: prom/prometheus:latest
     volumes:
       - ./prometheus.yml:/etc/prometheus/prometheus.yml            
     command:
       - '--config.file=/etc/prometheus/prometheus.yml'
     ports:
       - '9090:9090'

 3. Run the docker compose file

cd /etc/prometheus/ or sudo ~/docker-compose up

sudo docker-compose up

 4. Open browser

http://your_server_ip:9090

 5. Install Node exporter

sudo nano ~/docker-compose.yml or sudo nano /etc/prometheus/docker-compose.yml
 
copy paste at last line
node-exporter:
     image: prom/node-exporter
     ports:
       - '9100:9100'
 sudo nano ~/ prometheus.yml  or sudo nano /etc/prometheus/prometheus.yml
 
copy paste at last line 
- job_name: 'node-exporter'
   static_configs:
     - targets: ['node-exporter:9100'] 

 6. Restart docker-composer

cd /etc/prometheus/ or sudo ~/docker-compose restart

sudo docker-compose restart

7. Install Grafana

sudo nano ~/docker-compose.yml or sudo nano /etc/prometheus/docker-compose.yml

copy paste at last line  

grafana:
     image: grafana/grafana
     user: "0" #[ Execute  id -u in terminal to find the user id from where you are invoking docker compose]
     volumes:
       - ./grafana_db:/var/lib/grafana
     environment:
       - GF_SECURITY_ADMIN_PASSWORD=yourpass
     depends_on:
       - prometheus
     ports:
       - '3000:3000'

 4. Open browser

http://your_server_ip:3000

 

 

Wednesday, June 10, 2020

How to solve command could not be located because '/bin' is not included in the path environment variable

June 10, 2020
How to solve command could not be located because '/bin' is not included in the path environment variable
ERROR
command could not be located because '/bin' is not included in the path environment variable


SOLUTION 1
cat /etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"

ls -l /etc/environment
-rw-r--r-- 1 root root 79 2010-03-16 14:44 /etc/environment

JUST TYPE
export PATH=/usr/bin:/bin

=========================================
SOLUTION 2
sudo nano ~/.bashrc
CP & PST AT LAST LINE OR BOTTOM
export PATH=/usr/bin:$PATH

source ~/.bashrc
==========================================




Tuesday, October 22, 2019

How to Install and Configure Oracle GlassFish Server 5.1 on Ubuntu, Debian and Linux Mint

October 22, 2019
How to Install and Configure Oracle GlassFish Server 5.1 on Ubuntu, Debian and Linux Mint
 




What is Glassfish ?
GlassFish is an open-source application server project started by Sun Microsystems for the Java EE platform and now sponsored by Oracle Corporation. The supported version is called Oracle GlassFish Server.

GlassFish is free software, dual-licensed under two free software licences: the Common Development and Distribution License (CDDL) and the GNU General Public License (GPL) with the classpath exception.

GlassFish is an open-source application server and the reference implementation of Java EE.

GlassFish 5.1 release supports the latest Java Platform: Enterprise Edition 7/8.
It supports Enterprise JavaBeans, JPA, JavaServer Faces, JMS, RMI, JavaServer Pages, servlets, etc.

Install Oracle Java 7/8
Step1 :- sudo apt-get update

Install python-software-properties
Step2 :- sudo apt-get install python-software-properties

add the new repository and install from Oracle Installer
Step3 :- sudo add-apt-repository ppa:webupd8team/java

Install Java 7/8
Step4 :- sudo apt-get install oracle-java7-installer


After installing, confirm the current Java is Oracle version
Step5 :- java –version

Install Glassfish 5.1

Get Glassfish Zip file
Step6 :- wget download.java.net/glassfish/5.1/release/glassfish-5.1.zip

Install unzip first before unpackage to /opt
Step7 :- apt-get install unzip

Create the directory /opt and then unzip the package to /opt:
Step8 :- unzip glassfish-5.1.zip -d /opt

For convenience, add export PATH=/opt/glassfish4/bin:$PATH to the end of ~/.profile.

Start the glassfish server:
Step9 :- asadmin start-domain

A domain is a set of one or more Glassfish Server instances managed by one administration server.
Default Glassfish Server’s port number: 8080.
Default administration Server’s port number: 4848.
Administration User name: admin
Password: none.

In order to visit admin page (yourserverid:4848) remotely, you need to enable secure admin:

Step10 :- asadmin enable-secure-admin

Restart domain to make effect of secure admin:
Step11 :- asadmin restart-domain

Now you can visit admin page (yourserverid:4848) in browser

To stop the GlassFish server:
Step12 :- asadmin stop-domain


Demo service: deploy hello.war on Glassfish

Download the sample application from Glassfish official samples:
Step12 :- wget https://glassfish.java.net/downloads/quickstart/hello.war

Deploy war file:
Step13 :- asadmin deploy /home/ee/glassfish/sample/hello.war

Now you can visit yourserverid:8080/hello

To undeploy the application:
Step14 :- asadmin undeploy hello

In order to save typing "admin user name" and "password" every time you deploy or undeploy an application, create a password file pwdfile with content:

Step15 :- AS_ADMIN_PASSWORD=your_admin_password

Add --passwordfile in command:

Step16 :- asadmin --passwordfile pwdfile deploy /home/ee/glassfish/sample/hello.war