diff --git a/content/posts/2019-01.md b/content/posts/2019-01.md index 00ec16971..48cc80a8a 100644 --- a/content/posts/2019-01.md +++ b/content/posts/2019-01.md @@ -605,4 +605,79 @@ sys 0m2.396s - The query currently shows 3023 items, but a [Discovery search for Livestock CRP only returns 858 items](https://cgspace.cgiar.org/discover?filtertype_1=crpsubject&filter_relational_operator_1=equals&filter_1=Livestock&submit_apply_filter=&query=) - That query seems to return items tagged with `Livestock and Fish` CRP as well... hmm. +## 2019-01-21 + +- Investigating running Tomcat 7 on Ubuntu 18.04 with the tarball and a custom systemd package instead of waiting for our DSpace to get compatible with Ubuntu 18.04's Tomcat 8.5 +- I could either run with a simple `tomcat7.service` like this: + +``` +[Unit] +Description=Apache Tomcat 7 Web Application Container +After=network.target +[Service] +Type=forking +ExecStart=/path/to/apache-tomcat-7.0.92/bin/startup.sh +ExecStop=/path/to/apache-tomcat-7.0.92/bin/shutdown.sh +User=aorth +Group=aorth +[Install] +WantedBy=multi-user.target +``` + +- Or try to use adapt a real systemd service like Arch Linux's: + +``` +[Unit] +Description=Tomcat 7 servlet container +After=network.target + +[Service] +Type=forking +PIDFile=/var/run/tomcat7.pid +Environment=CATALINA_PID=/var/run/tomcat7.pid +Environment=TOMCAT_JAVA_HOME=/usr/lib/jvm/default-runtime +Environment=CATALINA_HOME=/usr/share/tomcat7 +Environment=CATALINA_BASE=/usr/share/tomcat7 +Environment=CATALINA_OPTS= +Environment=ERRFILE=SYSLOG +Environment=OUTFILE=SYSLOG + +ExecStart=/usr/bin/jsvc \ + -Dcatalina.home=${CATALINA_HOME} \ + -Dcatalina.base=${CATALINA_BASE} \ + -Djava.io.tmpdir=/var/tmp/tomcat7/temp \ + -cp /usr/share/java/commons-daemon.jar:/usr/share/java/eclipse-ecj.jar:${CATALINA_HOME}/bin/bootstrap.jar:${CATALINA_HOME}/bin/tomcat-juli.jar \ + -user tomcat7 \ + -java-home ${TOMCAT_JAVA_HOME} \ + -pidfile /var/run/tomcat7.pid \ + -errfile ${ERRFILE} \ + -outfile ${OUTFILE} \ + $CATALINA_OPTS \ + org.apache.catalina.startup.Bootstrap + +ExecStop=/usr/bin/jsvc \ + -pidfile /var/run/tomcat7.pid \ + -stop \ + org.apache.catalina.startup.Bootstrap + +[Install] +WantedBy=multi-user.target +``` + +- I see that `jsvc` and `libcommons-daemon-java` are both available on Ubuntu so that should be easy to port +- We probably don't need Eclipse Java Bytecode Compiler (ecj) +- I tested Tomcat 7.0.92 on Arch Linux using the `tomcat7.service` with `jsvc` and it works... nice! +- I think I might manage this the same way I do the restic releases in the [Ansible infrastructure scripts](https://github.com/ilri/rmg-ansible-public), where I download a specific version and symlink to some generic location without the version number +- I verified that there is indeed an issue with sharded Solr statistics cores on DSpace, which will cause inaccurate results in the dspace-statistics-api: + +``` +$ http 'http://localhost:3000/solr/statistics/select?indent=on&rows=0&q=type:2+id:11576&fq=isBot:false&fq=statistics_type:view' | grep numFound + +$ http 'http://localhost:3000/solr/statistics-2018/select?indent=on&rows=0&q=type:2+id:11576&fq=isBot:false&fq=statistics_type:view' | grep numFound + +``` + +- I opened an issue on the GitHub issue tracker ([#10](https://github.com/ilri/dspace-statistics-api/issues/10)) +- I don't think the [SolrClient library](https://solrclient.readthedocs.io/en/latest/) we are currently using supports these type of queries so we might have to just do raw queries with requests + diff --git a/docs/2019-01/index.html b/docs/2019-01/index.html index 05efc6c5c..b863d95d2 100644 --- a/docs/2019-01/index.html +++ b/docs/2019-01/index.html @@ -27,7 +27,7 @@ I don’t see anything interesting in the web server logs around that time t " /> - + @@ -60,9 +60,9 @@ I don’t see anything interesting in the web server logs around that time t "@type": "BlogPosting", "headline": "January, 2019", "url": "https://alanorth.github.io/cgspace-notes/2019-01/", - "wordCount": "2840", + "wordCount": "3120", "datePublished": "2019-01-02T09:48:30+02:00", - "dateModified": "2019-01-20T15:48:52+02:00", + "dateModified": "2019-01-20T17:14:43+02:00", "author": { "@type": "Person", "name": "Alan Orth" @@ -852,6 +852,86 @@ sys 0m2.396s
  • That query seems to return items tagged with Livestock and Fish CRP as well… hmm.
  • +

    2019-01-21

    + + + +
    [Unit]
    +Description=Apache Tomcat 7 Web Application Container
    +After=network.target
    +[Service]
    +Type=forking
    +ExecStart=/path/to/apache-tomcat-7.0.92/bin/startup.sh
    +ExecStop=/path/to/apache-tomcat-7.0.92/bin/shutdown.sh
    +User=aorth
    +Group=aorth
    +[Install]
    +WantedBy=multi-user.target
    +
    + + + +
    [Unit]
    +Description=Tomcat 7 servlet container
    +After=network.target
    +
    +[Service]
    +Type=forking
    +PIDFile=/var/run/tomcat7.pid
    +Environment=CATALINA_PID=/var/run/tomcat7.pid
    +Environment=TOMCAT_JAVA_HOME=/usr/lib/jvm/default-runtime
    +Environment=CATALINA_HOME=/usr/share/tomcat7
    +Environment=CATALINA_BASE=/usr/share/tomcat7
    +Environment=CATALINA_OPTS=
    +Environment=ERRFILE=SYSLOG
    +Environment=OUTFILE=SYSLOG
    +
    +ExecStart=/usr/bin/jsvc \
    +            -Dcatalina.home=${CATALINA_HOME} \
    +            -Dcatalina.base=${CATALINA_BASE} \
    +            -Djava.io.tmpdir=/var/tmp/tomcat7/temp \
    +            -cp /usr/share/java/commons-daemon.jar:/usr/share/java/eclipse-ecj.jar:${CATALINA_HOME}/bin/bootstrap.jar:${CATALINA_HOME}/bin/tomcat-juli.jar \
    +            -user tomcat7 \
    +            -java-home ${TOMCAT_JAVA_HOME} \
    +            -pidfile /var/run/tomcat7.pid \
    +            -errfile ${ERRFILE} \
    +            -outfile ${OUTFILE} \
    +            $CATALINA_OPTS \
    +            org.apache.catalina.startup.Bootstrap
    +
    +ExecStop=/usr/bin/jsvc \
    +            -pidfile /var/run/tomcat7.pid \
    +            -stop \
    +            org.apache.catalina.startup.Bootstrap
    +
    +[Install]
    +WantedBy=multi-user.target
    +
    + + + +
    $ http 'http://localhost:3000/solr/statistics/select?indent=on&rows=0&q=type:2+id:11576&fq=isBot:false&fq=statistics_type:view' | grep numFound
    +<result name="response" numFound="33" start="0">
    +$ http 'http://localhost:3000/solr/statistics-2018/select?indent=on&rows=0&q=type:2+id:11576&fq=isBot:false&fq=statistics_type:view' | grep numFound
    +<result name="response" numFound="241" start="0">
    +
    + + + diff --git a/docs/sitemap.xml b/docs/sitemap.xml index b22c941dc..c7444fe1d 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -4,7 +4,7 @@ https://alanorth.github.io/cgspace-notes/2019-01/ - 2019-01-20T15:48:52+02:00 + 2019-01-20T17:14:43+02:00 @@ -204,7 +204,7 @@ https://alanorth.github.io/cgspace-notes/ - 2019-01-20T15:48:52+02:00 + 2019-01-20T17:14:43+02:00 0 @@ -215,7 +215,7 @@ https://alanorth.github.io/cgspace-notes/tags/notes/ - 2019-01-20T15:48:52+02:00 + 2019-01-20T17:14:43+02:00 0 @@ -227,13 +227,13 @@ https://alanorth.github.io/cgspace-notes/posts/ - 2019-01-20T15:48:52+02:00 + 2019-01-20T17:14:43+02:00 0 https://alanorth.github.io/cgspace-notes/tags/ - 2019-01-20T15:48:52+02:00 + 2019-01-20T17:14:43+02:00 0