Installing DCOS CLI for Mesos

To install the DCOS CLI:

Install virtualenv. The Python tool virtualenv is used to manage the DCOS CLI’s environment.

$ sudo pip install virtualenv

Tip: On some older Python versions, ignore any ‘Insecure Platform’ warnings. For more information, see https://virtualenv.pypa.io/en/latest/installation.html.

From the command line, create a new directory named dcos and navigate into it.

$ mkdir dcos
$ cd dcos
$ curl -O https://downloads.mesosphere.io/dcos-cli/install.sh

Run the DCOS CLI install script, where <hosturl> is the hostname of your master node prefixed with http://:

$ bash install.sh <install_dir> <mesos-master-host>

For example, if the hostname of your mesos master node is mesos-master.example.com:

$ bash install.sh . http://mesos-master.example.com

Follow the on-screen DCOS CLI instructions and enter the Mesosphere verification code. You can ignore any Python ‘Insecure Platform’ warnings.

Confirm whether you want to add DCOS to your system PATH:

$ Modify your bash profile to add DCOS to your PATH? [yes/no]

Since DCOS CLI is used for DCOS cluster, need to reconfigure Marathon and Mesos masters urls with the following commands:

dcos config set core.mesos_master_url http://<mesos-master-host>:5050
dcos config set marathon.url http://<marathon-host>:8080

Configure NTP Client and Server Centos

Configure NTP Client and Server Centos

Install NTP

The ntp package is same for client and server. This package will synchronize your server’s time via NTP protocol. In my example server’s address is 192.168.0.1 and client’s address is 192.168.0.2.

# yum -y install ntp

 

Configure NTP server

Make sure the following lines exists in /etc/ntp.conf. Stratum is used to synchronize the time with the server based on distance.

server ntp.server.com
server 127.127.1.0
furge 127.127.1.0 stratum 10

 

Start the NTP service

For SysVinit based systems run:

service ntpd start

For Systemd systems run:

systemctl start ntpd.service

 

Configure NTP client

Make sure the following line exists in /etc/ntp.conf.

It might take about 15 minutes until ntp will synchronize the clock.
server 192.168.0.1

Now start the NTP service same as above.

 

Debug the NTP service

There are several useful commands you can use when working with NTP. Here are some of them.

To sync the clock:

service ntpd stop && ntpd -dgq && service ntpd start

Show ntp sync status:

ntpq -pn

Checking the Memory Usage Linux

Checking Memory in Linux

Sometimes you want to check your memory usage and there are a lot of tools to do so. I”ll try to explain about some most useful tools to check memory usage of your system.

free

knesenko@knesenko-centos7:~$ free -m
total used free shared buffers cached
Mem: 3778 861 2916 16 84 451
-/+ buffers/cache: 325 3452
Swap: 2047 0 2047

What you can see here, is that total amount of your memory is 3778 MB325 MB are used by processes. 3452 MB are free yo use. Last line shows you the swap usage.


/proc/meminfo

Also you can check /proc/meminfo

knesenko@knesenko-centos7:~$ egrep --color 'Mem|Cache|Swap' /proc/meminfo

MemTotal: 3869004 kB

MemFree: 2986092 kB

MemAvailable: 3392864 kB

Cached: 479408 kB

SwapCached: 0 kB

SwapTotal: 2097148 kB

SwapFree: 2097148 kB

vmstat

vmstat shows you a bit more info about your memory and other resources usage.

knesenko@knesenko-centos7:~$ vmstat

procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----

r b swpd free buff cache si so bi bo in cs us sy id wa st

2 0 0 2986092 87172 462452 0 0 2  8  39 73 0  0  100 0 0

procs: 
r: How many processes are waiting for CPU time.
b: Wait Queue – Process which are waiting for I/O (disk, network, user input,etc..) 

memory: 
swpd: shows how many blocks are swapped out to disk (paged). Total Virtual memory usage. 

free: Idle Memory

buff: Memory used as buffers, like before/after I/O operations
cache: Memory used as cache by the OS

swap: 
si: How many blocks per second the operating system is swapping in. i.e Memory swapped in from the disk (Read from swap area to Memory)
so: How many blocks per second the operating system is swapped Out. i.e Memory swapped to the disk (Written to swap area and cleared from Memory). In Ideal condition, We like to see si and so at 0 most of the time, and we definitely don’t like to see more than 10 blocks per second.

io: 
bi: Blocks received from block device – Read (like a hard disk) 
bo: Blocks sent to a block device – Write

system: 
in: The number of interrupts per second, including the clock. 
cs: The number of context switches per second. 

CPU: 
us: percentage of cpu used for running non-kernel code. (user time, including nice time) 
sy: percentage of cpu used for running kernel code. (system time – network, IO interrupts, etc) 
id: cpu idle time in percentage.
wa: percentage of time spent by cpu for waiting to IO.

knesenko@knesenko-centos7:~$ vmstat -s
      3869516 K total memory
      1758256 K used memory
       279100 K active memory
      1317776 K inactive memory
      2111260 K free memory
        59584 K buffer memory
      1331872 K swap cache
      2097148 K total swap
            0 K used swap
      2097148 K free swap
        15833 non-nice user cpu ticks
            9 nice user cpu ticks
        26954 system cpu ticks
      6886801 idle cpu ticks
          319 IO-wait cpu ticks
            5 IRQ cpu ticks
         2636 softirq cpu ticks
            0 stolen cpu ticks
       340359 pages paged in
      1229646 pages paged out
            0 pages swapped in
            0 pages swapped out
     10782519 interrupts
     21597473 CPU context switches
   1424333862 boot time
         8042 forks

 

Also I would recommend to use top, htop commands.