Repository: accumulo Updated Branches: refs/heads/master ae4620972 -> 27abe8352
ACCUMULO-2267 added a basic config rpm, initialize hdfs for accumulo, deal with versions on the accumulo jars, fix the start-up scripts, tested on Centos6.5 Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/fc4de902 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/fc4de902 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/fc4de902 Branch: refs/heads/master Commit: fc4de9022e3b82e71c4fca51e4f80b2cacb3ea90 Parents: 6b2704c Author: Eric Newton <eric.new...@gmail.com> Authored: Tue Mar 11 14:56:13 2014 -0400 Committer: Eric Newton <eric.new...@gmail.com> Committed: Tue Mar 11 14:56:25 2014 -0400 ---------------------------------------------------------------------- assemble/pom.xml | 7 ++ bin/accumulo | 5 + core/pom.xml | 2 +- init/pom.xml | 98 ++++++++++++++++++++ .../main/packaging/etc/accumulo/accumulo-env.sh | 65 +++++++++++++ .../packaging/etc/accumulo/accumulo-site.xml | 87 +++++++++++++++++ .../main/packaging/etc/accumulo/auditLog.xml | 41 ++++++++ init/src/main/packaging/etc/accumulo/gc | 1 + .../packaging/etc/accumulo/generic_logger.xml | 83 +++++++++++++++++ .../packaging/etc/accumulo/log4j.properties | 41 ++++++++ init/src/main/packaging/etc/accumulo/masters | 1 + .../packaging/etc/accumulo/monitor_logger.xml | 64 +++++++++++++ init/src/main/packaging/etc/accumulo/monitors | 1 + init/src/main/packaging/etc/accumulo/slaves | 1 + init/src/main/packaging/etc/accumulo/tracers | 1 + pom.xml | 13 +++ server/base/pom.xml | 7 +- .../src/main/packaging/etc/init.d/accumulo-gc | 6 +- .../main/packaging/etc/init.d/accumulo-master | 6 +- .../main/packaging/etc/init.d/accumulo-monitor | 6 +- .../main/packaging/etc/init.d/accumulo-tracer | 6 +- .../main/packaging/etc/init.d/accumulo-tserver | 9 +- 22 files changed, 532 insertions(+), 19 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/fc4de902/assemble/pom.xml ---------------------------------------------------------------------- diff --git a/assemble/pom.xml b/assemble/pom.xml index c0f0720..23a2187 100644 --- a/assemble/pom.xml +++ b/assemble/pom.xml @@ -496,6 +496,12 @@ </dependency> <dependency> <groupId>org.apache.accumulo</groupId> + <artifactId>accumulo-init</artifactId> + <classifier>el6</classifier> + <type>rpm</type> + </dependency> + <dependency> + <groupId>org.apache.accumulo</groupId> <artifactId>accumulo-master</artifactId> <classifier>el6</classifier> <type>rpm</type> @@ -573,6 +579,7 @@ <require>accumulo-native = %{version}-%{release}</require> <require>accumulo-tracer = %{version}-%{release}</require> <require>accumulo-tserver = %{version}-%{release}</require> + <require>accumulo-init = %{version}-%{release}</require> </requires> <mappings> <mapping> http://git-wip-us.apache.org/repos/asf/accumulo/blob/fc4de902/bin/accumulo ---------------------------------------------------------------------- diff --git a/bin/accumulo b/bin/accumulo index 75df322..256598c 100755 --- a/bin/accumulo +++ b/bin/accumulo @@ -29,6 +29,11 @@ script=$( basename "${SOURCE}" ) . "${bin}"/config.sh START_JAR="${ACCUMULO_HOME}/lib/accumulo-start.jar" +if [ ! -f "$START_JAR" ]; then + if [ -x /bin/rpm ]; then + START_JAR=$(echo $(/bin/rpm -E "%{_javadir}/accumulo/"accumulo-start-*.jar)) + fi +fi # # Resolve a program to its installation directory http://git-wip-us.apache.org/repos/asf/accumulo/blob/fc4de902/core/pom.xml ---------------------------------------------------------------------- diff --git a/core/pom.xml b/core/pom.xml index 10c9bdd..d56ca2c 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -257,7 +257,7 @@ <require>accumulo-start = %{version}-%{release}</require> </requires> <preinstallScriptlet> - <script>getent group accumulo >/dev/null || groupadd -r accumulo; getent passwd accumulo >/dev/null || useradd -r -g accumulo -d %{_datadir}/accumulo -s /sbin/nologin -c "Apache Accumulo" accumulo; exit 0</script> + <script>getent group accumulo >/dev/null || groupadd -r accumulo; getent passwd accumulo >/dev/null || useradd -r -g accumulo -d %{_datadir}/accumulo -s /bin/bash -c "Apache Accumulo" accumulo; exit 0</script> </preinstallScriptlet> <postinstallScriptlet> <script>sysctl -q -p %{_sysconfdir}/sysctl.d/accumulo; ln -s %{_sysconfdir}/accumulo %{_datadir}/accumulo/conf</script> http://git-wip-us.apache.org/repos/asf/accumulo/blob/fc4de902/init/pom.xml ---------------------------------------------------------------------- diff --git a/init/pom.xml b/init/pom.xml new file mode 100644 index 0000000..dfd1ff8 --- /dev/null +++ b/init/pom.xml @@ -0,0 +1,98 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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. +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.accumulo</groupId> + <artifactId>accumulo-project</artifactId> + <version>1.6.0-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + <artifactId>accumulo-init</artifactId> + <name>Init</name> + <description>Initialize and start a single-node accumulo instance.</description> + <dependencies> + <dependency> + <groupId>org.apache.accumulo</groupId> + <artifactId>accumulo-core</artifactId> + </dependency> + <dependency> + <groupId>org.apache.accumulo</groupId> + <artifactId>accumulo-start</artifactId> + </dependency> + <dependency> + <groupId>org.apache.hadoop</groupId> + <artifactId>hadoop-client</artifactId> + </dependency> + <dependency> + <groupId>org.apache.thrift</groupId> + <artifactId>libthrift</artifactId> + </dependency> + <dependency> + <groupId>org.apache.zookeeper</groupId> + <artifactId>zookeeper</artifactId> + </dependency> + </dependencies> + <profiles> + <profile> + <id>rpm</id> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>rpm-maven-plugin</artifactId> + <executions> + <execution> + <id>build-rpm</id> + <goals> + <goal>attached-rpm</goal> + </goals> + <phase>package</phase> + <configuration> + <requires> + <require>java-sdk >= 1.6.0</require> + <require>accumulo-core = %{version}-%{release}</require> + </requires> + <mappings> + <mapping> + <configuration>true</configuration> + <directory>%{_sysconfdir}/accumulo</directory> + <filemode>700</filemode> + <username>accumulo</username> + <sources> + <source> + <location>src/main/packaging/etc/accumulo</location> + <includes> + <include>*/**</include> + </includes> + </source> + </sources> + </mapping> + </mappings> + <postinstallScriptlet> + <script>su hdfs sh -c 'hadoop fs -mkdir /accumulo ; hadoop fs -chown accumulo /accumulo' ; su accumulo sh -c '%{_datadir}/accumulo/bin/accumulo init --instance-name instance --password secret'</script> + </postinstallScriptlet> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> +</project> http://git-wip-us.apache.org/repos/asf/accumulo/blob/fc4de902/init/src/main/packaging/etc/accumulo/accumulo-env.sh ---------------------------------------------------------------------- diff --git a/init/src/main/packaging/etc/accumulo/accumulo-env.sh b/init/src/main/packaging/etc/accumulo/accumulo-env.sh new file mode 100755 index 0000000..0ac9374 --- /dev/null +++ b/init/src/main/packaging/etc/accumulo/accumulo-env.sh @@ -0,0 +1,65 @@ +#! /usr/bin/env bash + +# 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. + +### +### Configure these environment variables to point to your local installations. +### +### The functional tests require conditional values, so keep this style: +### +### test -z "$JAVA_HOME" && export JAVA_HOME=/usr/local/lib/jdk-1.6.0 +### +### +### Note that the -Xmx -Xms settings below require substantial free memory: +### you may want to use smaller values, especially when running everything +### on a single machine. +### +if [ -z "$HADOOP_HOME" ] +then + test -z "$HADOOP_PREFIX" && export HADOOP_PREFIX=/usr/lib/hadoop +else + HADOOP_PREFIX="$HADOOP_HOME" + unset HADOOP_HOME +fi + +# hadoop-1.2: +# test -z "$HADOOP_CONF_DIR" && export HADOOP_CONF_DIR="$HADOOP_PREFIX/conf" +test -z "$HADOOP_CONF_DIR" && export HADOOP_CONF_DIR="/etc/hadoop/conf" + +test -z "$JAVA_HOME" && export JAVA_HOME=/usr/lib/jvm/jre +test -z "$ZOOKEEPER_HOME" && export ZOOKEEPER_HOME=/usr/lib/zookeeper +test -z "$ACCUMULO_LOG_DIR" && export ACCUMULO_LOG_DIR=/var/log/accumulo +if [ -f ${ACCUMULO_CONF_DIR}/accumulo.policy ] +then + POLICY="-Djava.security.manager -Djava.security.policy=${ACCUMULO_CONF_DIR}/accumulo.policy" +fi +test -z "$ACCUMULO_TSERVER_OPTS" && export ACCUMULO_TSERVER_OPTS="${POLICY} -Xmx1g -Xms1g -XX:NewSize=500m -XX:MaxNewSize=500m " +test -z "$ACCUMULO_MASTER_OPTS" && export ACCUMULO_MASTER_OPTS="${POLICY} -Xmx1g -Xms1g" +test -z "$ACCUMULO_MONITOR_OPTS" && export ACCUMULO_MONITOR_OPTS="${POLICY} -Xmx1g -Xms256m" +test -z "$ACCUMULO_GC_OPTS" && export ACCUMULO_GC_OPTS="-Xmx256m -Xms256m" +test -z "$ACCUMULO_GENERAL_OPTS" && export ACCUMULO_GENERAL_OPTS="-XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -Djava.net.preferIPv4Stack=true" +test -z "$ACCUMULO_OTHER_OPTS" && export ACCUMULO_OTHER_OPTS="-Xmx1g -Xms256m" +# what do when the JVM runs out of heap memory +export ACCUMULO_KILL_CMD='kill -9 %p' + +### Optionally look for hadoop and accumulo native libraries for your +### platform in additional directories. (Use DYLD_LIBRARY_PATH on Mac OS X.) +### May not be necessary for Hadoop 2.x or using an RPM that installs to +### the correct system library directory. +# export LD_LIBRARY_PATH=${HADOOP_PREFIX}/lib/native/${PLATFORM}:${LD_LIBRARY_PATH} + +# Should the monitor bind to all network interfaces -- default: false +# export ACCUMULO_MONITOR_BIND_ALL="true" http://git-wip-us.apache.org/repos/asf/accumulo/blob/fc4de902/init/src/main/packaging/etc/accumulo/accumulo-site.xml ---------------------------------------------------------------------- diff --git a/init/src/main/packaging/etc/accumulo/accumulo-site.xml b/init/src/main/packaging/etc/accumulo/accumulo-site.xml new file mode 100644 index 0000000..12cb1b9 --- /dev/null +++ b/init/src/main/packaging/etc/accumulo/accumulo-site.xml @@ -0,0 +1,87 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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. +--> +<?xml-stylesheet type="text/xsl" href="configuration.xsl"?> + +<configuration> + <!-- Put your site-specific accumulo configurations here. The available configuration values along with their defaults are documented in docs/config.html Unless + you are simply testing at your workstation, you will most definitely need to change the three entries below. --> + + <property> + <name>instance.zookeeper.host</name> + <value>localhost:2181</value> + <description>comma separated list of zookeeper servers</description> + </property> + + <property> + <name>instance.secret</name> + <value>CHANGEME</value> + <description>A secret unique to a given instance that all servers must know in order to communicate with one another. + Change it before initialization. To + change it later use ./bin/accumulo org.apache.accumulo.server.util.ChangeSecret --old [oldpasswd] --new [newpasswd], + and then update this file. + </description> + </property> + + <property> + <name>tserver.memory.maps.max</name> + <value>1G</value> + </property> + + <property> + <name>tserver.cache.data.size</name> + <value>128M</value> + </property> + + <property> + <name>tserver.cache.index.size</name> + <value>128M</value> + </property> + + <property> + <name>trace.token.property.password</name> + <!-- change this to the root user's password, and/or change the user below --> + <value>secret</value> + </property> + + <property> + <name>trace.user</name> + <value>root</value> + </property> + + <property> + <name>general.classpaths</name> + <value> + /usr/share/java/accumulo/.*.jar, + /usr/share/accumulo/lib/.*.jar, + /usr/lib/zookeeper.*.jar, + /etc/hadoop/conf, + /usr/lib/hadoop/.*.jar, + /usr/lib/hadoop/lib/.*.jar, + /usr/lib/hadoop-hdfs/.*.jar, + /usr/lib/hadoop-mapreduce/.*.jar, + /usr/lib/hadoop-yarn/.*.jar, + </value> + <description>Classpaths that accumulo checks for updates and class files.</description> + </property> + + <property> + <name>general.dynamic.classpaths</name> + <value></value> + </property> + +</configuration> http://git-wip-us.apache.org/repos/asf/accumulo/blob/fc4de902/init/src/main/packaging/etc/accumulo/auditLog.xml ---------------------------------------------------------------------- diff --git a/init/src/main/packaging/etc/accumulo/auditLog.xml b/init/src/main/packaging/etc/accumulo/auditLog.xml new file mode 100644 index 0000000..9b7987e --- /dev/null +++ b/init/src/main/packaging/etc/accumulo/auditLog.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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. +--> +<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> +<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> + + + + <!-- Write out Audit info to an Audit file --> + <appender name="Audit" class="org.apache.log4j.DailyRollingFileAppender"> + <param name="File" value="${org.apache.accumulo.core.dir.log}/${org.apache.accumulo.core.ip.localhost.hostname}.audit"/> + <param name="MaxBackupIndex" value="10"/> + <param name="DatePattern" value="'.'yyyy-MM-dd"/> + <layout class="org.apache.log4j.PatternLayout"> + <param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss,SSS/Z} [%c{2}] %-5p: %m%n"/> + </layout> + </appender> + <logger name="Audit" additivity="false"> + <appender-ref ref="Audit" /> + <level value="OFF"/> + </logger> + + + + + +</log4j:configuration> http://git-wip-us.apache.org/repos/asf/accumulo/blob/fc4de902/init/src/main/packaging/etc/accumulo/gc ---------------------------------------------------------------------- diff --git a/init/src/main/packaging/etc/accumulo/gc b/init/src/main/packaging/etc/accumulo/gc new file mode 100644 index 0000000..2fbb50c --- /dev/null +++ b/init/src/main/packaging/etc/accumulo/gc @@ -0,0 +1 @@ +localhost http://git-wip-us.apache.org/repos/asf/accumulo/blob/fc4de902/init/src/main/packaging/etc/accumulo/generic_logger.xml ---------------------------------------------------------------------- diff --git a/init/src/main/packaging/etc/accumulo/generic_logger.xml b/init/src/main/packaging/etc/accumulo/generic_logger.xml new file mode 100644 index 0000000..db79efe --- /dev/null +++ b/init/src/main/packaging/etc/accumulo/generic_logger.xml @@ -0,0 +1,83 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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. +--> +<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> +<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> + + <!-- Write out everything at the DEBUG level to the debug log --> + <appender name="A2" class="org.apache.log4j.RollingFileAppender"> + <param name="File" value="${org.apache.accumulo.core.dir.log}/${org.apache.accumulo.core.application}_${org.apache.accumulo.core.ip.localhost.hostname}.debug.log"/> + <param name="MaxFileSize" value="1000MB"/> + <param name="MaxBackupIndex" value="10"/> + <param name="Threshold" value="DEBUG"/> + <layout class="org.apache.log4j.PatternLayout"> + <param name="ConversionPattern" value="%d{ISO8601} [%-8c{2}] %-5p: %m%n"/> + </layout> + </appender> + + <!-- Write out INFO and higher to the regular log --> + <appender name="A3" class="org.apache.log4j.RollingFileAppender"> + <param name="File" value="${org.apache.accumulo.core.dir.log}/${org.apache.accumulo.core.application}_${org.apache.accumulo.core.ip.localhost.hostname}.log"/> + <param name="MaxFileSize" value="1000MB"/> + <param name="MaxBackupIndex" value="10"/> + <param name="Threshold" value="INFO"/> + <layout class="org.apache.log4j.PatternLayout"> + <param name="ConversionPattern" value="%d{ISO8601} [%-8c{2}] %-5p: %m%n"/> + </layout> + </appender> + + <!-- Send all logging data to a centralized logger --> + <appender name="N1" class="org.apache.log4j.net.SocketAppender"> + <param name="remoteHost" value="${org.apache.accumulo.core.host.log}"/> + <param name="port" value="${org.apache.accumulo.core.host.log.port}"/> + <param name="application" value="${org.apache.accumulo.core.application}:${org.apache.accumulo.core.ip.localhost.hostname}"/> + <param name="Threshold" value="WARN"/> + </appender> + + <!-- If the centralized logger is down, buffer the log events, but drop them if it stays down --> + <appender name="ASYNC" class="org.apache.log4j.AsyncAppender"> + <appender-ref ref="N1" /> + </appender> + + <!-- Log accumulo events to the debug, normal and remote logs. --> + <logger name="org.apache.accumulo" additivity="false"> + <level value="DEBUG"/> + <appender-ref ref="A2" /> + <appender-ref ref="A3" /> + <appender-ref ref="ASYNC" /> + </logger> + + <logger name="org.apache.accumulo.core.file.rfile.bcfile"> + <level value="INFO"/> + </logger> + + <logger name="org.mortbay.log"> + <level value="WARN"/> + </logger> + + <logger name="org.apache.zookeeper"> + <level value="ERROR"/> + </logger> + + <!-- Log non-accumulo events to the debug and normal logs. --> + <root> + <level value="INFO"/> + <appender-ref ref="A2" /> + <appender-ref ref="A3" /> + </root> + +</log4j:configuration> http://git-wip-us.apache.org/repos/asf/accumulo/blob/fc4de902/init/src/main/packaging/etc/accumulo/log4j.properties ---------------------------------------------------------------------- diff --git a/init/src/main/packaging/etc/accumulo/log4j.properties b/init/src/main/packaging/etc/accumulo/log4j.properties new file mode 100644 index 0000000..a4bcb2e --- /dev/null +++ b/init/src/main/packaging/etc/accumulo/log4j.properties @@ -0,0 +1,41 @@ +# 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. + +# default logging properties: +# by default, log everything at INFO or higher to the console +log4j.rootLogger=INFO,A1 + +# hide Jetty junk +log4j.logger.org.mortbay.log=WARN,A1 + +# hide "Got brand-new compresssor" messages +log4j.logger.org.apache.hadoop.io.compress=WARN,A1 + +# hide junk from TestRandomDeletes +log4j.logger.org.apache.accumulo.test.TestRandomDeletes=WARN,A1 + +# hide junk from VFS +log4j.logger.org.apache.commons.vfs2.impl.DefaultFileSystemManager=WARN,A1 + +# hide almost everything from zookeeper +log4j.logger.org.apache.zookeeper=ERROR,A1 + +# hide AUDIT messages in the shell, alternatively you could send them to a different logger +log4j.logger.org.apache.accumulo.core.util.shell.Shell.audit=WARN,A1 + +# Send most things to the console +log4j.appender.A1=org.apache.log4j.ConsoleAppender +log4j.appender.A1.layout.ConversionPattern=%d{ISO8601} [%-8c{2}] %-5p: %m%n +log4j.appender.A1.layout=org.apache.log4j.PatternLayout http://git-wip-us.apache.org/repos/asf/accumulo/blob/fc4de902/init/src/main/packaging/etc/accumulo/masters ---------------------------------------------------------------------- diff --git a/init/src/main/packaging/etc/accumulo/masters b/init/src/main/packaging/etc/accumulo/masters new file mode 100644 index 0000000..2fbb50c --- /dev/null +++ b/init/src/main/packaging/etc/accumulo/masters @@ -0,0 +1 @@ +localhost http://git-wip-us.apache.org/repos/asf/accumulo/blob/fc4de902/init/src/main/packaging/etc/accumulo/monitor_logger.xml ---------------------------------------------------------------------- diff --git a/init/src/main/packaging/etc/accumulo/monitor_logger.xml b/init/src/main/packaging/etc/accumulo/monitor_logger.xml new file mode 100644 index 0000000..91a7671 --- /dev/null +++ b/init/src/main/packaging/etc/accumulo/monitor_logger.xml @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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. +--> +<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> +<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> + + <!-- Write out everything at the DEBUG level to the debug log --> + <appender name="A2" class="org.apache.log4j.RollingFileAppender"> + <param name="File" value="${org.apache.accumulo.core.dir.log}/${org.apache.accumulo.core.application}_${org.apache.accumulo.core.ip.localhost.hostname}.debug.log"/> + <param name="MaxFileSize" value="100MB"/> + <param name="MaxBackupIndex" value="10"/> + <param name="Threshold" value="DEBUG"/> + <layout class="org.apache.log4j.PatternLayout"> + <param name="ConversionPattern" value="%d{ISO8601} [%-8c{2}] %-5p: %X{application} %m%n"/> + </layout> + </appender> + + <!-- Write out INFO and higher to the regular log --> + <appender name="A3" class="org.apache.log4j.RollingFileAppender"> + <param name="File" value="${org.apache.accumulo.core.dir.log}/${org.apache.accumulo.core.application}_${org.apache.accumulo.core.ip.localhost.hostname}.log"/> + <param name="MaxFileSize" value="100MB"/> + <param name="MaxBackupIndex" value="10"/> + <param name="Threshold" value="INFO"/> + <layout class="org.apache.log4j.PatternLayout"> + <param name="ConversionPattern" value="%d{ISO8601} [%-8c{2}] %-5p: %X{application} %m%n"/> + </layout> + </appender> + + <!-- Keep the last few log messages for display to the user --> + <appender name="GUI" class="org.apache.accumulo.server.monitor.LogService"> + <param name="keep" value="40"/> + <param name="Threshold" value="WARN"/> + </appender> + + <!-- Log accumulo messages to debug, normal and GUI --> + <logger name="org.apache.accumulo" additivity="false"> + <level value="DEBUG"/> + <appender-ref ref="A2" /> + <appender-ref ref="A3" /> + <appender-ref ref="GUI" /> + </logger> + + <!-- Log non-accumulo messages to debug, normal logs. --> + <root> + <level value="INFO"/> + <appender-ref ref="A2" /> + <appender-ref ref="A3" /> + </root> + +</log4j:configuration> http://git-wip-us.apache.org/repos/asf/accumulo/blob/fc4de902/init/src/main/packaging/etc/accumulo/monitors ---------------------------------------------------------------------- diff --git a/init/src/main/packaging/etc/accumulo/monitors b/init/src/main/packaging/etc/accumulo/monitors new file mode 100644 index 0000000..2fbb50c --- /dev/null +++ b/init/src/main/packaging/etc/accumulo/monitors @@ -0,0 +1 @@ +localhost http://git-wip-us.apache.org/repos/asf/accumulo/blob/fc4de902/init/src/main/packaging/etc/accumulo/slaves ---------------------------------------------------------------------- diff --git a/init/src/main/packaging/etc/accumulo/slaves b/init/src/main/packaging/etc/accumulo/slaves new file mode 100644 index 0000000..2fbb50c --- /dev/null +++ b/init/src/main/packaging/etc/accumulo/slaves @@ -0,0 +1 @@ +localhost http://git-wip-us.apache.org/repos/asf/accumulo/blob/fc4de902/init/src/main/packaging/etc/accumulo/tracers ---------------------------------------------------------------------- diff --git a/init/src/main/packaging/etc/accumulo/tracers b/init/src/main/packaging/etc/accumulo/tracers new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/init/src/main/packaging/etc/accumulo/tracers @@ -0,0 +1 @@ + http://git-wip-us.apache.org/repos/asf/accumulo/blob/fc4de902/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index dd912ca..eb163a1 100644 --- a/pom.xml +++ b/pom.xml @@ -90,6 +90,7 @@ <module>server/native</module> <module>server/tracer</module> <module>server/tserver</module> + <module>init</module> </modules> <scm> <connection>scm:git:git://git.apache.org/accumulo.git</connection> @@ -277,6 +278,18 @@ </dependency> <dependency> <groupId>org.apache.accumulo</groupId> + <artifactId>accumulo-init</artifactId> + <version>${project.version}</version> + <classifier>el6</classifier> + <type>rpm</type> + </dependency> + <dependency> + <groupId>org.apache.accumulo</groupId> + <artifactId>accumulo-init</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.accumulo</groupId> <artifactId>accumulo-master</artifactId> <version>${project.version}</version> <classifier>el6</classifier> http://git-wip-us.apache.org/repos/asf/accumulo/blob/fc4de902/server/base/pom.xml ---------------------------------------------------------------------- diff --git a/server/base/pom.xml b/server/base/pom.xml index 3e59fb8..5d31daa 100644 --- a/server/base/pom.xml +++ b/server/base/pom.xml @@ -127,7 +127,7 @@ <phase>package</phase> <configuration> <requires> - <require>jre >= 1.6.0</require> + <require>java-sdk >= 1.6.0</require> <require>accumulo-core = %{version}-%{release}</require> </requires> <mappings> @@ -136,6 +136,11 @@ <artifact /> </mapping> <mapping> + <directory>%{_var}/log/accumulo</directory> + <username>accumulo</username> + <filemode>770</filemode> + </mapping> + <mapping> <directory>%{_datadir}/accumulo/lib</directory> <dependency> <includes> http://git-wip-us.apache.org/repos/asf/accumulo/blob/fc4de902/server/gc/src/main/packaging/etc/init.d/accumulo-gc ---------------------------------------------------------------------- diff --git a/server/gc/src/main/packaging/etc/init.d/accumulo-gc b/server/gc/src/main/packaging/etc/init.d/accumulo-gc index 8ddd524..a6574ae 100755 --- a/server/gc/src/main/packaging/etc/init.d/accumulo-gc +++ b/server/gc/src/main/packaging/etc/init.d/accumulo-gc @@ -59,8 +59,7 @@ fi # Function that starts the daemon/service # do_start() { - TARGET_USER_NAME="ACCUMULO_USER" - TARGET_USER=$(eval "echo \$$TARGET_USER_NAME") + TARGET_USER="${ACCUMULO_USER-accumulo}" # Return # 0 if daemon has been started @@ -116,7 +115,8 @@ case "$1" in esac ;; status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? + echo -n "$NAME is " + jps -m | grep -q "$ACCUMULO_PROC" && (echo running.; exit 0) || (echo not running.; exit 1) ;; #reload|force-reload) # http://git-wip-us.apache.org/repos/asf/accumulo/blob/fc4de902/server/master/src/main/packaging/etc/init.d/accumulo-master ---------------------------------------------------------------------- diff --git a/server/master/src/main/packaging/etc/init.d/accumulo-master b/server/master/src/main/packaging/etc/init.d/accumulo-master index bbc3081..545db58 100755 --- a/server/master/src/main/packaging/etc/init.d/accumulo-master +++ b/server/master/src/main/packaging/etc/init.d/accumulo-master @@ -60,8 +60,7 @@ fi # do_start() { - TARGET_USER_NAME="ACCUMULO_USER" - TARGET_USER=$(eval "echo \$$TARGET_USER_NAME") + TARGET_USER="${ACCUMULO_USER-accumulo}" # Return # 0 if daemon has been started # 1 if daemon was already running @@ -117,7 +116,8 @@ case "$1" in esac ;; status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? + echo -n "$NAME is " + jps -m | grep -q "$ACCUMULO_PROC" && (echo running.; exit 0) || (echo not running.; exit 1) ;; #reload|force-reload) # http://git-wip-us.apache.org/repos/asf/accumulo/blob/fc4de902/server/monitor/src/main/packaging/etc/init.d/accumulo-monitor ---------------------------------------------------------------------- diff --git a/server/monitor/src/main/packaging/etc/init.d/accumulo-monitor b/server/monitor/src/main/packaging/etc/init.d/accumulo-monitor index 9c45339..147bb4b 100755 --- a/server/monitor/src/main/packaging/etc/init.d/accumulo-monitor +++ b/server/monitor/src/main/packaging/etc/init.d/accumulo-monitor @@ -60,8 +60,7 @@ fi # do_start() { - TARGET_USER_NAME="ACCUMULO_MONITOR_USER" - TARGET_USER=$(eval "echo \$$TARGET_USER_NAME") + TARGET_USER="${ACCUMULO_MONITOR_USER-accumulo}" # Return # 0 if daemon has been started # 1 if daemon was already running @@ -116,7 +115,8 @@ case "$1" in esac ;; status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? + echo -n "$NAME is " + jps -m | grep -q "$ACCUMULO_PROC" && (echo running.; exit 0) || (echo not running.; exit 1) ;; #reload|force-reload) # http://git-wip-us.apache.org/repos/asf/accumulo/blob/fc4de902/server/tracer/src/main/packaging/etc/init.d/accumulo-tracer ---------------------------------------------------------------------- diff --git a/server/tracer/src/main/packaging/etc/init.d/accumulo-tracer b/server/tracer/src/main/packaging/etc/init.d/accumulo-tracer index dd74391..b454769 100755 --- a/server/tracer/src/main/packaging/etc/init.d/accumulo-tracer +++ b/server/tracer/src/main/packaging/etc/init.d/accumulo-tracer @@ -60,8 +60,7 @@ fi # do_start() { - TARGET_USER_NAME="ACCUMULO_TRACER_USER" - TARGET_USER=$(eval "echo \$$TARGET_USER_NAME") + TARGET_USER="${ACCUMULO_TRACER_USER-accumulo}" # Return # 0 if daemon has been started # 1 if daemon was already running @@ -116,7 +115,8 @@ case "$1" in esac ;; status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? + echo -n "$NAME is " + jps -m | grep -q "$ACCUMULO_PROC" && (echo running.; exit 0) || (echo not running.; exit 1) ;; #reload|force-reload) # http://git-wip-us.apache.org/repos/asf/accumulo/blob/fc4de902/server/tserver/src/main/packaging/etc/init.d/accumulo-tserver ---------------------------------------------------------------------- diff --git a/server/tserver/src/main/packaging/etc/init.d/accumulo-tserver b/server/tserver/src/main/packaging/etc/init.d/accumulo-tserver index 902368b..2bbd138 100755 --- a/server/tserver/src/main/packaging/etc/init.d/accumulo-tserver +++ b/server/tserver/src/main/packaging/etc/init.d/accumulo-tserver @@ -60,8 +60,7 @@ fi # do_start() { - TARGET_USER_NAME="ACCUMULO_USER" - TARGET_USER=$(eval "echo \$$TARGET_USER_NAME") + TARGET_USER="${ACCUMULO_USER-accumulo}" # Return # 0 if daemon has been started # 1 if daemon was already running @@ -83,8 +82,7 @@ do_start() # do_stop() { - TARGET_USER_NAME="ACCUMULO_USER" - TARGET_USER=$(eval "echo \$$TARGET_USER_NAME") + TARGET_USER="${ACCUMULO_USER-accumulo}" # Return # 0 if daemon has been stopped # 1 if daemon was already stopped @@ -119,7 +117,8 @@ case "$1" in esac ;; status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? + echo -n "$NAME is " + jps -m | grep -q "$ACCUMULO_PROC" && (echo running.; exit 0) || (echo not running.; exit 1) ;; #reload|force-reload) #