That looks very very wrong! You need to look at the 'keytool' documentation.
Joined: Jul 20, 2012
I have two different application servers and generated key pair in one server and shared public key with client.
Now whenever client will send some encrypted data loadbalancer will try to send request to any one of the server, which means in both server private key should be available so for this purpose, i need to copy key pair from one app server jks file to another app server jks file.
So what's wrong in this?
I was not indicating that your concept is flawed, though I do have reservations, only that the command line you are using is very very wrong and that you need to read the 'keytool' documentation. What is to stop you copying the whole 'cacerts' file from one machine to the other?
P.S. I do hope you are getting a CA to generate signed certificates or you are going to have two unauthenticated to each other and unknown to each other parties communicating very very securely.