docker 微服务 MicroService    2017-07-19 21:30:08    805
本项目是将restful项目打包成可执行的war包,在docker中执行

环境介绍:

    docker    1.10.3
    jetty    8
    jersey    1.19

关键配置:
1、pom.xml配置
<build>
        <finalName>${project.artifactId}</finalName>
        <plugins>
            <plugin>
                <groupId>org.mortbay.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>${jetty.version}</version>
                <configuration>
                    <systemProperties>
                    </systemProperties>
                    <webApp>
                        <contextPath>/</contextPath>
                    </webApp>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.5.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </pl
saiku saiku-query nexus OpenBI    2017-07-19 21:28:25    812
参考关于0.1版本的构建过程:http://blog.liuyingguang.cn/blog/post/lightingfire/build-%E5%B9%B6deploy-saiku-query0.1%E5%88%B0nexus

修改pom文件
其中,红色的为原有被注释的
绿色的为添加的
蓝色地方比较重要,在saiku-query的0.4版本中,居然依赖了0.1的版本,但是源码中却没有相关0.1的分支或者标签,所以此处可以注释,打包也成功了,但是是否存在不稳定或者不全的现象,尚未可知


修改后如下:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.saiku</groupId>
    <artifactId>saiku-query</artifactId>
    <version>0.4-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>query</name>
    <url>http://maven.apache.org</url>

    <!-- <distributionManagement>
        <repository>
            <id>deployment</id>
            <name>Internal Releases</name>
            <url>http://repo.meteorite.bi/content/repositories/alabs-release-local/</url>
        </repository>
        <snapshotRepository>
            <id>deployment<
java eclipse VM arguments    2017-07-19 21:27:01    1634
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
    at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
    at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2209)
    at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:776)
    at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun
2017-07-19 21:25:48    1285
创建swarm cluster的时候报错:

WARNING: IPv4 forwarding is disabled. Networking will not work.
2016/05/20 09:15:35 Post https://discovery.hub.docker.com/v1/clusters: dial tcp: lookup discovery.hub.docker.com on 192.168.10.2:53: read udp 172.17.0.2:56087->192.168.10.2:53: i/o timeout


解决办法:
# vi /etc/sysctl.conf
或者
# vi /usr/lib/sysctl.d/00-system.conf
添加如下代码:
    net.ipv4.ip_forward=1

重启network服务
# systemctl restart network

查看是否修改成功
# sysctl net.ipv4.ip_forward

如果返回为“net.ipv4.ip_forward = 1”则表示成功了
 
 

 

by 刘迎光@萤火虫工作室
OpenBI交流群:495266201
MicroService 微服务交流群:217722918
mail: liuyg#liuyingguang.cn
博主首页(防止爬虫):http://blog.liuyingguang.cn
OpenBI问答社区:http://openbi.liuyingguang.cn/

linux Forwarding    2017-07-19 21:25:06    826
参考文章:http://blog.csdn.net/maeom/article/details/6033927

但是依据此文章中的操作,重启network服务以后,还是没有配置成功,解决办法


# vi /etc/sysctl.conf
或者
# vi /usr/lib/sysctl.d/00-system.conf
添加如下代码:
    net.ipv4.ip_forward=1

重启network服务
# systemctl restart network

查看是否修改成功
# sysctl net.ipv4.ip_forward

如果返回为“net.ipv4.ip_forward = 1”则表示成功了
 

 

by 刘迎光@萤火虫工作室 
OpenBI交流群:495266201 
MicroService 微服务交流群:217722918 
mail: liuyg#liuyingguang.cn 
博主首页(==防止爬虫==):http://blog.liuyingguang.cn

30/48