How to build Ceph storage on CentOS7

Standard

Initialization

set disabled in /etc/selinux/config

yum update -y
yum install ntp -y

systemctl disable NetworkManager
sysetmctl disable firewalld
systemctl enable ntpd
systemctl start ntpd

BUILD PREREQUISITES (optional)

yum install make automake autoconf boost-devel fuse-devel gcc-c++ libtool libuuid-devel libblkid-devel keyutils-libs-devel cryptopp-devel fcgi-devel libcurl-devel expat-devel gperftools-devel libedit-devel libatomic_ops-devel snappy-devel leveldb-devel libaio-devel xfsprogs-devel git libudev-devel

 

Setup CEPH

yum install epel-release -y
yum install ceph ceph-deploy -y

ssh-copy-id ceph1
#(repeat the command for each Ceph node, like ceph2, ceph3 and so on…)

mkdir /root/ceph_config
cd /root/ceph_config

#on mngt node or primary monitor node.
ceph-deploy new ceph1 ceph2 ceph3

#install ceph software on node.
ceph-deploy -v install ceph1 ceph2 ceph3

#initial monitors and gather the keys. This will place the keys into your ceph-deploy directory.
ceph-deploy mon create-initial

#Define the admin node (in this case is ceph1 node)
ceph-deploy admin ceph1 ceph2 ceph3

#Prepare the disks and add osd to the cluster
#ceph-deploy -v osd create [osd_node:[disk(data):[disk(journal)]]
for i in ceph1 ceph2 ceph3; 
do
ceph-deploy -v osd create $i:sdb --zap;
done

 

Testing

ceph status
ceph osd lspools
ceph health
ceph osd tree
#check client.
ceph osd crush dump --format=json-pretty 
#check conf and status
ceph osd dump --format=json-pretty 
ceph-deploy disk list osd0

#Prepare for testing
yum install -y https://ceph.com/rpm-testing/rhel7/x86_64/kmod-libceph-3.10-0.1.20140702gitdc9ac62.el7.x86_64.rpm
yum install -y https://ceph.com/rpm-testing/rhel7/x86_64/kmod-rbd-3.10-0.1.20140702gitdc9ac62.el7.x86_64.rpm

#Mount RBD
modprobe rbd

For mount RBD to CentOS7 [Link]

 

 

 

REF:
http://blog.domb.net/?p=986
http://karan-mj.blogspot.fi/2013/12/ceph-storage-part-2.html
http://blog.zhaw.ch/icclab/deploy-ceph-and-start-using-it-end-to-end-tutorial-installation-part-13/
http://www.jamescoyle.net/how-to/1244-create-a-3-node-ceph-storage-cluster
http://www.virtualtothecore.com/en/adventures-ceph-storage-part-4-deploy-the-nodes-in-the-lab/
http://ceph.com/docs/master/rados/deployment/ceph-deploy-osd/
http://blog.mit.bme.hu/meszaros/en/unix/ceph-rbd-client
http://www.server-world.info/en/note?os=CentOS_6&p=ceph&f=2

 

 

How to setup Exchange server 2013 on Windows 2012 R2

Standard

Scenario

Consist of 3 servers:

  1. AD server
  2. Mailbox role server
  3. CAS role server (Client Access Server)

*Use Windows server 2012R2 Std. installed on all server.

 

AD server (Active Directory Server)

Preparing and setting up AD

First, add role and feature “Active Directory Domain Services”

Promote AD by use command: dcpromo

Active Directory preparation can occur as part of the installation of the first Exchange Server 2013 server, you can also run the Active Directory preparation as a separate task beforehand on a 64-bit server running Windows Server 2008 or higher.

Because the Active Directory preparation requires the RSAT-ADDS tools I am running it on the domain controller in my test lab.

Alternatively, you can install the tools on a member server to run Exchange 2013 Active Directory preparation.

For Windows Server 2012, in PowerShell run:

%CODE1%

And prepare schema

%CODE2%

If you are installing Exchange Server in the AD forest for the first time run the following Exchange 2013 setup command to prepare Active Directory:

%CODE3%

Note: if your organization name contains spaces then it must be enclosed in quotes as shown above.

And Reboot  AD server!!

 

 

CAS role server

Prepare CAS role

Run the following command to install the required Windows components:

%CODE4%

*A restart is required after the roles and features have finished installing.

Next, install the following software. This is the same requirement as the Mailbox server role just without the Office Filter Pack.

Unified Communications Managed API 4.0 Runtime

http://www.microsoft.com/en-us/download/details.aspx?id=34992

*should be reboot once. (optional)

Setting up CAS role

Double click Setup.exe from Exchange2013.iso

And tick “Client Access Role” on checkbox then install it.

 

 

Mailbox role server

Prepare Mailbox role

Run the following command to install the required Windows components:

%CODE4%

*A restart is required after the roles and features have finished installing.

Next, install the following software in this order.

Unified Communications Managed API 4.0 Runtime

http://www.microsoft.com/en-us/download/details.aspx?id=34992

Microsoft Office 2010 Filter Pack 64 bit

http://www.microsoft.com/en-us/download/details.aspx?id=17062

Microsoft Office 2010 Filter Pack SP1 64 bit

http://www.microsoft.com/en-us/download/details.aspx?id=26604

*should be reboot once. (optional)

Setting up Mailbox role

Double click Setup.exe from Exchange2013.iso

And tick “Mailbox Role” on checkbox then install it.

 

 

REFERENCE
http://exchangeserverpro.com/install-exchange-2013-pre-requisites-windows-server-2012/
http://exchangeserverpro.com/how-to-install-exchange-server-2013/
https://technet.microsoft.com/en-us/library/bb125224(v=exchg.150).aspx
https://technet.microsoft.com/en-us/library/bb691354(v=exchg.150).aspx
http://www.mustbegeek.com/install-exchange-server-2013-in-windows-server-2012/

How to build slave DNS without DirectAdmin on CentOS 6

Standard

Scenario, i want to use slave DNS from DirectAdmin is master DNS and i have found a topic  talk about solution for it. it name is DirectSlave (Link). This program use api for connect to DirectAdmin’s master DNS.
In this case, i use DirectSlave version 1.3.

Thank you roman_m so much.

Pre-installation
it explain from README file in folder DirectSlave

Download DirectSlave from (Link)

and move to this path:  /usr/local/ 

# yum install named -y

MODULES
=======
POSIX = system features package (bundled in perl distr)
FindBin = to find relative directories (lib etc)
CGI = CGI implementation
Crypt::PasswdMD5 = for password encryption
Digest::MD5 = for stronger password encryption
Config::Auto = to read and parse etc/directslave.conf
MIME::Base64 = authenticating incoming connections
Net::Server = main server & daemon realisation
Net::CIDR = for checking access hosts

**but i use yum to install that modules.

Configuration

# chown -R root:named /usr/local/directslave

(before edit directslave.conf you may be keep original file)

edit file /usr/local/directslave/etc/directslave.conf follow this:

%CODE1%

and prepare file and folder for it.

mkdir -p /etc/named/secondary
touch /etc/namedb/directslave.conf   #not same with before directslave.conf

add this line into /etc/named.conf :
include “/etc/named/secondary/named.conf”

Add auth entry to config, run
# /usr/local/directslave/bin/pass admin yourhardtoreadpassword

Set `background 0` in config for tests and go

and use this command for test.

# /usr/local/directslave/bin/directslave
You must see output like this

2012/06/22-01:18:53 main (type Net::Server::HTTP -> MultiType -> Net::Server::Fork) starting! pid(57841)
Binding to TCP port 2222 on host 212.109.44.44 with IPv4

In /etc/named.conf some line follow this:

%CODE2%

Note

***Set `background 1` and start directslave daemonized

stop directslave process
# kill `cat /usr/local/directslave/run/directslave.pid`

 

REF:
https://forum.directadmin.com/showthread.php?t=43924

How to install MRTG on CentOS 6.5

Standard

ก่อนอื่นก็ต้อง yum กันก่อนหลักๆคือ mrtg, snmp, http, cron, ในส่วนนี้เหลือแต่ mrtg และ snmp

yum install mrtg net-snmp net-snmp-utils

แก้ในส่วนของ snmp.conf

# Here is a commented out example configuration that allows less
# restrictive access.

##       sec.name  source          community
com2sec  local     localhost       public

##     group.name sec.model  sec.name
group MyRWGroup v1         local
group MyRWGroup v2c        local
group MyRWGroup usm        local

##          incl/excl subtree   mask
view all    included  .1        80

## context             sec.model sec.level prefix read   write  notif
access MyRWGroup ""    any       noauth    exact  all    all    none

start and turn on run level snmpd service:

chkconfig snmpd on
service snmpd restart

ทดสอบว่าเจอ interface และ ip นั้นๆ

snmpwalk -v 1 -c public localhost IP-MIB::ipAdEntIfIndex

create mrtg.cfg by this command:

cfgmaker --global 'WorkDir: /var/www/mrtg' --global 'Options[_]: bits,growright' --no-down --zero-speed=1000000000 --noreversedns --output /etc/mrtg/mrtg.cfg --ifdesc=name --snmp-options=:::::2 public@localhost

สุดท้ายใช้คำสั่ง indexmaker เพื่อ create web pages:

indexmaker /etc/mrtg/mrtg.cfg > /var/www/mrtg/index.html

Verify Cronjob

cat /etc/cron.d/mrtg

 

ถ้าหากเข้าในหน้า http:///mrtg/ ไม่ได้เพราะ permission ให้เข้าไปแก้ httpd.conf

   
 
    Order allow,deny
    Allow from all
    Allow from 127.0.0.1
    Allow from ::1

 

REF:
http://www.cyberciti.biz/faq/centos-fedora-linux-multi-router-traffic-grapher-tutorial/
http://www.icez.net/blog/28/ลง-mrtg-บน-centosfedora-แบบง่ายๆ
http://www.pmoghadam.com/homepage/HTML/MRTG-cpu-mem-hdd-linux.html
https://wiki.archlinux.org/index.php/Multi_Router_Traffic_Grapher
http://net-snmp.sourceforge.net/tutorial/tutorial-4/mrtg/