临近清明节的这几天,请3天假可以连着休息8天,对于上班族来说,这真是一个难得的休假机会。因此这几天休假的同事比较多,因此我也就暂时代理了几天的二级运维的工作。从这几天接收到运维工作来看,基础数据同步的问题占的比例较大。
就拿一个销售组织对应关系的例子来说明下。某经销商下了个采购订单,传送到SAP发现对应的销售组织不对,马上给返了回来,要求重新检查后再传送,经销商于是重新审核后再次传送发现还是不对啊,于是和一线运维纠结了起来,一线运维又将问题反馈给了我,于是我在后台进行了对比,发现我们这边的数据对应关系没有问题。同时我也检查了我们系统基础数据的来源地,上游的基础数据平台系统,那里也是正确的。
于是我只好拿出证据,将我们传送给SAP的数据截图发给SAP方面的运维人员,请他们自己从SAP方面的基础数据查原因。很快就真相大白了,SAP维护的基础信息出现了问题。
问题虽然查出来了,但是我却不得不思考一个问题,关于多个相互关联的系统,基础数据如何进行管理。当然是集中统一管理最好了。保证所有的基础数据都来源统一这是一个比较好的解决方案,虽然可能由于各种原因难以做到这一点,但是我们在设计系统时尽量要向这个方向努力。如果是既有的系统已经有了各自的基础数据管理,最好能够一步步改造,保证最终都共享一个数据来源,这样平时系统交互因为基础数据不一致导致的问题也就迎刃而解了。
第10章 分发器和客户端 Dispatchers and Clients
10.1 问自己的问题
using System;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace ConsoleApplication20
{
class Program
{
static void Main(string[] args)
{
//创建绑定 B
BasicHttpBinding binding = new BasicHttpBinding();
//创建地址 A
Uri address = new Uri("http://www.andersoft.com/anders");
//构建ChannelListener堆栈
IChannelListener<IReplyChannel> listenerStack = binding.BuildChannelListener<IReplyChannel>(new BindingParameterCollection());
//打开侦听器堆栈
listenerStack.Open();
//创建通道堆栈
IReplyChannel receiveChannels = listenerStack.AcceptChannel();
//打开通道堆栈
receiveChannels.Open();
//异步接收消息
receiveChannels.BeginReceiveRequest(new AsyncCallback(ReceiveRequest), receiveChannels);
//构建通道工厂堆栈
IChannelFactory<IRequestChannel> channelFactoryStack = binding.BuildChannelFactory<IRequestChannel>(new BindingParameterCollection());
//打开通道工厂堆栈
channelFactoryStack.Open();
//从通道工厂堆栈创建通道堆栈
IRequestChannel sendChannels = channelFactoryStack.CreateChannel(new EndpointAddress(address));
//打开通道堆栈
sendChannels.Open();
//发送消息给接收者
Message replyMessage = sendChannels.Request(Message.CreateMessage(MessageVersion.Soap11WSAddressingAugust2004, "urn:SomeRequestAcion", "Hi There"));
//显示回复的消息内容
Console.WriteLine("{0}Reply Received:{1}{2}", Environment.NewLine, Environment.NewLine, replyMessage.ToString());
//清理
sendChannels.Close();
channelFactoryStack.Close();
listenerStack.Close();
}
private static void ReceiveRequest(IAsyncResult ar)
{
IReplyChannel channels = ar.AsyncState as IReplyChannel;
//获取requestContext
RequestContext context = channels.EndReceiveRequest(ar);
//显示接收消息
Console.WriteLine("{0}Request Received:{1}{2}", Environment.NewLine, Environment.NewLine, context.RequestMessage.ToString());
//创建应答消息
Message reply = Message.CreateMessage(MessageVersion.Soap11WSAddressingAugust2004, "urn:SomeReplyAction", "Hi there back");
//发送回复
context.Reply(reply);
//关闭上下文
context.Close();
//关闭通道
channels.Close();
}
}
}
1. sudo apt-get install tftpd-hpa
2. vim etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
#TFTP_DIRECTORY="/var/lib/tftpboot"
#TFTP_DIRECTORY="/root/rt5350/RT288x_SDK/source/images"
TFTP_DIRECTORY="/root/rt5350"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="--secure --create --listen --verbose"
3. so, we can using remote tftp client sent command test it like following:
ralink is tftp-hpa client ubuntu is tftp-hpa server
a. put the ralinke file "test.bin" to ubuntu
command: tftp -p -l test.bin -r name.bin 10.10.10.152
b. get the ubuntu file "test.bin" to ralink
command: tftp -g -r test.bin -l name.bin 10.10.10.152