Monday, August 31, 2015

How to test UDP port is responding

Using the following command will do the trick.

# nc -zuv 3 192.168.123.123 5140
Connection to 192.168.123.123 5140 port [udp/*] succeeded!

Tuesday, August 25, 2015

Linux Biscuit!


Docker 1.8 with td-agent 2.2.1 container

This is a quick guide on setting up td-agent container with Docker 1.8

  1. Create a directory to store your dockerfile and td-agent config file. 
  2. mkdir ~/td-agent-es && cd ~/td-agent-es
    
  3. Create a dockerfile as shown below
  4. Create td-agent.conf file as shown below
  5. Build the docker image
  6. docker build -t td-agent-es .
    
  7. Start elasticsearch container. As you can see from the td-agent.conf, the td-agent container will link to this elasticsearch container. Please note that this setup is not using any persistent storage mapping. You can refer to this link for more information on how to setup that mapping.
  8. docker run -d -p 9200:9200 -p 9300:9300 --name es elasticsearch
    
  9. Start your td-agent container 
  10. docker run -d -p 24224:24224 --link es:es --name td-agent td-agent-es
    
  11. Launch a hello-world to see if td-agent is forwarding log to elasticsearch container. Please note that Docker 1.8 add fluentd as one of the logging-driver. So this command will not work if you are using Docker with older version
  12. docker run --log-driver=fluentd --log-opt fluentd-address=[your-host-IP-address]:24224 hello-world
  13. Use the following command to check if elasticsearch container is receiving log. You can check container ID or container name using docker ps -a
  14. curl -XGET 'http://[your-host-IP-address]:9200/_all/_search?q=*'
    

Tuesday, August 18, 2015

Install jobber on CentOS 6.*


All the commands below are executed using root user
  1. Install go and git if you not already do so
  2. yum install go
    yum install git
  3. You need to specify workspace directory, this can be any path in your system. For this example, i use the following directory as the workspace - /home/amd/go
  4. Set the $GOPATH to this workspace directory
  5. export GOPATH=/home/amd/go
    
  6. Change directory to your workspace directory and run the following command to get the jobber files.
  7. go get github.com/dshearer/jobber
    
  8. As git supplied by CentOS 6 is version 1.7.1 and it cannot handle gopkg.in in package properly. If this is not down, you will encounter hang problem during compilation process. So you need to manually get the yaml.v2 package.
  9. git clone --branch v2 https://github.com/go-yaml/yaml $GOPATH/src/gopkg.in/yaml.v2
    
  10. Compile jobber package
  11. make -C src/github.com/dshearer/jobber
    
  12. Before proceed to next step, install daemonized if not already do so.
  13. yum install daemonize
    
  14. Install jobber
  15. make install -C src/github.com/dshearer/jobber
    
  16. Running the following command and you can see jobber service is running.
  17. service jobber status
    
  18. To create a scheduled job, you need to create .jobber file under user home directory. jobber file are written in YAML format.
  19.  ---
    - name: DailyBackup
      cmd: backup daily
      time: 0 0 13
      onError: Stop
      notifyOnError: false
      notifyOnFailure: true
    
  20. Once it is created, you need to load the job
  21.  /usr/local/bin/jobber reload
    
  22. You can check the log of the job using this command.
  23.  /usr/local/bin/jobber log
    

Wednesday, August 12, 2015

Oracle 12c ORA-04030

If you encounter such error on Windows system, please don't just look at physical memory usage but also committed memory usage which includes physical memory and page file. You could be in such situation where there is still free physical memory but running out of pagefile.

To check on the metrics, you can go to Task Manager - Performance tab - Memory. Look at the value under Committed. In this screenshot below, the system commit limit is 50.3GB and current committed usage is 9.3GB.


To find out more on what processes that consume the committed memory, you can go to Details tab. By default Commit size column is not shown in this tab. To make it visible, you need to right click on any of column title and click Select columns.


Select Commit size


You can see the Commit size column now. Among all the processes, you can see that oravssw.exe actually has much larger Commit Size compare to Memory. And this is possible the culprit for this our-of-memory issue.


So what is oravssw.exe? It is Oracle VSS Writer and it is used by a lot of backup software to perform Oracle backup. Unfortunately, there is a bug for this software that cause memory leaking according to this note (Doc ID 1358570.1)  from Oracle. There is no fix for this yet but only workaround which is to disable this service or perform service restart after backup. Although is not pretty but at least you don't need to bother with ORA-04030 issue again.