iBase4J部署总结
阅读原文时间:2020年10月30日阅读:1

序言

  • 最近看到个分布式框架,只有一个字:好。所以部署起来看看。开始的时候说实话遇到了点困难。去码云上看了下,貌似想得到指导要加入一个群,而且需要收费的,反正闲来无事,索性自己搞好了。就当学习了。这里把经验分享一下。希望作者看到不要生气。我只是记录下学习经验。

    启动iBase4J前需要做一些准备工作。如安装zookeeper,启动dubbo,配置nginx等。

    1 、准备工作

    worker_processes 2;

    error_log /usr/local/nginx/logs/error.log;
    #error_log logs/error.log notice;
    #error_log logs/error.log info;

    pid /usr/local/nginx/pid/nginx.pid;

    events {
    worker_connections 1024;
    }

`http {

include mime.types;

default_type application/octet-stream;`

log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                  '$status $body_bytes_sent "$http_referer" '
                  '"$http_user_agent" "$http_x_forwarded_for"';

access_log  /usr/local/nginx/logs/access.log  main;

sendfile        on;
#tcp_nopush     on;

#keepalive_timeout  0;
keepalive_timeout  65;

#gzip  on;

upstream proxy {
    server 192.168.132.157:8088 weight=1;
    server 192.168.132.158:8088 weight=1;
}

server {
    listen       80;
    server_name  192.168.132.157;

    charset utf8;

    #access_log  logs/host.access.log  main;

    location / {
        proxy_pass http://proxy;
        proxy_set_header Host      $host;

        proxy_set_header X-Real-IP $remote_addr;

        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       # root   html;
       # index  index.html index.htm;
    }

    #error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html;
    }

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ \.php$ {
    #    proxy_pass   http://127.0.0.1;
    #}

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    #location ~ \.php$ {
    #    root           html;
    #    fastcgi_pass   127.0.0.1:9000;
    #    fastcgi_index  index.php;
    #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
    #    include        fastcgi_params;
    #}

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #    deny  all;
    #}
}

# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
#    listen       8000;
#    listen       somename:8080;
#    server_name  somename  alias  another.alias;

#    location / {
#        root   html;
#        index  index.html index.htm;
#    }
#}

# HTTPS server
#
#server {
#    listen       443 ssl;
#    server_name  localhost;

#    ssl_certificate      cert.pem;
#    ssl_certificate_key  cert.key;

#    ssl_session_cache    shared:SSL:1m;
#    ssl_session_timeout  5m;

#    ssl_ciphers  HIGH:!aNULL:!MD5;
#    ssl_prefer_server_ciphers  on;

#    location / {
#        root   html;
#        index  index.html index.htm;
#    }
#}

}

以上为自己的简单配置,很多都没有配置,如动静分离,数据压缩等。

  • 启动nginx,/usr/local/nginx/sbin/nginx –c /usr/local/nginx/conf/nginx.conf

2 、配置iBase4J

  1. 从码云上下载下来项目,导入到eclipse里面。配置iBase4J-Common下资源包里面的system.properties文件。直接上图吧:
  2. 启动的条件是JDK必须是1.8,tomcat7。其他的我试了,不行。
  3. 配置完成之后,直接用普通的启动方式就可以。
  4. nginx配置
  5. 配置没有问题,直接启动就可以。启动起来,直接访问localhost应该可以的。

3、总结

  • 重要的还是准备工作,项目并不难。这个项目很有学习价值。之前自己也高了个分布式框架,只用到了zookeeper,dubbo,本来也打算放到晒晒,但是看到这个框架之后就彻底放弃了,上传到自己git上就行了,不晒了,有点丢人。。。。试试部署吧,不知道行不行,反正我是行,哈哈。。。开个玩笑。。。。。