You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by huaxiang <hu...@asiainfo-linkage.com> on 2013/03/30 15:53:33 UTC

答复: how to reduce zookeeper.out

KEVIN,
   This file is usualy could be found under "bin" directory, that is
"bin/zookeeper.out". 
    

  

-----邮件原件-----
发件人: Kevin O'dell [mailto:kevin.odell@cloudera.com] 
发送时间: 2013年3月30日 22:47
收件人: user@hbase.apache.org
主题: Re: how to reduce zookeeper.out

Hua,

  That is no fun.  Another question though, I just checked my clusters and I
don't even have a zookeeper.out.  What messages do you have filing this file
up?

On Sat, Mar 30, 2013 at 10:42 AM, hua beatls <be...@gmail.com> wrote:

> Hi Kevin,
>      seems there is no rolling mechanizm for the zookeeper.out.
>
>
>
>
> On Sat, Mar 30, 2013 at 10:31 PM, Kevin O'dell 
> <kevin.odell@cloudera.com
> >wrote:
>
> > Hi Hua,
> >
> >   I believe(don't quote me) that you can use the rolling file 
> > appender to set the files to a max size.  I know HBase does this, 
> > but I am not sure about ZK.
> >
> > On Sat, Mar 30, 2013 at 10:22 AM, Jean-Marc Spaggiari < 
> > jean-marc@spaggiari.org> wrote:
> >
> > > Hi,
> > >
> > > If you are in production you should have more than 1 ZK server, right?
> > > Like, 3 or more?
> > >
> > > Then you can just shut one down, the others mike elect a new leader.
> > > Then you clear the zookeeper.out file, and start it back?
> > >
> > > JM
> > >
> > > 2013/3/30 hua beatls <be...@gmail.com>:
> > > > Hi,
> > > >     zookeeper.out is too large, how to reduce this file? it is a
> online
> > > > system.
> > > >
> > > >    Best R.
> > > >
> > > >   beatls
> > >
> >
> >
> >
> > --
> > Kevin O'Dell
> > Customer Operations Engineer, Cloudera
> >
>



--
Kevin O'Dell
Customer Operations Engineer, Cloudera


Re: 答复: 答复: how to reduce zookeeper.out

Posted by Ashish <pa...@gmail.com>.
On Sun, Mar 31, 2013 at 6:55 PM, huaxiang <hu...@asiainfo-linkage.com>wrote:

> Hi,
>   If console logger is removed, then the console message will be output to
> the zookeeper.log files?
>

All the log statements dumped on Console are emitted via CONSOLE logger.
However, your process may write via System.out/err and it's always a good
practice to have these messages on captured ( 2>&1). And Zookeeper by
default dumps them to zokeeper.out


>   Should I uncomment the said value setting like '#
> zookeeper.console.threshold=WARN' and then restart zookeeper demon? This is
> a online system.
>

Always test things before messing with Production systems, no matter how
trivial they are :)


>
> Thanks!
>
> beatls
>
>
>
> -----邮件原件-----
> 发件人: Ashish [mailto:paliwalashish@gmail.com]
> 发送时间: 2013年3月31日 20:46
> 收件人: user@hbase.apache.org
> 主题: Re: 答复: how to reduce zookeeper.out
>
> zookeeper.out is specified in bin/zkServer.sh
>
> IMHO, you can remove console logger. All your logs shall anyways be part of
> log files, and any output from zookeeper process on console shall be
> captured in zookeeper.out.
>
> If you still prefer to have CONSOLE logger, use this property to reduce
> logs
> generated.
> zookeeper.console.threshold=WARN
>
> Thanks
> ashish
>
>
> On Sun, Mar 31, 2013 at 6:04 PM, huaxiang
> <hu...@asiainfo-linkage.com>wrote:
>
> > Hi,
> >    Below is the [zk_dir]/conf/log4j.properties:
> > [root@hadoop1 conf]# more log4j.properties # Copyright 2012 The Apache
> > Software Foundation # # Licensed to the Apache Software Foundation
> > (ASF) under one # or more contributor license agreements.  See the
> > NOTICE file # distributed with this work for additional information #
> > regarding copyright ownership.  The ASF licenses this file # to you
> > under the Apache License, Version 2.0 (the # "License"); you may not
> > use this file except in compliance # with the License.  You may obtain
> > a copy of the License at #
> > #     http://www.apache.org/licenses/LICENSE-2.0
> > #
> > # Unless required by applicable law or agreed to in writing, software
> > # distributed under the License is distributed on an "AS IS" BASIS, #
> > WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> > # See the License for the specific language governing permissions and
> > # limitations under the License.
> >
> > # Define some default values that can be overridden by system
> > properties zookeeper.root.logger=INFO, CONSOLE
> >
> > zookeeper.console.threshold=INFO
> >
> > zookeeper.log.dir=.
> > zookeeper.log.file=zookeeper.log
> > zookeeper.log.threshold=INFO
> > zookeeper.log.maxfilesize=256MB
> > zookeeper.log.maxbackupindex=20
> >
> > zookeeper.tracelog.dir=.
> > zookeeper.tracelog.file=zookeeper_trace.log
> >
> > log4j.rootLogger=${zookeeper.root.logger}
> >
> > #
> > # console
> > # Add "console" to rootlogger above if you want to use this #
> > log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
> > log4j.appender.CONSOLE.Threshold=${zookeeper.console.threshold}
> > log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
> > log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601}
> > [myid:%X{myid}]
> > - %-5p [%t:%C{1}@%L] - %m%n
> >
> > #
> > # Add ROLLINGFILE to rootLogger to get log file output #
> > log4j.appender.ROLLINGFILE=org.apache.log4j.RollingFileAppender
> > log4j.appender.ROLLINGFILE.Threshold=${zookeeper.log.threshold}
> > log4j.appender.ROLLINGFILE.File=${zookeeper.log.dir}/${zookeeper.log.f
> > ile}
> > log4j.appender.ROLLINGFILE.MaxFileSize=${zookeeper.log.maxfilesize}
> > log4j.appender.ROLLINGFILE.MaxBackupIndex=${zookeeper.log.maxbackupind
> > ex} log4j.appender.ROLLINGFILE.layout=org.apache.log4j.PatternLayout
> >
> > I cannot find the zookeeper.log, but find the zookeeper.out under the
> > bin/zookeeper.out.
> >
> > Thanks!
> >
> > beatls
> >
> > -----邮件原件-----
> > 发件人: Azuryy Yu [mailto:azuryyyu@gmail.com]
> > 发送时间: 2013年3月30日 23:02
> > 收件人: user@hbase.apache.org
> > 主题: Re: how to reduce zookeeper.out
> >
> > you can edit [zk_dir]/conf/log4j.properties, such as mine:
> >
> > log4j.rootLogger=INFO, DEBUG, ERROR
> >
> > # DEBUG
> > log4j.appender.DEBUG=org.apache.log4j.DailyRollingFileAppender
> > log4j.appender.DEBUG.Threshold=DEBUG
> > log4j.appender.DEBUG.layout=org.apache.log4j.PatternLayout
> > log4j.appender.DEBUG.layout.ConversionPattern=%d{ISO8601} - %-5p
> > [%t:%C{1}@%L]
> > - %m%n
> > log4j.appender.DEBUG.datePattern='.'yyyy-MM-dd'.log'
> > log4j.appender.DEBUG.append=true
> > log4j.appender.DEBUG.File=/home/user/zk_logs/zk_debug.log
> >
> > # INFO
> > log4j.appender.INFO=org.apache.log4j.DailyRollingFileAppender
> > log4j.appender.INFO.Threshold=INFO
> > log4j.appender.INFO.layout=org.apache.log4j.PatternLayout
> > log4j.appender.INFO.layout.ConversionPattern=%d{ISO8601} - %-5p
> > [%t:%C{1}@%L]
> > - %m%n
> > log4j.appender.INFO.datePattern='.'yyyy-MM-dd'.log'
> > log4j.appender.INFO.append=true
> > log4j.appender.INFO.File=/home/user/zk_logs/zk_info.log
> >
> > # ERROR
> > log4j.appender.ERROR=org.apache.log4j.DailyRollingFileAppender
> > log4j.appender.ERROR.Threshold=ERROR
> > log4j.appender.ERROR.layout=org.apache.log4j.PatternLayout
> > log4j.appender.ERROR.layout.ConversionPattern=%d{ISO8601} - %-5p
> > [%t:%C{1}@%L]
> > - %m%n
> > log4j.appender.ERROR.datePattern='.'yyyy-MM-dd'.log'
> > log4j.appender.ERROR.append=true
> > log4j.appender.ERROR.File=/home/user/zk_logs/zk_error.log
> >
> >
>
>
> --
> thanks
> ashish
>
> Blog: http://www.ashishpaliwal.com/blog
> My Photo Galleries: http://www.pbase.com/ashishpaliwal
>
>


-- 
thanks
ashish

Blog: http://www.ashishpaliwal.com/blog
My Photo Galleries: http://www.pbase.com/ashishpaliwal

答复: 答复: how to reduce zookeeper.out

Posted by huaxiang <hu...@asiainfo-linkage.com>.
Hi,
  If console logger is removed, then the console message will be output to
the zookeeper.log files?
  Should I uncomment the said value setting like '#
zookeeper.console.threshold=WARN' and then restart zookeeper demon? This is
a online system.

Thanks!

beatls



-----邮件原件-----
发件人: Ashish [mailto:paliwalashish@gmail.com] 
发送时间: 2013年3月31日 20:46
收件人: user@hbase.apache.org
主题: Re: 答复: how to reduce zookeeper.out

zookeeper.out is specified in bin/zkServer.sh

IMHO, you can remove console logger. All your logs shall anyways be part of
log files, and any output from zookeeper process on console shall be
captured in zookeeper.out.

If you still prefer to have CONSOLE logger, use this property to reduce logs
generated.
zookeeper.console.threshold=WARN

Thanks
ashish


On Sun, Mar 31, 2013 at 6:04 PM, huaxiang
<hu...@asiainfo-linkage.com>wrote:

> Hi,
>    Below is the [zk_dir]/conf/log4j.properties:
> [root@hadoop1 conf]# more log4j.properties # Copyright 2012 The Apache 
> Software Foundation # # Licensed to the Apache Software Foundation 
> (ASF) under one # or more contributor license agreements.  See the 
> NOTICE file # distributed with this work for additional information # 
> regarding copyright ownership.  The ASF licenses this file # to you 
> under the Apache License, Version 2.0 (the # "License"); you may not 
> use this file except in compliance # with the License.  You may obtain 
> a copy of the License at #
> #     http://www.apache.org/licenses/LICENSE-2.0
> #
> # Unless required by applicable law or agreed to in writing, software 
> # distributed under the License is distributed on an "AS IS" BASIS, # 
> WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> # See the License for the specific language governing permissions and 
> # limitations under the License.
>
> # Define some default values that can be overridden by system 
> properties zookeeper.root.logger=INFO, CONSOLE
>
> zookeeper.console.threshold=INFO
>
> zookeeper.log.dir=.
> zookeeper.log.file=zookeeper.log
> zookeeper.log.threshold=INFO
> zookeeper.log.maxfilesize=256MB
> zookeeper.log.maxbackupindex=20
>
> zookeeper.tracelog.dir=.
> zookeeper.tracelog.file=zookeeper_trace.log
>
> log4j.rootLogger=${zookeeper.root.logger}
>
> #
> # console
> # Add "console" to rootlogger above if you want to use this # 
> log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
> log4j.appender.CONSOLE.Threshold=${zookeeper.console.threshold}
> log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
> log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} 
> [myid:%X{myid}]
> - %-5p [%t:%C{1}@%L] - %m%n
>
> #
> # Add ROLLINGFILE to rootLogger to get log file output # 
> log4j.appender.ROLLINGFILE=org.apache.log4j.RollingFileAppender
> log4j.appender.ROLLINGFILE.Threshold=${zookeeper.log.threshold}
> log4j.appender.ROLLINGFILE.File=${zookeeper.log.dir}/${zookeeper.log.f
> ile} 
> log4j.appender.ROLLINGFILE.MaxFileSize=${zookeeper.log.maxfilesize}
> log4j.appender.ROLLINGFILE.MaxBackupIndex=${zookeeper.log.maxbackupind
> ex} log4j.appender.ROLLINGFILE.layout=org.apache.log4j.PatternLayout
>
> I cannot find the zookeeper.log, but find the zookeeper.out under the 
> bin/zookeeper.out.
>
> Thanks!
>
> beatls
>
> -----邮件原件-----
> 发件人: Azuryy Yu [mailto:azuryyyu@gmail.com]
> 发送时间: 2013年3月30日 23:02
> 收件人: user@hbase.apache.org
> 主题: Re: how to reduce zookeeper.out
>
> you can edit [zk_dir]/conf/log4j.properties, such as mine:
>
> log4j.rootLogger=INFO, DEBUG, ERROR
>
> # DEBUG
> log4j.appender.DEBUG=org.apache.log4j.DailyRollingFileAppender
> log4j.appender.DEBUG.Threshold=DEBUG
> log4j.appender.DEBUG.layout=org.apache.log4j.PatternLayout
> log4j.appender.DEBUG.layout.ConversionPattern=%d{ISO8601} - %-5p 
> [%t:%C{1}@%L]
> - %m%n
> log4j.appender.DEBUG.datePattern='.'yyyy-MM-dd'.log'
> log4j.appender.DEBUG.append=true
> log4j.appender.DEBUG.File=/home/user/zk_logs/zk_debug.log
>
> # INFO
> log4j.appender.INFO=org.apache.log4j.DailyRollingFileAppender
> log4j.appender.INFO.Threshold=INFO
> log4j.appender.INFO.layout=org.apache.log4j.PatternLayout
> log4j.appender.INFO.layout.ConversionPattern=%d{ISO8601} - %-5p 
> [%t:%C{1}@%L]
> - %m%n
> log4j.appender.INFO.datePattern='.'yyyy-MM-dd'.log'
> log4j.appender.INFO.append=true
> log4j.appender.INFO.File=/home/user/zk_logs/zk_info.log
>
> # ERROR
> log4j.appender.ERROR=org.apache.log4j.DailyRollingFileAppender
> log4j.appender.ERROR.Threshold=ERROR
> log4j.appender.ERROR.layout=org.apache.log4j.PatternLayout
> log4j.appender.ERROR.layout.ConversionPattern=%d{ISO8601} - %-5p 
> [%t:%C{1}@%L]
> - %m%n
> log4j.appender.ERROR.datePattern='.'yyyy-MM-dd'.log'
> log4j.appender.ERROR.append=true
> log4j.appender.ERROR.File=/home/user/zk_logs/zk_error.log
>
>


--
thanks
ashish

Blog: http://www.ashishpaliwal.com/blog
My Photo Galleries: http://www.pbase.com/ashishpaliwal


Re: 答复: how to reduce zookeeper.out

Posted by Ashish <pa...@gmail.com>.
zookeeper.out is specified in bin/zkServer.sh

IMHO, you can remove console logger. All your logs shall anyways be part of
log files, and any output from zookeeper process on console shall be
captured in zookeeper.out.

If you still prefer to have CONSOLE logger, use this property to reduce
logs generated.
zookeeper.console.threshold=WARN

Thanks
ashish


On Sun, Mar 31, 2013 at 6:04 PM, huaxiang <hu...@asiainfo-linkage.com>wrote:

> Hi,
>    Below is the [zk_dir]/conf/log4j.properties:
> [root@hadoop1 conf]# more log4j.properties
> # Copyright 2012 The Apache Software Foundation
> #
> # Licensed to the Apache Software Foundation (ASF) under one
> # or more contributor license agreements.  See the NOTICE file
> # distributed with this work for additional information
> # regarding copyright ownership.  The ASF licenses this file
> # to you under the Apache License, Version 2.0 (the
> # "License"); you may not use this file except in compliance
> # with the License.  You may obtain a copy of the License at
> #
> #     http://www.apache.org/licenses/LICENSE-2.0
> #
> # Unless required by applicable law or agreed to in writing, software
> # distributed under the License is distributed on an "AS IS" BASIS,
> # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> # See the License for the specific language governing permissions and
> # limitations under the License.
>
> # Define some default values that can be overridden by system properties
> zookeeper.root.logger=INFO, CONSOLE
>
> zookeeper.console.threshold=INFO
>
> zookeeper.log.dir=.
> zookeeper.log.file=zookeeper.log
> zookeeper.log.threshold=INFO
> zookeeper.log.maxfilesize=256MB
> zookeeper.log.maxbackupindex=20
>
> zookeeper.tracelog.dir=.
> zookeeper.tracelog.file=zookeeper_trace.log
>
> log4j.rootLogger=${zookeeper.root.logger}
>
> #
> # console
> # Add "console" to rootlogger above if you want to use this
> #
> log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
> log4j.appender.CONSOLE.Threshold=${zookeeper.console.threshold}
> log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
> log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} [myid:%X{myid}]
> - %-5p [%t:%C{1}@%L] - %m%n
>
> #
> # Add ROLLINGFILE to rootLogger to get log file output
> #
> log4j.appender.ROLLINGFILE=org.apache.log4j.RollingFileAppender
> log4j.appender.ROLLINGFILE.Threshold=${zookeeper.log.threshold}
> log4j.appender.ROLLINGFILE.File=${zookeeper.log.dir}/${zookeeper.log.file}
> log4j.appender.ROLLINGFILE.MaxFileSize=${zookeeper.log.maxfilesize}
> log4j.appender.ROLLINGFILE.MaxBackupIndex=${zookeeper.log.maxbackupindex}
> log4j.appender.ROLLINGFILE.layout=org.apache.log4j.PatternLayout
>
> I cannot find the zookeeper.log, but find the zookeeper.out under the
> bin/zookeeper.out.
>
> Thanks!
>
> beatls
>
> -----邮件原件-----
> 发件人: Azuryy Yu [mailto:azuryyyu@gmail.com]
> 发送时间: 2013年3月30日 23:02
> 收件人: user@hbase.apache.org
> 主题: Re: how to reduce zookeeper.out
>
> you can edit [zk_dir]/conf/log4j.properties, such as mine:
>
> log4j.rootLogger=INFO, DEBUG, ERROR
>
> # DEBUG
> log4j.appender.DEBUG=org.apache.log4j.DailyRollingFileAppender
> log4j.appender.DEBUG.Threshold=DEBUG
> log4j.appender.DEBUG.layout=org.apache.log4j.PatternLayout
> log4j.appender.DEBUG.layout.ConversionPattern=%d{ISO8601} - %-5p
> [%t:%C{1}@%L]
> - %m%n
> log4j.appender.DEBUG.datePattern='.'yyyy-MM-dd'.log'
> log4j.appender.DEBUG.append=true
> log4j.appender.DEBUG.File=/home/user/zk_logs/zk_debug.log
>
> # INFO
> log4j.appender.INFO=org.apache.log4j.DailyRollingFileAppender
> log4j.appender.INFO.Threshold=INFO
> log4j.appender.INFO.layout=org.apache.log4j.PatternLayout
> log4j.appender.INFO.layout.ConversionPattern=%d{ISO8601} - %-5p
> [%t:%C{1}@%L]
> - %m%n
> log4j.appender.INFO.datePattern='.'yyyy-MM-dd'.log'
> log4j.appender.INFO.append=true
> log4j.appender.INFO.File=/home/user/zk_logs/zk_info.log
>
> # ERROR
> log4j.appender.ERROR=org.apache.log4j.DailyRollingFileAppender
> log4j.appender.ERROR.Threshold=ERROR
> log4j.appender.ERROR.layout=org.apache.log4j.PatternLayout
> log4j.appender.ERROR.layout.ConversionPattern=%d{ISO8601} - %-5p
> [%t:%C{1}@%L]
> - %m%n
> log4j.appender.ERROR.datePattern='.'yyyy-MM-dd'.log'
> log4j.appender.ERROR.append=true
> log4j.appender.ERROR.File=/home/user/zk_logs/zk_error.log
>
>


-- 
thanks
ashish

Blog: http://www.ashishpaliwal.com/blog
My Photo Galleries: http://www.pbase.com/ashishpaliwal

答复: how to reduce zookeeper.out

Posted by huaxiang <hu...@asiainfo-linkage.com>.
Hi, 
   Below is the [zk_dir]/conf/log4j.properties:
[root@hadoop1 conf]# more log4j.properties 
# Copyright 2012 The Apache Software Foundation
# 
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Define some default values that can be overridden by system properties
zookeeper.root.logger=INFO, CONSOLE

zookeeper.console.threshold=INFO

zookeeper.log.dir=.
zookeeper.log.file=zookeeper.log
zookeeper.log.threshold=INFO
zookeeper.log.maxfilesize=256MB
zookeeper.log.maxbackupindex=20

zookeeper.tracelog.dir=.
zookeeper.tracelog.file=zookeeper_trace.log

log4j.rootLogger=${zookeeper.root.logger}

#
# console
# Add "console" to rootlogger above if you want to use this 
#
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Threshold=${zookeeper.console.threshold}
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} [myid:%X{myid}]
- %-5p [%t:%C{1}@%L] - %m%n

#
# Add ROLLINGFILE to rootLogger to get log file output
#
log4j.appender.ROLLINGFILE=org.apache.log4j.RollingFileAppender
log4j.appender.ROLLINGFILE.Threshold=${zookeeper.log.threshold}
log4j.appender.ROLLINGFILE.File=${zookeeper.log.dir}/${zookeeper.log.file}
log4j.appender.ROLLINGFILE.MaxFileSize=${zookeeper.log.maxfilesize}
log4j.appender.ROLLINGFILE.MaxBackupIndex=${zookeeper.log.maxbackupindex}
log4j.appender.ROLLINGFILE.layout=org.apache.log4j.PatternLayout

I cannot find the zookeeper.log, but find the zookeeper.out under the
bin/zookeeper.out.

Thanks!

beatls

-----邮件原件-----
发件人: Azuryy Yu [mailto:azuryyyu@gmail.com] 
发送时间: 2013年3月30日 23:02
收件人: user@hbase.apache.org
主题: Re: how to reduce zookeeper.out

you can edit [zk_dir]/conf/log4j.properties, such as mine:

log4j.rootLogger=INFO, DEBUG, ERROR

# DEBUG
log4j.appender.DEBUG=org.apache.log4j.DailyRollingFileAppender
log4j.appender.DEBUG.Threshold=DEBUG
log4j.appender.DEBUG.layout=org.apache.log4j.PatternLayout
log4j.appender.DEBUG.layout.ConversionPattern=%d{ISO8601} - %-5p
[%t:%C{1}@%L]
- %m%n
log4j.appender.DEBUG.datePattern='.'yyyy-MM-dd'.log'
log4j.appender.DEBUG.append=true
log4j.appender.DEBUG.File=/home/user/zk_logs/zk_debug.log

# INFO
log4j.appender.INFO=org.apache.log4j.DailyRollingFileAppender
log4j.appender.INFO.Threshold=INFO
log4j.appender.INFO.layout=org.apache.log4j.PatternLayout
log4j.appender.INFO.layout.ConversionPattern=%d{ISO8601} - %-5p
[%t:%C{1}@%L]
- %m%n
log4j.appender.INFO.datePattern='.'yyyy-MM-dd'.log'
log4j.appender.INFO.append=true
log4j.appender.INFO.File=/home/user/zk_logs/zk_info.log

# ERROR
log4j.appender.ERROR=org.apache.log4j.DailyRollingFileAppender
log4j.appender.ERROR.Threshold=ERROR
log4j.appender.ERROR.layout=org.apache.log4j.PatternLayout
log4j.appender.ERROR.layout.ConversionPattern=%d{ISO8601} - %-5p
[%t:%C{1}@%L]
- %m%n
log4j.appender.ERROR.datePattern='.'yyyy-MM-dd'.log'
log4j.appender.ERROR.append=true
log4j.appender.ERROR.File=/home/user/zk_logs/zk_error.log


Re: how to reduce zookeeper.out

Posted by Azuryy Yu <az...@gmail.com>.
you can edit [zk_dir]/conf/log4j.properties, such as mine:

log4j.rootLogger=INFO, DEBUG, ERROR

# DEBUG
log4j.appender.DEBUG=org.apache.log4j.DailyRollingFileAppender
log4j.appender.DEBUG.Threshold=DEBUG
log4j.appender.DEBUG.layout=org.apache.log4j.PatternLayout
log4j.appender.DEBUG.layout.ConversionPattern=%d{ISO8601} - %-5p [%t:%C{1}@%L]
- %m%n
log4j.appender.DEBUG.datePattern='.'yyyy-MM-dd'.log'
log4j.appender.DEBUG.append=true
log4j.appender.DEBUG.File=/home/user/zk_logs/zk_debug.log

# INFO
log4j.appender.INFO=org.apache.log4j.DailyRollingFileAppender
log4j.appender.INFO.Threshold=INFO
log4j.appender.INFO.layout=org.apache.log4j.PatternLayout
log4j.appender.INFO.layout.ConversionPattern=%d{ISO8601} - %-5p [%t:%C{1}@%L]
- %m%n
log4j.appender.INFO.datePattern='.'yyyy-MM-dd'.log'
log4j.appender.INFO.append=true
log4j.appender.INFO.File=/home/user/zk_logs/zk_info.log

# ERROR
log4j.appender.ERROR=org.apache.log4j.DailyRollingFileAppender
log4j.appender.ERROR.Threshold=ERROR
log4j.appender.ERROR.layout=org.apache.log4j.PatternLayout
log4j.appender.ERROR.layout.ConversionPattern=%d{ISO8601} - %-5p [%t:%C{1}@%L]
- %m%n
log4j.appender.ERROR.datePattern='.'yyyy-MM-dd'.log'
log4j.appender.ERROR.append=true
log4j.appender.ERROR.File=/home/user/zk_logs/zk_error.log

Re: 答复: how to reduce zookeeper.out

Posted by Jean-Marc Spaggiari <je...@spaggiari.org>.
This is the kind of info I have on my ZK.out:
2013-03-30 10:54:33,605 [myid:1] - INFO
[NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@213] -
Accepted socket connection from /192.168.23.10:40812
2013-03-30 10:54:33,685 [myid:1] - INFO
[NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@838] -
Client attempting to establish new session at /192.168.23.10:40812
2013-03-30 10:54:33,706 [myid:1] - INFO
[CommitProcessor:1:ZooKeeperServer@604] - Established session
0x13d783198e46fcf with negotiated timeout 40000 for client
/192.168.23.10:40812
2013-03-30 10:54:35,148 [myid:1] - INFO
[NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@213] -
Accepted socket connection from /192.168.23.5:34998
2013-03-30 10:54:35,160 [myid:1] - INFO
[NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@213] -
Accepted socket connection from /192.168.23.5:34999
2013-03-30 10:54:35,177 [myid:1] - INFO
[NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@838] -
Client attempting to establish new session at /192.168.23.5:34998
2013-03-30 10:54:35,178 [myid:1] - INFO
[NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@838] -
Client attempting to establish new session at /192.168.23.5:34999
2013-03-30 10:54:35,195 [myid:1] - INFO
[CommitProcessor:1:ZooKeeperServer@604] - Established session
0x13d783198e46fd0 with negotiated timeout 40000 for client
/192.168.23.5:34998
2013-03-30 10:54:35,207 [myid:1] - INFO
[CommitProcessor:1:ZooKeeperServer@604] - Established session
0x13d783198e46fd1 with negotiated timeout 40000 for client
/192.168.23.5:34999


also, I just tried to rm and touch and it's now writing on the file
anymore, so it's not a good solution.

I just stopped and restarted it and it's now writing on the file
again. I did that because I have 3 ZK servers... So it should be safe.

I have a MR job running right now, and it does seems it has impacted
it. But I have not check all the logs yet.

JM

2013/3/30 huaxiang <hu...@asiainfo-linkage.com>:
> KEVIN,
>    This file is usualy could be found under "bin" directory, that is
> "bin/zookeeper.out".
>
>
>
>
> -----邮件原件-----
> 发件人: Kevin O'dell [mailto:kevin.odell@cloudera.com]
> 发送时间: 2013年3月30日 22:47
> 收件人: user@hbase.apache.org
> 主题: Re: how to reduce zookeeper.out
>
> Hua,
>
>   That is no fun.  Another question though, I just checked my clusters and I
> don't even have a zookeeper.out.  What messages do you have filing this file
> up?
>
> On Sat, Mar 30, 2013 at 10:42 AM, hua beatls <be...@gmail.com> wrote:
>
>> Hi Kevin,
>>      seems there is no rolling mechanizm for the zookeeper.out.
>>
>>
>>
>>
>> On Sat, Mar 30, 2013 at 10:31 PM, Kevin O'dell
>> <kevin.odell@cloudera.com
>> >wrote:
>>
>> > Hi Hua,
>> >
>> >   I believe(don't quote me) that you can use the rolling file
>> > appender to set the files to a max size.  I know HBase does this,
>> > but I am not sure about ZK.
>> >
>> > On Sat, Mar 30, 2013 at 10:22 AM, Jean-Marc Spaggiari <
>> > jean-marc@spaggiari.org> wrote:
>> >
>> > > Hi,
>> > >
>> > > If you are in production you should have more than 1 ZK server, right?
>> > > Like, 3 or more?
>> > >
>> > > Then you can just shut one down, the others mike elect a new leader.
>> > > Then you clear the zookeeper.out file, and start it back?
>> > >
>> > > JM
>> > >
>> > > 2013/3/30 hua beatls <be...@gmail.com>:
>> > > > Hi,
>> > > >     zookeeper.out is too large, how to reduce this file? it is a
>> online
>> > > > system.
>> > > >
>> > > >    Best R.
>> > > >
>> > > >   beatls
>> > >
>> >
>> >
>> >
>> > --
>> > Kevin O'Dell
>> > Customer Operations Engineer, Cloudera
>> >
>>
>
>
>
> --
> Kevin O'Dell
> Customer Operations Engineer, Cloudera
>