📄 ex.so
字号:
m4_comment([$Id: ex.so,v 1.8 2006/10/05 01:06:08 bostic Exp $])include(m4/m4.utility)m4_ref_title(m4_db Replication, Ex_rep: a replication example,, rep/faq, rep/ex_comm)m4_p([dnlEx_rep, found in the m4_path(examples_c/ex_rep) subdirectoryof the m4_db distribution, is a simple but complete demonstration of areplicated application. The application is a mock stock ticker. Themaster accepts a stock symbol and an numerical value as input, andstores this information into a replicated database; either master orclients can display the contents of the database, given an empty inputline.])m4_p([dnlThere are two versions of the application: ex_rep_mgr uses ReplicationManager, while ex_rep_base uses the Base replication API. This isintended to demonstrate that, while the basic function of theapplication is the same in either case, the replication supportinfrastructure differs markedly.])m4_p([dnlThe communication infrastructure demonstrated with ex_rep_base has thesame dependencies on system networking and threading support as doesthe Replication Manager (see the m4_link(M4RELDIR/ref/rep/intro,Introduction)). The Makefile created by the standard UNIXconfiguration will build the ex_rep examples on most platforms. Enter"make ex_rep_mgr" and/or "make ex_rep_base" to attempt to buildthem.])m4_p([The synopsis for both programs is as follows:])m4_literal([dnlex_rep_xxx m4_utilarg(MC) m4_utilarg([h home]) m4_utilarg([m host:port]) m4_utilarg([o host:port]) m4_utilarg([n sites]) m4_utilarg([p priority])])m4_p([where "ex_rep_xxx" is either "ex_rep_mgr" or "ex_rep_base".])m4_p([The options, to either version of the program, are as follows:])m4_tagbeginm4_tagopt(M, [dnlConfigure this process as a master.])m4_tagopt(C, [dnlConfigure this process as a client.])m4_hflagm4_tagopt(m, [dnlListen on port "port" of host "host" for incoming connections.])m4_tagopt(o, [dnlAttempt to connect to another member of the replication group which islistening on host "host" at port "port". Members of a replication groupshould be able to find all other members of a replication group so longas they are in contact with at least one other member of the replicationgroup.])m4_tagopt(n, [dnlSpecify the total number of sites in the replication group.])m4_tagopt(p, [dnlSet the election priority. See m4_ref(rep_elect) for moreinformation.])m4_tagendm4_p([dnlA typical ex_rep session begins with a command such as thefollowing, to start a master:])m4_indent([dnlex_rep_mgr -M -p 100 -n 4 -h DIR1 -m localhost:6000])m4_p([dnland several clients:])m4_indent([dnlex_rep_mgr -C -p 50 -n 4 -h DIR2 -m localhost:6001 -o localhost:6000ex_rep_mgr -C -p 10 -n 4 -h DIR3 -m localhost:6002 -o localhost:6000ex_rep_mgr -C -p 0 -n 4 -h DIR4 -m localhost:6003 -o localhost:6000])m4_p([dnlIn this example, the client with home directory DIR4 can never becomea master (its priority is 0). Both of the other clients can becomemasters, but the one with home directory DIR2 is preferred. Prioritiesare assigned by the application and should reflect the desirability ofhaving particular clients take over as master in the case that themaster fails.])m4_page_footer
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -