diff --git a/2.2.5.tar.gz b/2.2.5.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..c4f233c6f1408e79e8100e0778352cff281015bd Binary files /dev/null and b/2.2.5.tar.gz differ diff --git a/hbase-site.xml b/hbase-site.xml new file mode 100644 index 0000000000000000000000000000000000000000..0f63a8d4891ab1085a2420ef0395ab6bfc0912a6 --- /dev/null +++ b/hbase-site.xml @@ -0,0 +1,70 @@ + + + + + + hbase.tmp.dir + /var/cache/hbase + The temporary directory. + + + + hbase.rootdir + hdfs://localhost:8020/hbase + The directory shared by RegionServers. + + + + hbase.cluster.distributed + true + The mode the cluster will be in. Possible values are + false: standalone and pseudo-distributed setups with managed Zookeeper + true: fully-distributed with unmanaged Zookeeper Quorum (see hbase-env.sh) + + + + hbase.zookeeper.quorum + localhost + Comma separated list of servers in the ZooKeeper Quorum. + For example, "host1.mydomain.com,host2.mydomain.com,host3.mydomain.com". + By default this is set to localhost for local and pseudo-distributed + modes of operation. For a fully-distributed setup, this should be set to + a full list of ZooKeeper quorum servers. If HBASE_MANAGES_ZK is set in + hbase-env.sh this is the list of servers which we will start/stop + ZooKeeper on. + + + + hbase.zookeeper.property.clientPort + 2181 + Property from ZooKeeper's config zoo.cfg. + The port at which the clients will connect. + + + + hbase.zookeeper.property.dataDir + /var/lib/hbase/zookeeper + Property from ZooKeeper's config zoo.cfg. + The directory where the snapshot is stored. + + + diff --git a/hbase.logrotate b/hbase.logrotate new file mode 100644 index 0000000000000000000000000000000000000000..40da6e1092caadf1620348c3625e9a9a93b957c6 --- /dev/null +++ b/hbase.logrotate @@ -0,0 +1,8 @@ +/var/log/hbase/*.log +{ + missingok + copytruncate + compress + weekly + rotate 52 +} diff --git a/hbase.service.template b/hbase.service.template new file mode 100644 index 0000000000000000000000000000000000000000..0235b539079ba35c06ef1e8eac128b6c8deecea4 --- /dev/null +++ b/hbase.service.template @@ -0,0 +1,21 @@ +[Unit] +Description=The HBase DAEMON daemon +After=network.target +After=NetworkManager.target + +[Service] +Type=forking +EnvironmentFile=-/etc/sysconfig/hbase +EnvironmentFile=-/etc/sysconfig/hbase-DAEMON +ExecStart=/usr/bin/hbase-daemon.sh start DAEMON +ExecStop=/usr/bin/hbase-daemon.sh stop DAEMON +User=hbase +Group=hbase +PIDFile=/var/run/hbase/hbase-hbase-DAEMON.pid +LimitNOFILE=32768 +LimitNPROC=65536 +LimitMEMLOCK=infinity +#ControlGroup=cpu:/hbase memory:/hbase + +[Install] +WantedBy=multi-user.target diff --git a/hbase.spec b/hbase.spec new file mode 100644 index 0000000000000000000000000000000000000000..d534931cacb6d0bcda48c7052b43f54af71789d0 --- /dev/null +++ b/hbase.spec @@ -0,0 +1,304 @@ +%global _hardened_build 1 + +%global services hbase-master.service hbase-thrift.service hbase-rest.service hbase-zookeeper.service hbase-regionserver.service + +# Currently disabled because packaging the singular binary in a noarch package +# is troublesome +%global package_native 0 + +Name: hbase +Version: 2.2.5 +Release: 1 +Summary: A database for Apache Hadoop +License: Apache-2.0 and BSD and CPL-1.0 and EPL-1.0 and MIT +URL: http://hbase.apache.org/ +Source0: https://github.com/apache/%{name}/archive/rel/%{version}.tar.gz +Source1: %{name}.logrotate +Source2: %{name}-site.xml +Source3: %{name}.service.template +Source4: xmvn-reactor +BuildArch: noarch + +BuildRequires: cmake +BuildRequires: gcc-c++ +BuildRequires: gradle-local xmvn xmvn-install +BuildRequires: systemd +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root +BuildRequires: java-1.8.0-openjdk-devel maven hostname maven-local protobuf2-devel protobuf2-compiler protobuf2 +Requires: java-1.8.0-openjdk + +# Required for the shell +Requires: bytelist +Requires: invokebinder +Requires: jcodings +Requires: jansi +Requires: jline +Requires: jnr-ffi +Requires: jnr-posix +Requires: jnr-constants +# Documenting the dep here, but it's detected in autoRequires +Requires: joda-time +Requires: joni +Requires: objectweb-asm + +Requires: apache-commons-lang3 +Requires: glassfish-el-api + +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd + +%description +Apache HBase is a database for Apache Hadoop that provides a distributed, +scalable, big data store. + +%if %{package_native} +%package native +Summary: Native Apache HBase libraries +Requires: %{name} = %{version}-%{release} + +%description native +Apache HBase is a database for Apache Hadoop that provides a distributed, +scalable, big data store. + +This package contains native libraries for Apache HBase. +%endif + +%if %{with javadoc} +%package javadoc +Summary: Javadoc for Apache HBase +BuildArch: noarch + +%description javadoc +This package contains the API documentation for %{name}. +%endif + +%prep +%setup -qn %{name}-rel-%{version} +mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=2.5.0 -Dclassifier=linux-aarch_64 -Dpackaging=exe -Dfile=/usr/bin/protoc +cp %{SOURCE4} ./.xmvn-reactor +echo `pwd` > absolute_prefix.log +sed -i 's/\//\\\//g' absolute_prefix.log +absolute_prefix=`head -n 1 absolute_prefix.log` +sed -i 's/absolute-prefix/'"$absolute_prefix"'/g' .xmvn-reactor + +%build +mvn -Pnative clean install -DskipTests assembly:single -Prelease -Dmaven.javadoc.skip=true -Drat.skip=true + +%if %{with tests} +%check +%if %{package_native} +profile="-Pnative" +%endif +xmvn -o -Dhadoop.profile=2.0 $profile test +%endif + +%install +%mvn_install + +# Extract the binary tarball +tar -C %{name}-assembly/target -zxf %{name}-assembly/target/%{name}-%{version}-bin.tar.gz + +install -d -m 0755 %{buildroot}/%{_bindir} +install -d -m 0755 %{buildroot}/%{_datadir}/%{name}/bin +install -d -m 0755 %{buildroot}/%{_datadir}/%{name}/lib +install -d -m 0755 %{buildroot}/%{_datadir}/%{name}/%{name}-webapps +install -d -m 0755 %{buildroot}/%{_libdir}/%{name} +install -d -m 0755 %{buildroot}/%{_sysconfdir}/%{name} +install -d -m 0755 %{buildroot}/%{_sysconfdir}/logrotate.d +install -d -m 0755 %{buildroot}/%{_tmpfilesdir} +install -d -m 0755 %{buildroot}/%{_unitdir} +install -d -m 0755 %{buildroot}/%{_var}/cache/%{name} +install -d -m 0755 %{buildroot}/%{_sharedstatedir}/%{name}/zookeeper +install -d -m 0755 %{buildroot}/%{_var}/log/%{name} +install -d -m 0755 %{buildroot}/%{_var}/run/%{name} + +pushd %{name}-assembly/target/%{name}-%{version} + # Binaries + cp -arf bin/* %{buildroot}/%{_datadir}/%{name}/bin + rm -f %{buildroot}/%{_datadir}/%{name}/bin/*.cmd + pushd %{buildroot}/%{_datadir}/%{name}/bin + # Create symlinks for commands in _bindir + for f in `ls | grep -v \\.rb` + do + if [ -f $f ] + then + %{__ln_s} %{_datadir}/%{name}/bin/$f %{buildroot}/%{_bindir} + fi + done + popd + # Remove symlinks from files that aren't commands but are includes + pushd %{buildroot}/%{_bindir} + rm -f %{name}-common %{name}-config + popd + + # Configuration + install -m 0644 conf/* %{buildroot}/%{_sysconfdir}/%{name} + rm -f %{buildroot}/%{_sysconfdir}/%{name}/*.cmd + install -m 0644 %{SOURCE2} %{buildroot}/%{_sysconfdir}/%{name} + + # Modify hbase-env.sh to point to the correct location for JAVA_HOME + sed -i "s|#\s*export JAVA_HOME.*|export JAVA_HOME=/usr/lib/jvm/jre|" %{buildroot}/%{_sysconfdir}/%{name}/%{name}-env.sh + + # Modify hbase-env.sh to point to the correct location for pid creation + sed -i "s|#\s*export HBASE_PID_DIR.*|export HBASE_PID_DIR=/var/run/hbase|" %{buildroot}/%{_sysconfdir}/%{name}/%{name}-env.sh + + # Modify hbase-env.sh to point to the correct location for log files + sed -i "s|#\s*export HBASE_LOG_DIR.*|export HBASE_LOG_DIR=/var/log/hbase|" %{buildroot}/%{_sysconfdir}/%{name}/%{name}-env.sh + + # Link the hdfs-site.xml into the config directory to pick up any HDFS + # client configuration + %{__ln_s} %{_sysconfdir}/hadoop/hdfs-site.xml %{buildroot}/%{_sysconfdir}/%{name} + + # Webapps + cp -arp %{name}-webapps/* %{buildroot}/%{_datadir}/%{name}/%{name}-webapps + + # Dependency jars + install -m 0755 lib/hbase-shaded-miscellaneous-2.2.1.jar %{buildroot}%{_datadir}/java/%{name}/hbase-shaded-miscellaneous-2.2.1.jar + install -m 0755 lib/hbase-shaded-netty-2.2.1.jar %{buildroot}%{_datadir}/java/%{name}/hbase-shaded-netty-2.2.1.jar + install -m 0755 lib/hbase-shaded-protobuf-2.2.1.jar %{buildroot}%{_datadir}/java/%{name}/hbase-shaded-protobuf-2.2.1.jar + install lib/*.jar %{buildroot}/%{_datadir}/%{name}/lib + rm -f %{buildroot}/%{_datadir}/%{name}/lib/tools-*.jar + rm -f %{buildroot}/%{_datadir}/%{name}/lib/%{name}*-tests.jar + rm -f %{buildroot}/%{_datadir}/%{name}/lib/%{name}-testing-util-*.jar + rm -f %{buildroot}/%{_datadir}/%{name}/lib/tomcat-*.jar + rm -f %{buildroot}/%{_datadir}/%{name}/lib/servlet-api-*.jar + pushd %{buildroot}/%{_datadir}/%{name}/lib + # Replace jar files with symlinks for all jars from the build + for f in `ls hbase*` + do + n=`echo $f | sed "s/-%{version}//"` + rm -f $f + %{__ln_s} %{_javadir}/%{name}/$n $f + done + popd + + # jruby bits + cp -arf lib/ruby %{buildroot}/%{_datadir}/%{name}/lib + +%if 0 + # Native libraries + cp -arf lib/native/* %{buildroot}/%{_libdir}/%{name} +%endif +popd + +pushd %{buildroot}/%{_datadir}/%{name} + %{__ln_s} %{_sysconfdir}/%{name} conf + %{__ln_s} %{_libdir}/%{name} lib/native + %{__ln_s} %{_var}/log/%{name} logs + %{__ln_s} %{_var}/run/%{name} pids +popd + +# Add jars to the classpath for hbase shell +echo "export HBASE_CLASSPATH_PREFIX=$(build-classpath objectweb-asm/asm objectweb-asm/asm-commons jnr-posix jnr-constants joni jruby bytelist jcodings jnr-ffi joda-time jline jansi invokebinder):\$HBASE_CLASSPATH" > %{buildroot}/%{_sysconfdir}/%{name}/%{name}-env-shell.sh +echo "export JRUBY_HOME=/usr/share/jruby" >> %{buildroot}/%{_sysconfdir}/%{name}/%{name}-env-shell.sh + +# Ensure /var/run directory is recreated on boot +echo "d %{_var}/run/%{name} 0775 hbase hbase -" > %{buildroot}/%{_tmpfilesdir}/%{name}.conf + +# logrotate config +install -m 0644 %{SOURCE1} %{buildroot}/%{_sysconfdir}/logrotate.d/%{name} + +# systemd configuration +for service in %{services} +do + s=`echo $service | cut -d'-' -f 2- | cut -d'.' -f 1` + sed -e "s|DAEMON|$s|g" %{SOURCE3} > %{buildroot}/%{_unitdir}/%{name}-$s.service +done + +%pretrans -p +path = "%{_datadir}/%{name}/%{name}-webapps" +st = posix.stat(path) +if st and st.type == "link" then + os.remove(path) +end + +%pre +getent group hbase >/dev/null || /usr/sbin/groupadd -r hbase +getent passwd hbase > /dev/null || /usr/sbin/useradd -c "Apache HBase" -s /sbin/nologin -g hbase -r -d %{_sharedstatedir}/%{name} hbase + +%preun +%systemd_preun %{services} + +%post +# Change the home directory for the hbase user +if [[ `getent passwd hbase | cut -d: -f 6` != "%{_sharedstatedir}/%{name}" ]] +then + /usr/sbin/usermod -d %{_sharedstatedir}/%{name} hbase +fi + +if [ $1 -gt 1 ] +then + if [ -d %{_var}/cache/%{name}/zookeeper ] && [ ! -L %{_var}/cache/%{name}/zookeeper ] + then + # Move the existing zookeeper data to the new location + mv -f %{_var}/cache/%{name}/zookeeper/* %{_sharedstatedir}/%{name}/zookeeper + fi + + if [ -d %{_var}/cache/%{name}/%{name} ] && [ ! -L %{_var}/cache/%{name}/%{name} ] + then + # Move the existing hbase data to the new location + mv -f %{_var}/cache/%{name}/%{name}/* %{_var}/cache/%{name} + fi +fi +%systemd_post %{services} + +%postun +%systemd_postun_with_restart %{services} + +if [ $1 -lt 1 ] +then + # Remove compatibility symlinks + rm -f %{_var}/cache/%{name}/%{name} + rm -f %{_var}/cache/%{name}/zookeeper +fi + +%posttrans +# Create symlinks to the new locations for zookeeper and hbase data in case +# the user changed the configuration file and the new one isn't in place to +# point to the correct location +if [ -d %{_var}/cache/%{name}/zookeeper ] +then + rm -rf %{_var}/cache/%{name}/zookeeper +fi +if [ ! -e %{_var}/cache/%{name}/zookeeper ] +then + %{__ln_s} %{_sharedstatedir}/%{name}/zookeeper %{_var}/cache/%{name} +fi + +if [ -d %{_var}/cache/%{name}/%{name} ] +then + rm -rf %{_var}/cache/%{name}/%{name} +fi +if [ ! -e %{_var}/cache/%{name}/%{name} ] +then + %{__ln_s} %{_var}/cache/%{name} %{_var}/cache/%{name} +fi + +%files -f .mfiles +%doc LICENSE.txt NOTICE.txt README.txt +%exclude %{_datadir}/%{name}/lib/native +%{_bindir}/* +%{_datadir}/%{name} +%dir %{_javadir}/%{name} +%attr(-,hbase,hbase) %{_sharedstatedir}/%{name} +%config(noreplace) %{_sysconfdir}/%{name} +%config(noreplace) %{_sysconfdir}/logrotate.d/%{name} +%{_tmpfilesdir}/%{name}.conf +%{_unitdir}/%{name}-*.service +%attr(0755,hbase,hbase) %dir %{_var}/cache/%{name} +%attr(0755,hbase,hbase) %dir %{_var}/log/%{name} +%attr(0755,hbase,hbase) %dir %{_var}/run/%{name} +%attr(0755,root,root) %{_datadir}/java/%{name}/hbase-shaded-miscellaneous-2.2.1.jar +%attr(0755,root,root) %{_datadir}/java/%{name}/hbase-shaded-netty-2.2.1.jar +%attr(0755,root,root) %{_datadir}/java/%{name}/hbase-shaded-protobuf-2.2.1.jar + +%if %{package_native} +%files native +%{_datadir}/%{name}/lib/native +%{_libdir}/%{name} +%endif + +%changelog +* Tue Mar 16 2021 Ge Wang 2.2.5-1 +- Init package diff --git a/xmvn-reactor b/xmvn-reactor new file mode 100644 index 0000000000000000000000000000000000000000..bd3a6bb6f03640dadf399fc5cd73ed60329fd8b8 --- /dev/null +++ b/xmvn-reactor @@ -0,0 +1,451 @@ + + + + + org.apache.hbase + hbase-assembly + pom + 2.2.5 + absolute-prefix/hbase-assembly/pom.xml + + jar + 1.6 + + + + + org.apache.hbase + hbase-client + 2.2.5 + absolute-prefix/hbase-client/target/hbase-client-2.2.5.jar + + jar + 1.6 + + + + org.apache.hbase + hbase-client + pom + 2.2.5 + absolute-prefix/hbase-client/pom.xml + + jar + 1.6 + + + + + org.apache.hbase + hbase-common + 2.2.5 + absolute-prefix/hbase-common/target/hbase-common-2.2.5.jar + + jar + 1.6 + + + + org.apache.hbase + hbase-common + pom + 2.2.5 + absolute-prefix/hbase-common/pom.xml + + jar + 1.6 + + + + + org.apache.hbase + hbase-examples + 2.2.5 + absolute-prefix/hbase-examples/target/hbase-examples-2.2.5.jar + + jar + 1.6 + + + + org.apache.hbase + hbase-examples + pom + 2.2.5 + absolute-prefix/hbase-examples/pom.xml + + jar + 1.6 + + + + + org.apache.hbase + hbase-hadoop-compat + 2.2.5 + absolute-prefix/hbase-hadoop-compat/target/hbase-hadoop-compat-2.2.5.jar + + jar + 1.6 + + + + org.apache.hbase + hbase-hadoop-compat + pom + 2.2.5 + absolute-prefix/hbase-hadoop-compat/pom.xml + + jar + 1.6 + + + + + org.apache.hbase + hbase-hadoop2-compat + 2.2.5 + absolute-prefix/hbase-hadoop2-compat/target/hbase-hadoop2-compat-2.2.5.jar + + jar + 1.6 + + + + org.apache.hbase + hbase-hadoop2-compat + pom + 2.2.5 + absolute-prefix/hbase-hadoop2-compat/pom.xml + + jar + 1.6 + + + + + org.apache.hbase + hbase-it + 2.2.5 + absolute-prefix/hbase-it/target/hbase-it-2.2.5.jar + + jar + 1.6 + + + + org.apache.hbase + hbase-it + pom + 2.2.5 + absolute-prefix/hbase-it/pom.xml + + jar + 1.6 + + + + + + + org.apache.hbase + hbase-protocol + 2.2.5 + absolute-prefix/hbase-protocol/target/hbase-protocol-2.2.5.jar + + jar + 1.6 + + + + org.apache.hbase + hbase-protocol + pom + 2.2.5 + absolute-prefix/hbase-protocol/pom.xml + + jar + 1.6 + + + + + org.apache.hbase + hbase-server + 2.2.5 + absolute-prefix/hbase-server/target/hbase-server-2.2.5.jar + + jar + 1.6 + + + + org.apache.hbase + hbase-server + pom + 2.2.5 + absolute-prefix/hbase-server/pom.xml + + jar + 1.6 + + + + + org.apache.hbase + hbase-shell + 2.2.5 + absolute-prefix/hbase-shell/target/hbase-shell-2.2.5.jar + + jar + 1.6 + + + + org.apache.hbase + hbase-shell + pom + 2.2.5 + absolute-prefix/hbase-shell/pom.xml + + jar + 1.6 + + + + + org.apache.hbase + hbase-thrift + 2.2.5 + absolute-prefix/hbase-thrift/target/hbase-thrift-2.2.5.jar + + jar + 1.6 + + + + org.apache.hbase + hbase-thrift + pom + 2.2.5 + absolute-prefix/hbase-thrift/pom.xml + + jar + 1.6 + + + + + org.apache.hbase + hbase + pom + 2.2.5 + absolute-prefix/pom.xml + + jar + 1.6 + + + + + org.apache.hbase + hbase-annotations + 2.2.5 + absolute-prefix/hbase-annotations/target/hbase-annotations-2.2.5.jar + + jar + 1.6 + + + + org.apache.hbase + hbase-endpoint + 2.2.5 + absolute-prefix/hbase-endpoint/target/hbase-endpoint-2.2.5.jar + + jar + 1.6 + + + + org.apache.hbase + hbase-external-blockcache + 2.2.5 + absolute-prefix/hbase-external-blockcache/target/hbase-external-blockcache-2.2.5.jar + + jar + 1.6 + + + + org.apache.hbase + hbase-hbtop + 2.2.5 + absolute-prefix/hbase-hbtop/target/hbase-hbtop-2.2.5.jar + + jar + 1.6 + + + + org.apache.hbase + hbase-http + 2.2.5 + absolute-prefix/hbase-http/target/hbase-http-2.2.5.jar + + jar + 1.6 + + + + org.apache.hbase + hbase-mapreduce + 2.2.5 + absolute-prefix/hbase-mapreduce/target/hbase-mapreduce-2.2.5.jar + + jar + 1.6 + + + + org.apache.hbase + hbase-metrics + 2.2.5 + absolute-prefix/hbase-metrics/target/hbase-metrics-2.2.5.jar + + jar + 1.6 + + + + org.apache.hbase + hbase-metrics-api + 2.2.5 + absolute-prefix/hbase-metrics-api/target/hbase-metrics-api-2.2.5.jar + + jar + 1.6 + + + + org.apache.hbase + hbase-procedure + 2.2.5 + absolute-prefix/hbase-procedure/target/hbase-procedure-2.2.5.jar + + jar + 1.6 + + + + org.apache.hbase + hbase-protocol-shaded + 2.2.5 + absolute-prefix/hbase-protocol-shaded/target/hbase-protocol-shaded-2.2.5.jar + + jar + 1.6 + + + + org.apache.hbase + hbase-replication + 2.2.5 + absolute-prefix/hbase-replication/target/hbase-replication-2.2.5.jar + + jar + 1.6 + + + + org.apache.hbase + hbase-resource-bundle + 2.2.5 + absolute-prefix/hbase-resource-bundle/target/hbase-resource-bundle-2.2.5.jar + + jar + 1.6 + + + + org.apache.hbase + hbase-rest + 2.2.5 + absolute-prefix/hbase-rest/target/hbase-rest-2.2.5.jar + + jar + 1.6 + + + + org.apache.hbase + hbase-rsgroup + 2.2.5 + absolute-prefix/hbase-rsgroup/target/hbase-rsgroup-2.2.5.jar + + jar + 1.6 + + + + + org.apache.hbase + hbase-zookeeper + 2.2.5 + absolute-prefix/hbase-zookeeper/target/hbase-zookeeper-2.2.5.jar + + jar + 1.6 + + + +