2019-05-21

Install Docker on Ubuntu



Install Docker on Ubuntu 14.04 LTS



   1. Check current kernel version use  uname -r     uname -r
     3.19.0-25-generic

   2. Update apt source.     apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys     
     58118E89F3A912897C070ADBF76221572C52609D

   3. Open /etc/apt/sources.list.d/docker.list file and Remove existing entries.
     vi /etc/apt/sources.list.d/docker.list
     if the file doesn't exist, create it.
 
   4. Add below enties.  
     deb https://apt.dockerproject.org/repo ubuntu-trusty main

   5. Save and close. 

   6. Update Ubuntu pakage
     Docker#apt-get update

   7. install both the required and optional packages.
     Docker#apt-get install linux-image-generic-lts-trusty

   8. reboot your host
     Docker#reboot



Install Docker

 
  1. Login your Ubuntu Host, as a root or user with sudo privileges.
     apt-get update

  2. Install Docker
   apt-get install docker-engine

  3. Verifi Docker Service running.
    service docker start
    start: Job is already running: docker
    docker -v
    Docker version 1.9.1, build a34a1d5

Stop / Remove all Docker Containers.



Stop / Remove all Docker Containers.


 Use the following command.


 1) Stop all Containers.
   docker stop $(docker ps -a -q)

 2) Remove all Containers.


docker rm $(docker ps -a -q)

Selinux disable setting



기본적으로 SELINUX는 활성화 되어 있다. 서버 작업시 SELINUX 로 인해 제한을 받는 경우가 종종 발생하게 
되는데 아래와 같이 SELINUX 를 disabled 로 변경하면 비활성화가 된다. 

SELINUX=disabled

SELIX 설정 파일은 아래와 같다. 
Centos   :   vi  /etc/sysconfig/selinux
Ubuntu  :    vi /etc/selinux/config

   # This file controls the state of SELinux on the system.
   # SELINUX= can take one of these three values:   #     enforcing - SELinux security policy is enforced.   #     permissive - SELinux prints warnings instead of enforcing.   #     disabled - No SELinux policy is loaded.   SELINUX=enforcing        ##   ==>   SELINUX=disabled 로 변경.
   # SELINUXTYPE= can take one of these two values:   #     targeted - Targeted processes are protected,   #     mls - Multi Level Security protection.   SELINUXTYPE=targeted

바로 적용은 되지 않으며 재부팅을 해야 적용이 된다.

재부팅을 하지 않고 현재 접속된 터미널에 한해 변경된 내용을 적용하고 싶을 경우 다음의 명령어를 실행하면 된다. 

/usr/sbin/setenforce 0 

Adding Ubuntu 16.04 LTS Template in XenServer 6.2



Many people have been having a few issues when installing Ubuntu 16.04 LTS or 14.04 LTS template on a XenServer 6.2 since they dont normally see the templates on the installation screen. Hope the following solution will help. Following some research online and trial and error, i found a solution on how to Add Ubuntu 16.04 LTS Template in XenServer 6.2

The firstt thing you need to do is update the  pygrub in Xenserver, to do so edit

 /usr/lib/python2.4/site-packages/grub/GrubConf.py

drop down to line 428, change the following lines


Change

if arg.strip() == "${saved_entry}":
to:
 if arg.strip() == "${saved_entry}" or arg.strip() == "${next_entry}":

Create new templates for Ubuntu

To add Ubuntu 16.04 LTS template on the  XenServer host, you need to type in the following commands.

For Ubuntu 16.04 Template

$ UUID=`xe template-list name-label="Ubuntu Precise Pangolin 12.04 (64-bit)" params=uuid --minimal`
$ NEW_UUID=`xe vm-clone uuid=$UUID new-name-label="Ubuntu Xenial 16.04 (64-bit)"`
$ xe template-param-set other-config:default_template=true other-config:debian-release=xenial uuid=$NEW_UUID

For Ubuntu 14.04 Template

$ UUID=`xe template-list name-label="Ubuntu Precise Pangolin 12.04 (64-bit)" params=uuid --minimal`
$ NEW_UUID=`xe vm-clone uuid=$UUID new-name-label="Ubuntu Trusty 14.04 (64-bit)"`
$ xe template-param-set other-config:default_template=true other-config:debian-release=trusty uuid=$NEW_UUID

Now open XenCenter and right click on XenServer host and click New VM, you should see the template on the list, the rest of the steps are easy, just follow the directions on the screen.

Xen Server Bootoption 설정



1. VM machine uuid 확인.

   $ xe vm-list

     uuid ( RO)           : 79ce516a-d6e2-97bc-ee76-178a50d62691
         name-label ( RW): Name of VMMachine
         power-state ( RO): running


2. VM Machine bootoption 변경. 

  $ xe vm-param-set uuid=79ce516a-d6e2-97bc-ee76-178a50d62691 HVM-boot-policy=BIOS\ order


3. result

before
 


after

장비 Serial Number 확인 방법



Windows Machine Serial Number check



1. Window 

   => wmic bios get SerialNumber

   



Ntopng Install & configuration



NTOPNG                                                              Ntopng는 기존 Ntop에서 업그레이드 된 버전으로 웹 인터페이스를 통하여 관리 메니징이  가능하며, 훨신 깔끔해지고 보기 편한 UI를 제공한다. 또한 CPU와 메모리 사용량을 감소시켜 자원 활용에도 용이하다.


 필자는 가상화에서도 Ntop을 테스트 해 보았는데 무리없이 동작하는 것을 확인하였다. 단 가상화에서의 이슈가 발생하여 물리 서버로 Ntop서버를 설치하였는데.. 가상화 이슈에 대해서는 추후에 포스팅 해 보도록 할 예정이다.

 Ntopng 는 유닉스(Lunux, *BSD, and MacOSX) 및 윈도우(including windows7/8) 플랫폼을 모두 지원한다.

 Ntopng에 대한 자세한 사항은 홈페이지 참조 : http://www.ntop.org/products/ntop/ 


Ntop 설치 방법 

준비 사항 : NTOP 서버 1대(물리서버), 랜포트 2개 이상
  - Management용 1개, 트래픽 모니터링용 1개, 
  - OS : CentOS6.5 64bit

EPEL6 Repositoiry 추가

yum -y install http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

vi 편집기로 ntop.repo 파일 오픈 후 ntop repository 추가

vi /etc/yum.repos.d/ntop.repo

아래의 내용 추가

[ntop]
name=ntop packages
baseurl=http://www.nmon.net/centos/$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://www.nmon.net/centos/RPM-GPG-KEY-deri


repository 업데이트 및 ntopng 및 패키지 설치.

yum clean all
yum update
!
yum install pfring n2disk nProbe ntopng ntopng-data


ntopng.start 파일 수정.

vi /etc/ntopng/ntopng.start


모니터링할 IP 대역 설정.

--local-networks "192.168.0.0/24"
--interface 0


ntopng.conf.sample 파일 복사

cp /etc/ntopng/ntopng.conf.sample /etc/ntopng/ntopng.conf

방화벽에 Ntopng Management Port 허용

vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3000 -j ACCEPT

방화벽 재시작 및 ntopng 시작

service iptables restart
!
service redis start
service ntopng start


설정 완료 후 http://ntopserverIP:3000 으로 접속. 

기본 ID/PW는 admin/admin

Elasticsearch Heap Size

  Elasticsearch는 Java 기반으로 동작을 합니다. Java는 가비시 컬렉터 (garbage-collected)에 의해서 관리가 되며, Java 객체는 힙(Heap) 이라고하는 메모리의 런타임 영역에 상주합니다.  Elasticsear...