iBase4J部署总结

2018/06/14 14:40
阅读数 130

<div class="markdown_views"> <h2 id="ibase4j部署总结"><a name="t0"></a>iBase4J部署总结</h2>

<hr>

<h3 id="序言"><a name="t1"></a>序言</h3>

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

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

<h3 id="1-准备工作"><a name="t2"></a>1 、准备工作</h3>

<ol><li>安装虚拟机(有点穷,用不起阿里云) <br> 虚拟机我这里用的vmware workstation9,安装挺简单的,我这里就不赘述了。网上一搜一大片。 <br> <a href="http://www.linuxidc.com/Linux/2012-11/73743.htm" rel="nofollow" target="_blank">下载地址</a>:<a href="http://www.linuxidc.com/Linux/2012-11/73743.htm" rel="nofollow" target="_blank">http://www.linuxidc.com/Linux/2012-11/73743.htm</a></li> <li><p>linux安装 centos 7。</p>

<ul><li><p>下载centos7镜像 : <br> <a href="http://www.centoscn.com/CentosSoft/iso/2015/0402/5070.html" rel="nofollow" target="_blank">下载地址</a> <br> :<a href="http://www.centoscn.com/CentosSoft/iso/2015/0402/5070.html" rel="nofollow" target="_blank">http://www.centoscn.com/CentosSoft/iso/2015/0402/5070.html</a></p></li> <li><p>查看网络地址: centos7取消了ifconfig命令,使用ip addr命令查看IP地址,但是貌似ip addr和ifconfig都能用。前提是需要安装ifconfig。 <br> 如果遇到ifconfig command not found,解决方法:yum install net-tools.x86_64(安装ifconfig)</p></li> <li><p>配置网络</p></li> <li><p>找到以太网卡配置文件/etc/sysconfig/network-scripts/ifcfg-enp**文件,后面的数字好像是随机生成的。 <br> <img src="https://img-blog.csdn.net/20170608222704838?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaGFwcHlfUGlub2NjaGlv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述" title=""></p></li> <li><p>使用Root打开并编辑些文件,将onboot的”no”改为“yes”,然后重启网络。 <br> <img src="https://img-blog.csdn.net/20170608222810003?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaGFwcHlfUGlub2NjaGlv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述" title=""> <br> 最后输入:wq 保存并退出,再重启一下network:</p></li> <li><p>重启网络命令:# service network restart 这样再启动系统时,网络也会自动启动。</p></li></ul></li> <li><p>JDK安装配置</p>

<ul><li>vi /etc/profile <br> export JAVA_HOME=/usr/local/jdk1.7.0 <br> export CLASSPATH=.:<span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-1-Frame" tabindex="0" data-mathml="<math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;><mi>J</mi><mi>A</mi><mi>V</mi><msub><mi>A</mi><mi>H</mi></msub><mi>O</mi><mi>M</mi><mi>E</mi><mrow class=&quot;MJX-TeXAtom-ORD&quot;><mo>/</mo></mrow><mi>l</mi><mi>i</mi><mi>b</mi><mrow class=&quot;MJX-TeXAtom-ORD&quot;><mo>/</mo></mrow><mi>t</mi><mi>o</mi><mi>o</mi><mi>l</mi><mi>s</mi><mo>.</mo><mi>j</mi><mi>a</mi><mi>r</mi><mo>:</mo></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-1" style="width: 15.241em; display: inline-block;"><span style="display: inline-block; position: relative; height: 0px; font-size: 120%; width: 12.682em;"><span style="position: absolute; clip: rect(1.253em, 1012.62em, 2.622em, -999.997em); top: -2.199em; left: 0em;"><span class="mrow" id="MathJax-Span-2"><span class="mi" id="MathJax-Span-3" style="font-family: MathJax_Math-italic;">J<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.063em;"></span></span><span class="mi" id="MathJax-Span-4" style="font-family: MathJax_Math-italic;">A</span><span class="mi" id="MathJax-Span-5" style="font-family: MathJax_Math-italic;">V<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.182em;"></span></span><span class="msubsup" id="MathJax-Span-6"><span style="display: inline-block; position: relative; height: 0px; width: 1.432em;"><span style="position: absolute; clip: rect(3.098em, 1000.72em, 4.17em, -999.997em); top: -3.985em; left: 0em;"><span class="mi" id="MathJax-Span-7" style="font-family: MathJax_Math-italic;">A</span><span style="display: inline-block; width: 0px; height: 3.991em;"></span></span><span style="position: absolute; top: -3.807em; left: 0.777em;"><span class="mi" id="MathJax-Span-8" style="font-size: 70.7%; font-family: MathJax_Math-italic;">H<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.063em;"></span></span><span style="display: inline-block; width: 0px; height: 3.991em;"></span></span></span></span><span class="mi" id="MathJax-Span-9" style="font-family: MathJax_Math-italic;">O</span><span class="mi" id="MathJax-Span-10" style="font-family: MathJax_Math-italic;">M<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.063em;"></span></span><span class="mi" id="MathJax-Span-11" style="font-family: MathJax_Math-italic;">E<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span class="texatom" id="MathJax-Span-12"><span class="mrow" id="MathJax-Span-13"><span class="mo" id="MathJax-Span-14" style="font-family: MathJax_Main;">/</span></span></span><span class="mi" id="MathJax-Span-15" style="font-family: MathJax_Math-italic;">l</span><span class="mi" id="MathJax-Span-16" style="font-family: MathJax_Math-italic;">i</span><span class="mi" id="MathJax-Span-17" style="font-family: MathJax_Math-italic;">b</span><span class="texatom" id="MathJax-Span-18"><span class="mrow" id="MathJax-Span-19"><span class="mo" id="MathJax-Span-20" style="font-family: MathJax_Main;">/</span></span></span><span class="mi" id="MathJax-Span-21" style="font-family: MathJax_Math-italic;">t</span><span class="mi" id="MathJax-Span-22" style="font-family: MathJax_Math-italic;">o</span><span class="mi" id="MathJax-Span-23" style="font-family: MathJax_Math-italic;">o</span><span class="mi" id="MathJax-Span-24" style="font-family: MathJax_Math-italic;">l</span><span class="mi" id="MathJax-Span-25" style="font-family: MathJax_Math-italic;">s</span><span class="mo" id="MathJax-Span-26" style="font-family: MathJax_Main;">.</span><span class="mi" id="MathJax-Span-27" style="font-family: MathJax_Math-italic; padding-left: 0.182em;">j</span><span class="mi" id="MathJax-Span-28" style="font-family: MathJax_Math-italic;">a</span><span class="mi" id="MathJax-Span-29" style="font-family: MathJax_Math-italic;">r</span><span class="mo" id="MathJax-Span-30" style="font-family: MathJax_Main; padding-left: 0.301em;">:</span></span><span style="display: inline-block; width: 0px; height: 2.205em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.354em; border-left: 0px solid; width: 0px; height: 1.361em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>J</mi><mi>A</mi><mi>V</mi><msub><mi>A</mi><mi>H</mi></msub><mi>O</mi><mi>M</mi><mi>E</mi><mrow class="MJX-TeXAtom-ORD"><mo>/</mo></mrow><mi>l</mi><mi>i</mi><mi>b</mi><mrow class="MJX-TeXAtom-ORD"><mo>/</mo></mrow><mi>t</mi><mi>o</mi><mi>o</mi><mi>l</mi><mi>s</mi><mo>.</mo><mi>j</mi><mi>a</mi><mi>r</mi><mo>:</mo></math></span></span><script type="math/tex" id="MathJax-Element-1">JAVA_HOME/lib/tools.jar:</script>JAVA_HOME/lib/dt.jar <br> export PATH=<span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-2-Frame" tabindex="0" data-mathml="<math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;><mi>J</mi><mi>A</mi><mi>V</mi><msub><mi>A</mi><mi>H</mi></msub><mi>O</mi><mi>M</mi><mi>E</mi><mrow class=&quot;MJX-TeXAtom-ORD&quot;><mo>/</mo></mrow><mi>b</mi><mi>i</mi><mi>n</mi><mo>:</mo></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-31" style="width: 10.241em; display: inline-block;"><span style="display: inline-block; position: relative; height: 0px; font-size: 120%; width: 8.515em;"><span style="position: absolute; clip: rect(1.253em, 1008.46em, 2.622em, -999.997em); top: -2.199em; left: 0em;"><span class="mrow" id="MathJax-Span-32"><span class="mi" id="MathJax-Span-33" style="font-family: MathJax_Math-italic;">J<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.063em;"></span></span><span class="mi" id="MathJax-Span-34" style="font-family: MathJax_Math-italic;">A</span><span class="mi" id="MathJax-Span-35" style="font-family: MathJax_Math-italic;">V<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.182em;"></span></span><span class="msubsup" id="MathJax-Span-36"><span style="display: inline-block; position: relative; height: 0px; width: 1.432em;"><span style="position: absolute; clip: rect(3.098em, 1000.72em, 4.17em, -999.997em); top: -3.985em; left: 0em;"><span class="mi" id="MathJax-Span-37" style="font-family: MathJax_Math-italic;">A</span><span style="display: inline-block; width: 0px; height: 3.991em;"></span></span><span style="position: absolute; top: -3.807em; left: 0.777em;"><span class="mi" id="MathJax-Span-38" style="font-size: 70.7%; font-family: MathJax_Math-italic;">H<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.063em;"></span></span><span style="display: inline-block; width: 0px; height: 3.991em;"></span></span></span></span><span class="mi" id="MathJax-Span-39" style="font-family: MathJax_Math-italic;">O</span><span class="mi" id="MathJax-Span-40" style="font-family: MathJax_Math-italic;">M<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.063em;"></span></span><span class="mi" id="MathJax-Span-41" style="font-family: MathJax_Math-italic;">E<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span class="texatom" id="MathJax-Span-42"><span class="mrow" id="MathJax-Span-43"><span class="mo" id="MathJax-Span-44" style="font-family: MathJax_Main;">/</span></span></span><span class="mi" id="MathJax-Span-45" style="font-family: MathJax_Math-italic;">b</span><span class="mi" id="MathJax-Span-46" style="font-family: MathJax_Math-italic;">i</span><span class="mi" id="MathJax-Span-47" style="font-family: MathJax_Math-italic;">n</span><span class="mo" id="MathJax-Span-48" style="font-family: MathJax_Main; padding-left: 0.301em;">:</span></span><span style="display: inline-block; width: 0px; height: 2.205em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.354em; border-left: 0px solid; width: 0px; height: 1.361em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>J</mi><mi>A</mi><mi>V</mi><msub><mi>A</mi><mi>H</mi></msub><mi>O</mi><mi>M</mi><mi>E</mi><mrow class="MJX-TeXAtom-ORD"><mo>/</mo></mrow><mi>b</mi><mi>i</mi><mi>n</mi><mo>:</mo></math></span></span><script type="math/tex" id="MathJax-Element-2">JAVA_HOME/bin:</script>PATH <br> 使环境变量生效 <br> source /etc/profile</li></ul></li> <li><p>安装zookeeper</p>

<ul><li><p>下载zookeeper-3.4.6.tar.gz, <br> <a href="http://pan.baidu.com/s/1jIi9nUY" rel="nofollow" target="_blank">下载地址</a>:<a href="http://pan.baidu.com/s/1jIi9nUY" rel="nofollow" target="_blank">http://pan.baidu.com/s/1jIi9nUY</a></p></li> <li><p>解压到/home/zookeeper/,解压命令:tar –zxvf zookeeper-3.4.6.tar.gz ,重命名为zookeeper,重命名命令 :mv zookeeper-3.4.6.tar.gz zookeeper</p></li> <li><p>进入/home/zookeeper/zookeeper/conf下,复制zoo_sample.cfg, 命令为cp zoo_sample.cfg zoo.cfg,然后编辑zoo.cfg, 命令为:vi zoo.cfg。<img src="https://img-blog.csdn.net/20170608223511318?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaGFwcHlfUGlub2NjaGlv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述" title=""></p>

<p>然后保存退出。 <br> •tickTime:这个时间是作为Zookeeper 服务器之间或客户端与服务器之间维持心跳的时间间隔,也就是每个 tickTime 时间就会发送一个心跳。 <br> •dataDir:顾名思义就是 Zookeeper保存数据的目录,默认情况下,Zookeeper 将写数据的日志文件也保存在这个目录里。 <br> •dataLogDir:顾名思义就是Zookeeper 保存日志文件的目录 <br> •clientPort:这个端口就是客户端连接Zookeeper 服务器的端口,Zookeeper 会监听这个端口,接受客户端的访问请求</p>

<p>从配置可以看出,需要到zookeeper根目录下创建两个文件夹data,logs。命令:mkdir data/mkdir logs。创建好之后进入data目录。创建myid文件,命令:vi myid,编辑内容:1。如图:<img src="https://img-blog.csdn.net/20170608223700179?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaGFwcHlfUGlub2NjaGlv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述" title=""> <br> 这里的1对应zoo.cfg配置里的server.1=ip:2888:3888</p></li> <li><p>配置环境变量 <br> 进入到/etc目录下,编辑profile文件(配置环境变量)。命令:vi profile,如图:<img src="https://img-blog.csdn.net/20170608223827008?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaGFwcHlfUGlub2NjaGlv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述" title=""></p></li> <li><p>然后编辑/etc/hosts进行路径映射。vi hosts,本机编辑好如图。 <br> <img src="https://img-blog.csdn.net/20170608224005950?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaGFwcHlfUGlub2NjaGlv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述" title=""></p></li> <li>接下来启动zookeeper。进入到/home/zookeeper/zookeeper/bin ,启动./zkServer.sh start</li> <li>启动客户端:./zkCli.sh,出现如下界面 <br> <img src="https://img-blog.csdn.net/20170608224114436?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaGFwcHlfUGlub2NjaGlv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述" title=""> <br> 启动成功。</li></ul></li> <li><p>Dubbo启动</p>

<ul><li>下载dubbo-admin-2.5.3的war包 <br> 下载地址:<a href="http://pan.baidu.com/s/1bpzIyvH" rel="nofollow" target="_blank">http://pan.baidu.com/s/1bpzIyvH</a> <br> 将下载下来的文件解压,找到war包直接放入到tomcat 6下webapps目录,删除ROOT下的所以文件。像部署正常项目一样启动,不再赘述。启动好之后,访问<a href="http://192.168.91.133:8080/" rel="nofollow" target="_blank">http://192.168.91.133:8080/</a>。出现如下界面:<img src="https://img-blog.csdn.net/20170608224312306?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaGFwcHlfUGlub2NjaGlv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述" title=""> <br> 。输入账号root,密码root进入显示如下界面: <br> <img src="https://img-blog.csdn.net/20170608224351182?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaGFwcHlfUGlub2NjaGlv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述" title=""></li></ul></li> <li><p>安装redis</p>

<ul><li>下载:<a href="http://download.redis.io/releases/redis-3.0.1.tar.gz" rel="nofollow" target="_blank">http://download.redis.io/releases/redis-3.0.1.tar.gz</a> <br> 放到/home/redis目录下解压:tar -zxvf redis-3.0.1.tar.gz,重命名:mv redis-3.0.1 redis。进入到:/home/redis/redis/src <br> Make <br> Make install <br> 新建bin和conf目录。 <br> mkdir –p /home/redis/redis/bin <br> mkdir –p /home/redis/redis/conf <br> 移动/home/redis/redis/redis.conf到/home/redis/redis/conf下。移动/home/redis/redis/src下7个绿色文件到/home/redis/redis/bin下。 <br> 进入到conf下,编辑redis.conf <br> 使用linux快捷键查找”:/”,文档内查找快捷键。 <br> daemonize no改为yes:以守护进程方式运行,即后台运行,redis默认启动方式是占用操作界面的。 <br> dir ./改为 /home/redis/redis/data <br> 端口,log,data,pid都需要修改路径。 <br> appendonly no改为yes:指定每次更新之后进行日志记录 <br> bing ip:这里的ip是要连接的客户端机器ip.如果ip为:00.00.00.00则不限制连接客户端ip <br> 备机设置:1、修改备机redis.conf,找到# slaveof改为 slaveof 192.168.132.157 6379(主机地址,备机启动,自动设置为备机) <br> 2、登陆备机客户端(登陆某台redis客户端:redis-cli –h 192.168.132.157 –p 6380 <br> ),slaveof 192.168.132.157 6379(主机地址,备机启动,不会自动设置为备机) <br> 将redis添加到开机自启动: <br> echo “/home/redis/redis/bin/redis-server /home/redis/redis/conf/redis.conf”&gt;&gt;/etc/rc.d/rc.local <br> 启动redis:进入到bin目录,./redis-server /…./conf/redis.conf <br> redis连接客户端:redisDesktopManager: 链接:<a href="http://pan.baidu.com/s/1geM41KR" rel="nofollow" target="_blank">http://pan.baidu.com/s/1geM41KR</a> 密码:73gr</li></ul></li> <li><p>nginx安装(nginx说实话在linux下映射项目没有成功,所以后来我直接配置到window下的。这里就当做个笔记,学习一下。只惧参考价值,因为都差不多)</p>

<ul><li><p>安装nginx之前,需要安装几个必备软件。 <br> 1、GCC编译器:可用来编译C语言程序。yum install –y gcc <br> 2、GCC是必需的编译工具,还需要C++编译器。yum install –y gcc-c++ <br> 3、PCRE库函数库,支持正则表达式。yum install –y pcre pcre-devel <br> 4、Zlib库,zlib库用于对HTTP包的内容做gzip格式压缩。yum install –y zlib zlib-devel <br> 5、OpenSSL开发库。yum install –y openssl openssl-devel</p></li> <li><p>下载nginx源码包:<a href="http://nginx.org/en/download.html" rel="nofollow" target="_blank">http://nginx.org/en/download.html</a> <br> 2、放到/home/nginx下,解压tar –zxvf nginx-1.10.3.tar.gz,重命名mv nginx-1.10.3 nginx,进入nginx,./configure&amp;&amp;make&amp;&amp;make install <br> 3、编辑/usr/local/nginx/conf/nginx.conf</p></li></ul></li></ol></li> </ul>

<pre class="prettyprint" name="code"><code class="language-#user nobody; hljs lasso has-numbering">worker_processes <span class="hljs-number">2</span>; error_log /usr/<span class="hljs-built_in">local</span>/nginx/logs/error<span class="hljs-built_in">.</span><span class="hljs-keyword">log</span>;</br> <span class="hljs-variable">#error_log</span> logs/error<span class="hljs-built_in">.</span><span class="hljs-keyword">log</span> notice;</br> <span class="hljs-variable">#error_log</span> logs/error<span class="hljs-built_in">.</span><span class="hljs-keyword">log</span> info;</br></br> pid /usr/<span class="hljs-built_in">local</span>/nginx/pid/nginx<span class="hljs-built_in">.</span>pid;</br></br> events {</br> worker_connections <span class="hljs-number">1024</span>;</br> }</br> </code></pre>

<p><code>http { <br> include mime.types; <br> default_type application/octet-stream;</code></p>

<pre class="prettyprint"><code class="has-numbering">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;</br> #tcp_nopush on;</br></br> #keepalive_timeout 0;</br> keepalive_timeout 65;</br></br> #gzip on;</br></br> upstream proxy {</br> server 192.168.132.157:8088 weight=1;</br> server 192.168.132.158:8088 weight=1;</br> }</br></br> server {</br> listen 80;</br> server_name 192.168.132.157;</br></br> charset utf8;</br></br> #access_log logs/host.access.log main;</br></br> location / {</br> proxy_pass http://proxy;</br> proxy_set_header Host $host;</br></br> proxy_set_header X-Real-IP $remote_addr;</br></br> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;</br> # root html;</br> # index index.html index.htm;</br> }</br></br> #error_page 404 /404.html;</br></br> # redirect server error pages to the static page /50x.html</br> #</br> error_page 500 502 503 504 /50x.html;</br> location = /50x.html {</br> root html;</br> }</br></br> # proxy the PHP scripts to Apache listening on 127.0.0.1:80</br> #</br> #location ~ \.php$ {</br> # proxy_pass http://127.0.0.1;</br> #}</br></br> # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000</br> #</br> #location ~ \.php$ {</br> # root html;</br> # fastcgi_pass 127.0.0.1:9000;</br> # fastcgi_index index.php;</br> # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;</br> # include fastcgi_params;</br> #}</br></br> # deny access to .htaccess files, if Apache's document root</br> # concurs with nginx's one</br> #</br> #location ~ /\.ht {</br> # deny all;</br> #}</br> }</br></br> # another virtual host using mix of IP-, name-, and port-based configuration</br> #</br> #server {</br> # listen 8000;</br> # listen somename:8080;</br> # server_name somename alias another.alias;</br></br> # location / {</br> # root html;</br> # index index.html index.htm;</br> # }</br> #}</br></br> # HTTPS server</br> #</br> #server {</br> # listen 443 ssl;</br> # server_name localhost;</br></br> # ssl_certificate cert.pem;</br> # ssl_certificate_key cert.key;</br></br> # ssl_session_cache shared:SSL:1m;</br> # ssl_session_timeout 5m;</br></br> # ssl_ciphers HIGH:!aNULL:!MD5;</br> # ssl_prefer_server_ciphers on;</br></br> # location / {</br> # root html;</br> # index index.html index.htm;</br> # }</br> #}</br> </code></pre>

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

<ul> <li>启动nginx,/usr/local/nginx/sbin/nginx –c /usr/local/nginx/conf/nginx.conf</li> </ul>

<h3 id="2-配置ibase4j"><a name="t3"></a>2 、配置iBase4J</h3>

<ol> <li>从码云上下载下来项目,导入到eclipse里面。配置iBase4J-Common下资源包里面的system.properties文件。直接上图吧:<img src="https://img-blog.csdn.net/20170608225922723?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaGFwcHlfUGlub2NjaGlv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述" title=""></li> <li>启动的条件是JDK必须是1.8,tomcat7。其他的我试了,不行。</li> <li>配置完成之后,直接用普通的启动方式就可以。<img src="https://img-blog.csdn.net/20170608230247981?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaGFwcHlfUGlub2NjaGlv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述" title=""></li> <li><img src="https://img-blog.csdn.net/20170608230352177?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaGFwcHlfUGlub2NjaGlv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述" title=""></li> <li>nginx配置<img src="https://img-blog.csdn.net/20170608230528366?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaGFwcHlfUGlub2NjaGlv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述" title=""></li> <li>配置没有问题,直接启动就可以。启动起来,直接访问localhost应该可以的。</li> </ol>

<h3 id="3总结"><a name="t4"></a>3、总结</h3>

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

展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部