Updated Branches: refs/heads/master a34142a7e -> 5de186bc9
BIGTOP-1108. Solr 4.5.0 has been formally released and we should start using the official release bits Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/822a6ea1 Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/822a6ea1 Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/822a6ea1 Branch: refs/heads/master Commit: 822a6ea1ac7cd31368900758a4041a9a63531de5 Parents: a34142a Author: Roman Shaposhnik <[email protected]> Authored: Thu Oct 3 17:46:28 2013 -0700 Committer: Roman Shaposhnik <[email protected]> Committed: Fri Oct 4 13:18:52 2013 -0700 ---------------------------------------------------------------------- .../puppet/modules/solr/manifests/init.pp | 45 ++++++++++---------- .../puppet/modules/solr/templates/jaas.conf | 24 +++++++++++ .../puppet/modules/solr/templates/solr | 19 +++++++-- .../puppet/modules/solr/templates/solr.xml | 26 ----------- bigtop-deploy/puppet/modules/solr/tests/init.pp | 3 +- bigtop-packages/src/common/hadoop/init-hdfs.sh | 4 +- bigtop.mk | 6 +-- 7 files changed, 70 insertions(+), 57 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/bigtop/blob/822a6ea1/bigtop-deploy/puppet/modules/solr/manifests/init.pp ---------------------------------------------------------------------- diff --git a/bigtop-deploy/puppet/modules/solr/manifests/init.pp b/bigtop-deploy/puppet/modules/solr/manifests/init.pp index 9163ce9..22c4d9e 100644 --- a/bigtop-deploy/puppet/modules/solr/manifests/init.pp +++ b/bigtop-deploy/puppet/modules/solr/manifests/init.pp @@ -14,15 +14,7 @@ # limitations under the License. class solr { - define solrcloud_config($confdir, $zk) { - exec { "ZK $title config upload": - command => "/bin/bash -c \"java -classpath '/usr/lib/solr/server/webapps/solr/WEB-INF/lib/*' org.apache.solr.cloud.ZkCLI -cmd makepath /solr -zkhost ${zk} ; java -classpath '/usr/lib/solr/server/webapps/solr/WEB-INF/lib/*' org.apache.solr.cloud.ZkCLI -cmd upconfig -confdir ${confdir}/${title}/conf -confname $title -zkhost ${zk}/solr\"", - logoutput => true, - } - } - - - define server($collections = ["solrcloud"], $port = "1978", $port_admin = "1979", $zk = "localhost:2181") { + define server($port = "1978", $port_admin = "1979", $zk = "localhost:2181", $root_url = "hdfs://localhost:8020/solr", $kerberos_realm = "") { package { "solr-server": ensure => latest, } @@ -33,25 +25,34 @@ class solr { require => [Package["solr-server"]], } - file { - "/etc/solr/conf/solr.xml": - content => template("solr/solr.xml"), - require => [Package["solr-server"]], - } - - # FIXME: perhap we have to provide a way to manage collection configs - solrcloud_config { $collections: - zk => $zk, - confdir => "/etc/solr/conf", - require => [Package["solr-server"]], + exec { "solr init": + command => "/bin/bash -c '/usr/bin/solrctl debug-dump | grep -q solr.xml || /usr/bin/solrctl init'", + require => [ Package["solr-server"], File["/etc/default/solr"] ], + logoutput => true, } service { "solr-server": ensure => running, - require => [ Package["solr-server"], File["/etc/default/solr"], File["/etc/solr/conf/solr.xml"], Solrcloud_config[$collections] ], - subscribe => [Package["solr-server"], File["/etc/default/solr"], File["/etc/solr/conf/solr.xml"] ], + require => [ Package["solr-server"], File["/etc/default/solr"], Exec["solr init"] ], + subscribe => [Package["solr-server"], File["/etc/default/solr"] ], hasrestart => true, hasstatus => true, } + + if ($kerberos_realm) { + require kerberos::client + + kerberos::host_keytab { "solr": + spnego => true, + require => Package["solr-server"], + } + + file { "/etc/solr/conf/jaas.conf": + content => template("solr/jaas.conf"), + require => [Package["solr-server"]], + } + + Kerberos::Host_keytab <| title == "solr" |> -> Service["solr-server"] + } } } http://git-wip-us.apache.org/repos/asf/bigtop/blob/822a6ea1/bigtop-deploy/puppet/modules/solr/templates/jaas.conf ---------------------------------------------------------------------- diff --git a/bigtop-deploy/puppet/modules/solr/templates/jaas.conf b/bigtop-deploy/puppet/modules/solr/templates/jaas.conf new file mode 100644 index 0000000..aff0d5c --- /dev/null +++ b/bigtop-deploy/puppet/modules/solr/templates/jaas.conf @@ -0,0 +1,24 @@ +/** + * 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 + * <p/> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p/> + * 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. + */ +Client { + com.sun.security.auth.module.Krb5LoginModule required + useKeyTab=true + useTicketCache=false + keyTab="/etc/solr.keytab" + principal="solr/<%= fqdn %>@<%= kerberos_realm %>"; +}; http://git-wip-us.apache.org/repos/asf/bigtop/blob/822a6ea1/bigtop-deploy/puppet/modules/solr/templates/solr ---------------------------------------------------------------------- diff --git a/bigtop-deploy/puppet/modules/solr/templates/solr b/bigtop-deploy/puppet/modules/solr/templates/solr index ffab877..0f17ee9 100644 --- a/bigtop-deploy/puppet/modules/solr/templates/solr +++ b/bigtop-deploy/puppet/modules/solr/templates/solr @@ -12,9 +12,22 @@ # 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. +SOLR_LOG=/var/log/solr SOLR_PORT="<%= port %>" SOLR_ADMIN_PORT="<%= port_admin %>" SOLR_ZK_ENSEMBLE="<%= zk %>/solr" -SOLR_LOG=/var/log/solr -SOLR_DATA_DIR=/var/lib/solr/index -# CATALINA_OPTS="-Dfoo=bar" +SOLR_HDFS_HOME=<%= root_url %>/solr +SOLR_HDFS_CONFIG=/etc/hadoop/conf + +<% if @kerberos_realm == "" %> +SOLR_AUTHENTICATION_TYPE=simple +SOLR_AUTHENTICATION_SIMPLE_ALLOW_ANON=true +<% else %> +SOLR_KERBEROS_ENABLED=true +SOLR_KERBEROS_KEYTAB=/etc/solr.keytab +SOLR_KERBEROS_PRINCIPAL="solr/<%= fqdn %>@<%= kerberos_realm %>" +SOLR_AUTHENTICATION_KERBEROS_KEYTAB=/etc/solr.keytab +SOLR_AUTHENTICATION_KERBEROS_PRINCIPAL="HTTP/<%= fqdn %>@<%= kerberos_realm %>" +SOLR_AUTHENTICATION_KERBEROS_NAME_RULES=DEFAULT +SOLR_AUTHENTICATION_JAAS_CONF=/etc/solr/conf/jaas.conf +<% end %> http://git-wip-us.apache.org/repos/asf/bigtop/blob/822a6ea1/bigtop-deploy/puppet/modules/solr/templates/solr.xml ---------------------------------------------------------------------- diff --git a/bigtop-deploy/puppet/modules/solr/templates/solr.xml b/bigtop-deploy/puppet/modules/solr/templates/solr.xml deleted file mode 100644 index 66309f3..0000000 --- a/bigtop-deploy/puppet/modules/solr/templates/solr.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?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. ---> -<solr persistent="false"> - <cores adminPath="/admin/cores" host="<%= fqdn %>" hostPort="<%= port %>" hostContext="${hostContext:}" zkClientTimeout="${zkClientTimeout:15000}"> -<% collections.each do |collection| %> - <core name="<%= collection %>_<%= fqdn.to_s.tr('.', '_') %>" shard="<%= collection %>_<%= fqdn.to_s.tr('.', '_') %>" collection="<%= collection %>" - instanceDir="<%= fqdn.to_s.tr('.', '_') %>/" schema="schema.xml" config="solrconfig.xml"/> -<% end %> - </cores> -</solr> - http://git-wip-us.apache.org/repos/asf/bigtop/blob/822a6ea1/bigtop-deploy/puppet/modules/solr/tests/init.pp ---------------------------------------------------------------------- diff --git a/bigtop-deploy/puppet/modules/solr/tests/init.pp b/bigtop-deploy/puppet/modules/solr/tests/init.pp index 643abb5..cc3f73c 100644 --- a/bigtop-deploy/puppet/modules/solr/tests/init.pp +++ b/bigtop-deploy/puppet/modules/solr/tests/init.pp @@ -14,8 +14,9 @@ # limitations under the License. solr::server { "test-solr-server": - collections => ["collection1", "solrcloud", "a", "b", "c"], port => "1978", port_admin => "1979", zk => "localhost:2181", + root_url => "hdfs://localhost:8020/solr", + kerberos_realm => "KRB.YOU.ORG", } http://git-wip-us.apache.org/repos/asf/bigtop/blob/822a6ea1/bigtop-packages/src/common/hadoop/init-hdfs.sh ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/common/hadoop/init-hdfs.sh b/bigtop-packages/src/common/hadoop/init-hdfs.sh index bc96761..3a5fe36 100755 --- a/bigtop-packages/src/common/hadoop/init-hdfs.sh +++ b/bigtop-packages/src/common/hadoop/init-hdfs.sh @@ -34,6 +34,8 @@ su -s /bin/bash hdfs -c '/usr/bin/hadoop fs -chmod -R 1777 /var/log/hadoop-yarn/ su -s /bin/bash hdfs -c '/usr/bin/hadoop fs -chown yarn:mapred /var/log/hadoop-yarn/apps' su -s /bin/bash hdfs -c '/usr/bin/hadoop fs -mkdir /hbase' su -s /bin/bash hdfs -c '/usr/bin/hadoop fs -chown hbase:hbase /hbase' +su -s /bin/bash hdfs -c '/usr/bin/hadoop fs -mkdir /solr' +su -s /bin/bash hdfs -c '/usr/bin/hadoop fs -chown solr:solr /solr' su -s /bin/bash hdfs -c '/usr/bin/hadoop fs -mkdir /benchmarks' su -s /bin/bash hdfs -c '/usr/bin/hadoop fs -chmod -R 777 /benchmarks' su -s /bin/bash hdfs -c '/usr/bin/hadoop fs -mkdir /user' @@ -94,4 +96,4 @@ if [ "$1" = "-u" ] ; then su -s /bin/bash hdfs -c "/usr/bin/hadoop fs -chmod -R 755 /user/${USER}" su -s /bin/bash hdfs -c "/usr/bin/hadoop fs -chown ${USER} /user/${USER}" fi -fi \ No newline at end of file +fi http://git-wip-us.apache.org/repos/asf/bigtop/blob/822a6ea1/bigtop.mk ---------------------------------------------------------------------- diff --git a/bigtop.mk b/bigtop.mk index f7235d5..502573d 100644 --- a/bigtop.mk +++ b/bigtop.mk @@ -219,10 +219,8 @@ SOLR_RELEASE_VERSION=1 SOLR_TARBALL_DST=solr-$(SOLR_BASE_VERSION)-src.tgz SOLR_TARBALL_SRC=$(SOLR_TARBALL_DST) SOLR_DOWNLOAD_PATH=/lucene/solr/$(SOLR_BASE_VERSION) -#SOLR_SITE=$(APACHE_MIRROR)$(SOLR_DOWNLOAD_PATH) -#SOLR_ARCHIVE=$(APACHE_ARCHIVE)$(SOLR_DOWNLOAD_PATH) -SOLR_SITE=http://people.apache.org/~jpountz/staging_area/lucene-solr-4.5.0-RC3-rev1526423/solr/ -SOLR_ARCHIVE=$(SOLR_SITE) +SOLR_SITE=$(APACHE_MIRROR)$(SOLR_DOWNLOAD_PATH) +SOLR_ARCHIVE=$(APACHE_ARCHIVE)$(SOLR_DOWNLOAD_PATH) $(eval $(call PACKAGE,solr,SOLR)) # Crunch
