Start the varnishd daemon,
then run varnishlog to see the heartbeat checking
run varnishncsa to get the apache like request log if you send some request
if using ab to send a lot request, you will see more log entries without surprise.
add one program to the source list,
then you will see the request log in the destination file.
Tuesday, June 12, 2012
Collect varnish log using syslog-ng
How-to: Configure and Install Syslog-ng on centos 5 tutorial
Download and grab one version which has too tar files, one is lib called eventlog, another one is syslog.
compile and install eventlog lib which is required by syslog-ng,
once done, you can find the bit under /usr/local/share/pkgconfig
now export the path to the variable, PKG_CONFIG_PATH and configure syslog
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
otherwise you get error when you configure the syslog,
then ./configure && make && make install
you can run /usr/local/sbin/syslong-ng –V to show the version information.
By default, syslog-ng.conf is located under /usr/share/etc
then change the conf file as the following, we will parse two sources one is from file, another from the syslog client. we will use nc as the testing client,
| @version: 3.3 destination(f_local); |
touch and put some words in the input file, you can tell the message was dumped to the destination.
test some stuff using nc,
Monday, June 11, 2012
How-to: using talend open studio for big data tutorial-3, write data to hbase
once we get data back by running a hive query, the result is always relatively small, so let’s dump it out to hbase. drag one component called hbaseoutput , and config the zookeeper info. that’s what you need to know about the hbase. ( it will figure out which hmaster is active, and which region server to serve the storage.)
Here table will be mapped to keyspace, and we create one random key, both two columns will be mapped the “profile” column family.
click advanced settings tabl to add this cf to the metadata
7 rows are insterted to the hbase and the table was created by talend also. and data is there!
So we did a simple big data etl job, load data from DB to hdfs, then write hive query to do the analysis, and result is pushed to hbase for application query.
hope this helps.
How-to: using talend open studio for big data tutorial-2, read Hive data
Once the data was loaded to HDFS, let’s create hive external table by using the hive shell.
fist make sure data is there,
Then using the hive shell to create one external table named customers
| CREATE EXTERNAL TABLE customers(id INT, name STRING, |
in order for the talend to connect to the hive, we need to start one hive thrift server.
Now let’s create one flow to read the data in hive. pick up the version ,and the thrift server ip/port, then put a hive query.
once import step, click the edit scheme and just add one column with type as object. then we will parse the result and map to our schema.
Click the advanced tab, to enable the parse query results, using the column we just created as object type.
drag the parserecordset component to the surface and conenct the mainout of hiverow to it, click edit schemas to do the mapping.
then match the values,
the the job looks like the following,
if we need to output the row, just put one logrow and connect, the final layout,
Now click to run this job, from the console it tell you whether it has connected to the hive server successfully, if failed, why.
on the hive server, it will show you it receive one query and parse it to mapreduce on the fly,
once done, you can see the results from the run console.
once done, we can export the result to Hbase to enable real-time application query. check it here,
How-to: using talend open studio for big data tutorial-1
Big data has been a hot-topic now, and Talend is very popular in the open source ETL community. however, there was not enough support for big data. recently, talend released a new product with the open source support called Talend Open Studio for Big Data. you can download it and play in your environment, it has built-in support for Big data. I will put several test cases here , then you can get an impression what does the product offer.
![]()
1. FROM DB to HDFSfor the db purpose , I just use the row generator to simulate the rows in db, put some simple logic to create one row serious with 3 columns, ID, name and level,
Then drag and drop the hdfsoutput coponent to the surface, connect the major output of the row generator to the hdfs. for the hdfs, just specify the name node address, and the folder to hold the file
![]()
then click to run the job, it will create a file for you which contains all the rows we generated in a CSV format.
remember to pickup the right version of you hadoop environment, and when done, you can tell the time taken to transfer the rows between two systems.
Once we export the data from traditional db to hdfs, we can run hive query to get the results , that’s the next case to test.