Flink log files on Emr - apache-flink

I have my Flink jar running in Emr. I have logback.xml set to /mnt/var/flink.log as the path for it when it is running on Emr. I can only see the the logs which are formed by the Emr while running the jar but not mine. Please suggest me a way how to get the logs which i have defined in the programs which is running as Flink jar in Emr. I am unable to find proper solution to it. My logback.xml looks like:
<configuration>
<logger name="org.apache.flink.runtime.jobgraph.JobGraph" level="INFO" additivity="false">
<appender-ref ref="file" />
</logger>
<appender name="file" class="ch.qos.logback.core.FileAppender">
<file>/mnt/var/log/flink.log</file>
<append>false</append>
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{60} %X{sourceThread} - %msg%n</pattern>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="file"/>
</root>
</configuration>

It could be related to FLINK-7990, as per this SO question. But note that you have to put the logback.xml file Flink's conf directory on the system from where you launch Flink. Side note - it's very helpful if you include the version of Flink when asking questions, as it's a fast-moving target.

Related

Ubuntu upgrade (14.04.3) and solr upgrade (5.3) breaks solr3/jetty setup

While upgrading our production server to ubuntu 14 the solr/jetty broke.
To fix i tried:
- upgraded java version to 8.
- upgraded solr to 5.3
My earlier config used .war files. realized that now its stopped supporting .war files, so now cannot use my earlier config.
This was the steps i used earlier:
copy the solr.war file from the downloaded and untarred solr to the webapps folder, and make jetty owner:
sudo cp ~/x/apache-solr-3.6.1/dist/apache-solr-3.6.1.war /usr/share/jetty/webapps/solr.war
sudo chown jetty:jetty /usr/share/jetty/webapps/solr.war
create a context file in JETTY_HOME/contexts (sudo vim /usr/share/jetty/contexts/solr.xml)
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<!-- Set the solr.solr.home system property -->
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
<Call name="setProperty" class="java.lang.System">
<Arg type="String">solr.solr.home</Arg>
<Arg type="String">/usr/share/solr</Arg>
</Call>
</Configure>
tell solr how many cores we have and what those are in SOLR_HOME (sudo vim /usr/share/solr/solr.xml):
<solr persistent="true" sharedLib="lib">
<cores adminPath="/admin/cores">
<core name="demo" instanceDir="demo" />
<core name="dev" instanceDir="dev" />
<core name="qa" instanceDir="qa" />
<core name="www" instanceDir="www" />
</cores>
</solr>
etc.
Don't want to use the solr instance that comes with rsolr (4), if i can help it. But can't find corresponding info for solr 5.3
Running rails 3.2.21. and solr_sunspot gem 2.2.0
Thanks in advance!

java webapp logback teefilter classnotfound exception

I have a webapp in which I am trying to switch from slf4j + jdk14 to slf4j + logback.
I have updated the pom.xml and added logback.xml in src/main/resources.
When I start the webapp from Netbeans I see this error in the tomcat 6 log:
java.lang.ClassNotFoundException: ch.qos.logback.access.servlet.TeeFilter
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:269)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
This is my logback.xml
<configuration>
<appender name="DB" class="ch.qos.logback.classic.db.DBAppender">
<connectionSource class="ch.qos.logback.core.db.DriverManagerConnectionSource">
<driverClass>oracle.jdbc.OracleDriver</driverClass>
<url>jdbc:oracle:thin:#mercurio:1521:ass10</url>
<user>iltest</user>
<password>iltest</password>
</connectionSource>
<sqlDialect>ch.qos.logback.core.db.dialect.OracleDialect</sqlDialect>
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="it.infoline.jobtime.LogbackLayout" />
</encoder>
</appender>
<logger name="OuvertureWeb" level="INFO"/>
<logger name="jdbc" level="OFF" />
<logger name="jdbc.sqlonly" level="OFF" />
<root level="INFO">
<appender-ref ref="DB" />
</root>
</configuration>
Please note that logs are written in the db, so it seems that the whole solution works.
But I have the error above in the tomcat log, and I don't know what it is causing it and, above all, if it could be a clue of something erroneously configured.
Thanks for any help
Bye
Nicola
Seems like you have missed adding logback-access dependency into your pom.xml file.
Add following dependency into your pom.xml file:
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-access</artifactId>
<version>1.0.13</version>
</dependency>

Trying to access JNDI source on Tomcat server

I have a application running on Jboss server. on Jboss it uses JNDI sources for DB connection name cc.xml & iv.xml.(jboss/server/default/deploy/ Both jndi xml are here)
Now i have to deploy the same war on Tomcat and trying to create & access the JNDI sources from tomcat. I made following changes -
Added following code to META-INF/Context.xml
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/R2">
<ResourceLink name="ivrDataSource" global="ivrDataSource" type="javax.sql.DataSource" />
<Resource
name="ivrDataSource"
type="javax.sql.DataSource"
driverClassName="net.sourceforge.jtds.jdbc.Driver"
password=""
maxIdle="2"
maxWait="5000"
username="user"
url="jdbc:jtds:sqlserver://abc:1433;DatabaseName=IVR_GUARDIAN;tds=8.0;lastupdatecount=false;socketKeepAlive=true;"
maxActive="4"/>
<ResourceLink name="ccDataSource" global="ccDataSource" type="javax.sql.DataSource" />
<Resource
name="ccDataSource"
type="javax.sql.DataSource"
driverClassName="net.sourceforge.jtds.jdbc.Driver"
password=""
maxIdle="2"
maxWait="5000"
username="web"
url="jdbc:jtds:sqlserver://xyz:1433;DatabaseName=CC_GUARDIAN;tds=8.0;lastupdatecount=false;socketKeepAlive=true;"
maxActive="4"/>
</Context>
ADDED BELOW TO WEB.XML ----
<!-- FOR TOMCAT DEPLOYMRNT -TESTING -->
<resource-ref>
<description>ccDataSource</description>
<res-ref-name>ccDataSource</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<resource-ref>
<description>ivrDataSource</description>
<res-ref-name>ivrDataSource</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
But i am getting error-
javax.naming.NameNotFoundException: Name ccDataSource,ivrDataSource is not bound in this Context.
Always worked on JBOSS so this is new to me..Missing something here.Please suggest.
You do not have to use <ResourceLink>. Try removing <ResourceLink>s.
<ResourceLink> is used to create a link to a global JNDI resource.
Please see following links for more details.
http://tomcat.apache.org/tomcat-7.0-doc/jndi-resources-howto.html
http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Resource%20Links
Hope this helps.

No declaration for cxfEndpoint in Servicemix deployment

I am trying to get a CXF endpoint working on Servicemix 4. I have created a Spring archetype with a CXF endpoint and successfully installed it with Maven. Having run osgi:install - s mvn: it installs onto Servicemix but the logs are displaying:
Application context refresh failed (OsgiBundleXmlApplicationContext(bundle=springdm,
config=osgibundle:/META-INF/spring/*.xml))
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 21 in XML document
from URL [bundle://218.0:0/META-INF/spring/camel-context.xml] is invalid; nested exception is
org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no
declaration can be found for element 'cxf:cxfEndpoint'
I have built this route just on Camel before with the following in my context.xml file:
<beans ...
xmlns:osgi="http://www.springframework.org/schema/osgi"
xmlns:cxf="http://camel.apache.org/schema/cxf"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd
http://cxf.apache.org/tranposrts/camel http://cxf.apache.org/tranposrts/camel.xsd">
<import resource="classpath:META-INF/cxf/cxf.xml" />
<cxf:cxfEndpoint id="wspoc"
address="http://localhost:8181/ws/ping"
serviceClass="net.ja.smx.springdm.PongImpl" />
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="cxf:bean:wspoc"/>
<to uri="activemq:helloQ" />
</route>
</camelContext>
This is a clone of a working Camel context file but I cannot see why ServiceMix is throwing the error when it starts. The only difference is that the pom file does not use CXF as a dependency but it is in the section which I took from the online example.
I would be grateful for any pointers for any missing imports or corrections to the context file or anything that I ought to check for.
Many thanks.
Shortly after posting, I discovered that I was missing the camel-cxf dependency in my POM file which causes this error. I also needed to make sure that it was the right version as this caused an error in ServiceMix finding the correct META.cxf file.

My Solr Core1 (mutlicore) is not working?

I am trying for multicores somehow i am able to run my core0 but core1 is not finding. 404 err0r is there can any buddy tell me what is the right configuration in solr.xml.
I am preferring sorl wiki core admin help.
Thanks!
As it is described Solr Wiki, solr.xml should look like :
<solr persistent="true" sharedLib="lib">
<cores adminPath="/admin/cores">
<core name="core0" instanceDir="core0" />
<core name="core1" instanceDir="core1" />
</cores>
</solr>
And your solr directory should be like :
-solr
-core0
+conf
+data
-core1
+conf
+data
+lib
solr.xml
Also run create core for adding new cores. The command for creating core is :
http://localhost:8983/solr/admin/cores?action=CREATE&name=coreX&instanceDir=path_to_instance_directory&config=config_file_name.xml&schema=schem_file_name.xml&dataDir=data
You should give more details about your problem, in order to get detailed answer.

Resources