【问题标题】:How do I install the Denodo OData service in the embedded tomcat container in Denodo 5.5?如何在 Denodo 5.5 的嵌入式 tomcat 容器中安装 Denodo OData 服务?
【发布时间】:2016-06-15 16:53:49
【问题描述】:

我想将自定义 OData 服务安装到 Denodo 5.5 中的嵌入式 Tomcat Web 容器中。

我发现 Denodo 提供的说明有些混乱,因此我将其发布到 stackoverflow 并附上答案,希望其他人觉得它有用。

【问题讨论】:

    标签: tomcat odata denodo


    【解决方案1】:

    关闭 Denodo

    $DENODO_HOME/bin/vqlserver_shutdown.sh
    sleep 15
    ps -ef | grep denodo | grep -v grep
    

    获取 Denodo OData Service.zip

    下载Denodo OData Service.zip文件并解压到/tmp,这样你就有了:

    /tmp/denodo-odata2-service-5.5-20160129
    

    “安装”OData 服务

    # copy the war file to the webapps folder
    cp /tmp/denodo-odata2-service-5.5-20160129/denodo-odata2-service-5.5.war $DENODO_HOME/resources/apache-tomcat/webapps/
    
    # Copy the odata xml to the embedded tomcat container
    cp /tmp/denodo-odata2-service-5.5-20160129/scripts/denodo-odata2-service-5.5.xml $DENODO_HOME/resources/apache-tomcat/conf/DenodoPlatform-5.5/localhost/
    
    # Copy the startup/shutdown scripts to the bin folder
    cp /tmp/denodo-odata2-service-5.5-20160129/scripts/*.sh $DENODO_HOME/bin
    chmod u+rwx $DENODO_HOME/bin/odata*.sh
    
    # change the DENODO_HOME directory in the $DENODO_HOME/bin/odata*.sh scripts
    vi $DENODO_HOME/bin/odata_service_startup.sh   # look for DENODO_HOME and update it
    vi $DENODO_HOME/bin/odata_service_shutdown.sh  # look for DENODO_HOME and update it
    

    进行适当的配置更改

    # Add a reference to the Denodo JAR in the catalina.properties file
    vi $DENODO_HOME/resources/apache-tomcat/conf/catalina.properties
    # Look for shared.loader
    # Add this to the end of the shared.loader line:
    ${catalina.base}/../../lib/vdp-jdbcdriver-core/denodo-vdp-jdbcdriver.jar
    
    # update the server.xml.template file to include a JNDI resource by putting the following in the <GlobalNamingResources> section
    vi $DENODO_HOME/resources/apache-tomcat/conf/server.xml.template
    
    <Resource name="jdbc/VDPdatabase"
        auth="Container"
        type="javax.sql.DataSource"
        username="admin" password="***********"
        url="jdbc:vdb://localhost:9999/admin"
        driverClassName="com.denodo.vdp.jdbc.Driver"
        initialSize="5" maxWait="5000"
        maxActive="120" maxIdle="5"
        validationQuery="select * from dual()"
        poolPreparedStatements="true"/>
    
    # Change the permissions on server.xml.template so other people can't read your denodo admin password:
    chmod go-rwx $DENODO_HOME/resources/apache-tomcat/conf/server.xml.template
    chmod go-rwx $DENODO_HOME/resources/apache-tomcat/conf/server.xml
    
    # update the context.xml to point to the JNDI resource in and also add the properties to the <Context> section (add all of the below to the <Context> section)
    vi $DENODO_HOME/resources/apache-tomcat/conf/context.xml
    
    <ResourceLink name="jdbc/VDPdatabase"
        global="jdbc/VDPdatabase"
        type="javax.sql.DataSource"/>
    
    <Environment type="java.lang.String" name="odataserver.address" value="/denodo-odata.svc"/>
    <Environment type="java.lang.Integer" name="server.pageSize" value="1000"/>
    <Environment type="java.lang.Boolean" name="enable.adminUser" value="true"/>
    

    启动它并确保它正常工作

    $DENODO_HOME/bin/vqlserver_startup.sh
    # wait for Denodo and Tomcat to start
    
    # deploy/start the odata webapp
    $DENODO_HOME/bin/odata_service_startup.sh
    
    # Go to 
    http://hostname:9090/denodo-odata2-service-5.5/denodo-odata.svc/databasename
    (but change "databasename" to your virtual database name)
    

    其他注意事项

    由于您现在使用的是嵌入式 Tomcat Web 容器并且 OData 服务正在其中运行,因此每次停止/启动 Denodo 时,您还需要停止/启动 OData 服务

    停止 Denodo

    1. 首先,通过$DENODO_HOME/bin/odata_service_shutdown.sh停止OData服务
    2. 然后通过$DENODO_HOME/bin/vqlserver_shutdown.sh 停止 Denodo

    启动 Denodo

    1. 首先,通过$DENODO_HOME/bin/vqlserver_startup.sh 启动 Denodo
    2. 然后,通过$DENODO_HOME/bin/odata_service_startup.sh启动OData服务

    管理员用户访问权限

    如果您不希望管理员用户通过 odata 访问,请更改 $DENODO_HOME/resources/apache-tomcat/conf/context.xml 文件中的设置并重新启动。

    【讨论】:

      猜你喜欢
      • 2014-12-03
      • 1970-01-01
      • 2020-01-03
      • 2016-01-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多