can be automatically elected between servers.In the table above, we need to specify server 1 as bootstrap server, you can run the following command, and the following is the startup process. You can see that the bootstrap mode configures itself as leader.[Email protected] ~]$ Consul agent-server-bootstrap-data-dir/tmp/Consul==> warning:bootstrap Mode enabled!Do not enable unless necessary==> Warning:it is highly recommended to set gomaxprocs higher than1==>starting Consul agent ...==>starting C
service registry as previously implemented Eureka, which can be used directly by downloading the consul service-side program.We can start the Consul development mode with the following command:
12345678910111213141516171819202122232425262728293031323334
$consul Agent-dev==> starting Consul agent...==> starting Consul agent rpc...==> Consul agent running! Version:' v0.7.2 'Node Name:' LENOVO-ZHAIYC 'Datacenter:' DC1 'Server:true (bootstrap: false) Client addr:127.0.0.1 (http:850
. commentcontent=Getcontent (item, bbscomment. value. tolist ();} viewbag. bbscomment=Bbscomment. value; viewbag. bbscommentcount= Bbscomment. value. Count ();
Getcontent is very important. It is queried cyclically to display all the contents of the building.
The related code is as follows:
# Region Response // HTML output is obtained based on the current comment. Protected String Getcontent ( Object Objcomment, list List ){ String Output = "" ; Netfavcommentmodel
(in the previous article we introduced the " session EJB Series (iii) Sessionbean life cycle ", this is the main introduction of Sessionbean transaction Management)Sessionbean can be functionally divided into two categories:First class: Become EAO: Used to encapsulate the underlying entities and JPA, which essentially functions as DAO. (transaction control is not required.) Because the JPA nature is the encapsulation of ORM implementations. )Second class: Acting as a business component : The fac
agent must be running on each node in the cluster.Consul.exe Agent-config-file Test_config.jsonLet's run an agent in server mode first:d:\github\consuldotnet\consul.test> Consul.exe Agent-config-file Test_config.json==> warning:bootstrap Mode enabled! Do not enable unless necessary==> Warning:windows is not recommended as a Consul server. Do not use the in production.==> Warning:it is highly recommended to set gomaxprocs higher than 1==> starting Consul Agent ...==> starting Consul Agent RPC ..
service registry as previously implemented Eureka, which can be used directly by downloading the consul service-side program.We can start the Consul development mode with the following command:
12345678910111213141516171819202122232425262728293031323334
$consul Agent-dev==> starting Consul agent...==> starting Consul agent rpc...==> Consul agent running! Version:' v0.7.2 'Node Name:' LENOVO-ZHAIYC 'Datacenter:' DC1 'Server:true (bootstrap: false) Client addr:127.0.0.1 (http:850
. The agent must be running on every node in the cluster.Consul.exe Agent-config-file Test_config.jsonWe first run an agent in server mode:d:\github\consuldotnet\consul.test> Consul.exe Agent-config-file Test_config.json==> warning:bootstrap Mode enabled! Do not enable unless necessary==> Warning:windows is not recommended as a consul server. Don't use in production.==> Warning:it is highly recommended to set gomaxprocs higher than 1==> Starting Consul Agent ...==> starting Consul Agent RPC ...=
Encrypt:false, Rpc-tls:false, Tls-incoming:falseAtlas: ==> Log data would now stream in as it occurs:2015/08/09 09:14:48 [INFO] SERF:EVENTMEMBERJOIN:GEFFZHANG-NB 192.168.1.42015/08/09 09:14:48 [INFO] SERF:EVENTMEMBERJOIN:GEFFZHANG-NB.DC1 192.168.1.42015/08/09 09:14:48 [INFO] raft:node at 192.168.1.4:8300 [Follower] entering Follower state2015/08/09 09:14:48 [INFO] consul:adding server GEFFZHANG-NB (addr:192.168.1.4:
service registry as previously implemented Eureka, which can be used directly by downloading the consul service-side program.We can start the Consul development mode with the following command:
12345678910111213141516171819202122232425262728293031323334
$consul Agent-dev==> starting Consul agent...==> starting Consul agent rpc...==> Consul agent running! Version:' v0.7.2 'Node Name:' LENOVO-ZHAIYC 'Datacenter:' DC1 'Server:true (bootstrap: false) Client addr:127.0.0.1 (http:850
10.40.100.145 onDocker run-d--name consul0--restart=always-v/mnt:/data \- P 8300:8300 \- P 8301:8301 \- P 8301:8301/udp \- P 8302:8302 \- P 8302:8302/udp \- P 8400:8400 \- P 8500:8500 \docker-registry.venic.com:5000/consul:latest-server-advertise 10.40.100.145-bootstrap-expect 310.40.100.146 onDocker run-d--name consul1--restart=always-v/mnt:/data \- P 8300:
into the JVM. You need to specify an agent for the JVM, provided as a startup parameter. For example, when you want to use this feature of Eclipselink, you can pass in:-javaagent:path_to/eclipselink.jarTransaction processing (Transaction handling)JPA can be used in Java SE and Java EE applications. The difference is in how transactions are handled. In Java EE, JPA transactions are only part of the Java Transaction API (JTA) Implementation of the application server. It provides two ways to handl
judgement code should read as follows:
Show comments, article relative time
According to the above version, the following this should be an enhanced version of it, because to achieve the effect or need to add code in the subject, so not to the ultimate version, haha.The function code is as follows:
Relative Time function
if (! function_exists (' Xz_time ')):/** * Displays the package function for the article and comment relative time.
* Author: Xiangzi http://PangBu.com/*
( String regx,string text) { Matcher matcher=pattern.compile (REGX). Matcher (text); if (Matcher.find ()) return Matcher.group (); else return null; }2, another plug-in is called: Windows Live Writer Source Code plugin for Syntaxhighlighter, the file is called Sourcecodeplugin_version_1.1.zip, It seems that the official blog Park recommended this plugin, but the individual is not very fond of, the most important is not timely display effect . (Al
'): function xz_time_diff ($ from, $ to = '') {if (empty ($ to) $ to = time (); $ diff = (int) abs ($ to-$ from); if ($ diff
The time judgment code is changed to the following:
Show relative time of comments and articles
Based on the above version and the following version, it should be regarded as an enhanced community version. to achieve the effect, you still need to add code in the topic, so it hasn't arrived at the community version yet, haha.The function code is as follows:
Relative t
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.