Posts By: jonny

Clearing old Journald Logs

Journald logs can be cleared by timescale or size as follows. Keep only 5 days worth of logs journalctl –vacuum-time=5d Retain only the past 500 MB: journalctl –vacuum-size=500M

Checking if Puppet is Disabled

The puppet agent can be disabled from running with: puppet disable “Some message here” And it can be re-enabled with: puppet enable But to check if puppet is currently disabled there is no check command. Instead look for the existence of the agent_disabled.lock file under: $vardir/state/agent_disabled.lock For the systems I was checking this was at:… Read more »

Exclude Directories for Disk Usage (du)

ncdu

I sometimes want to omit directories from my disk usage (du -sh *) checks. This includes virtual files systems such as proc / dev and also mounts to other filesystems (data in the example below). This is what works for me: du –exclude={proc,sys,dev,data} -sh * The equals sign appears to be optional and worked both… Read more »

Joining Multi-line Output with Paste

Shell

I was checking the memory on approximately 140 servers using ansible: ansible –user root -k -i servers.list -m shell -a “free -h; mysql” test but the output appears over several lines e.g. server103.domain.dev | SUCCESS | rc=0 >> total used free shared buffers cached Mem: 94G 44G 49G 59M 203M 4.6G -/+ buffers/cache: 39G 54G… Read more »

Datanode denied communication with namenode

In a Cloudera cluster we had a few nodes reporting the following error message in the logs under hadoop-cmf-hdfs-DATANODE-whatever.com.log.out The error included: Datanode denied communication with namenode because the host is not in the include-list: : DatanodeRegistration One solution could be to ‘Refresh Node List’ as shown in the screenshot below. Find it by clicking… Read more »

Set NTP Server on Windows Domain Controller

On the Windows Domain Controller I checked the current NTP settings with: w32tm /query /configuration   I tried a few alternative commands and got errors such as “the rpc server is unavailable”. The command that worked was: w32tm /config /manualpeerlist:time.windows.com /syncfromflags:manual /reliable:yes /update After issuing that command I could see the ntp server listed when… Read more »

Windows Nagios Checks using NSClient

Munin Alternative Template

I wanted to add some checks to a Windows server and the methods seem to have changed a little over the years. At the moment I have amended the nsclient.ini file on the Windows box with: CheckDisk=1 CheckSystem=1 Then from the Nagios box I can check CPU with a threshold as follows: /usr/lib64/nagios/plugins/check_nrpe -H winserver001.domain.tld… Read more »

Browsing Hadoop HDFS on the Command Line

Using the Hadoop command we can send fairly regular filesystem commands to navigate HDFS. On Cloudera I am sending commands to port 8020 of the active name node. If you don’t have the hadoop command available on your system you need to download hadoop, extract it and add the bin directory to your path. For… Read more »

Labeling Partitions with LABEL and PARTLABEL

So working on a system that had incorrect partitioning configured.  In /etc/fstab the partitions were configured with: PARTLABEL=data1 /data1 ext4 defaults 0 0 PARTLABEL=data2 /data2 ext4 defaults 0 0 but the partitions did not have PARTLABELS set. The LABEL and PARTLABEL can be viewed with: lsblk -o name,label,partlabel,mountpoint,size,uuid To set the label property use: e2label… Read more »

Cloudera Hue User Password Reset

I needed to access the Hue file browser service  and for my version of cloudera this was: cd /opt/cloudera/parcels/CDH-5.7.6-1.cdh5.7.6.p0.6/lib/hue Run the createuser command: ./build/env/bin/hue createsuperuser Username (leave blank to use ‘joebloggs’): Email address: joebloggs@whatever.tld Password: Password (again): Superuser created successfully.