how to deploy a heavy size files using chef - knife

I have a file which is of 900 MB approx.
I want to deploy the file to the target machine. I used the files resource in chef (cookbook_file). But i am unable to upload the cookbook in to the server because of the size.
Is there any way to deploy the file on the target machine rather than downloading it from internet (using remote_file)?

I'm sorry, Chef server is no artifact server. It is a bad idea to upload large binaries to the chef server. Place them on some server in the intranet or maybe add an Apache HTTP server to the node running the chef server and upload the files there. And yes, then use the remote_file resource.

We had similar issue. Since our requirement is that the huge file should be on chef server before deployment to client.
We had just used split command and used cat command to join on target node. It worked well ..

Related

how to copy between two host machine and windows server client using ansible faster?

My aim is to copy from a machine A(ubuntu) to remote server B(windows2012 server) using ansible copy command. I can ping the windows server machine and can even copy a small folder from ubunto to server but when the folder size becomes big it takes so so long to get copied and sometimes not get copied . I am using as follows:
-name:copy file
win_copy:
src: '/service/test.zip'
dest:'D:/test/test.zip'
test.zip folder is around 300 MB. So, win_copy is not solving my purpose. Could you suggest what can be good option in this case?
I've had this problem and just wrote a powershell script to download the file directly to a known location on the target. Write a powershell script to download the file. I would deploy the script to the target using win_copy or win_template (if you need to do substitutions) and then call it using win_command.

Deployed version of NodeJS site not loading on AWS

I am doing my first deployment on AWS (using Elastic Beanstalk), and I am completely new to this.
I built a personal website using NodeJS / Express, and on my local machine it loads just fine. Once I was ready to deploy a v1, I created an AWS account and set up a new EBS application environment for Node. I set up the static files to load from /public, set my node version, and set the launch command as node app.js, but those were the only options I changed.
I zipped up my site (using CNTL + Click -> Compress on a selection of all site files) and uploaded that zip, and after some time, it came up all green. Clicking the link to load my site though, I get a half finished version. Looking at my console, I see that I am getting 4 files as 404, and because of that, 4 failures from RequireJS.
These 4 files are backbone views, and are contained in a folder with 4 other JS files that are all loading just fine (I can open them in the chrome dev tools source tab from the deployed version). I am confused how just these 4 files would go missing.
Is there some way to FTP into where ever my files are contained, to confirm the files are in fact not present? And barring that, what steps are available to figure out what is occurring here? Like I said, it looks and loads just fine locally, and I am at a loss as to where to even start debugging something like this. The AWS docs I have read so far only tell me to do exactly what I have been doing.
Repo for the project is here: https://github.com/RyanMG/trustycode
And the deployment is here: http://trustycode.elasticbeanstalk.com/
The files it is having trouble with are under public/javascript/views/ (CodeView, AboutView, PhotoView, DesignView)
Any ideas / advice?
Is there some way to FTP into where ever my files are contained, to confirm the files are in fact not present?
You can ssh into the EC2 instance of the Elastic Beanstalk app using your pem file.
Check files in /var/app/current
I don't have the reputation to comment, but that is one of those common gotchas I found myself switching to OSX from GNU/LINUX at work. OSX is case insensitive; linux world is case sensitive.

IIS Webdeploy: copy files to client

I am trying to copy some files to a destination Folder (which should be no problem with Webdeploy) and after that process I would like to get these files on the client (the computer which is starting the msdeploy process).
There seem to be a lot of examples on how to copy files to a server, but I could not find any about geting files from the server.
What you are describing is not currently supported by MSDeploy. Workarounds that I can think of include:
Defining a postSync argument that copies files to a directory accessible via FTP
Install MSDeploy on the client and have the server trigger a separate deployment back to the client (this would require that the client be publically accessible)

How to deploy a data file on tomcat web server in linux debian OS

I have a web application developed using JSP and Servlet. This web application is deployed on server having Debian Linux as OS and The Tomcat version is 5.5.31. As this applications required some data files, These data files will be get created automatically when setting are done using a standalone java application. This application is deployed on another machine. This setup is done. As I dont know much about Debian Linux and where my application is goes on it so I have some doubts in deployment of these autimatically generated data files which are as follows
As I made the .war file of my web application and deployed it using Tomcat Manager. so I dont know where exactly my application goes. I dont know the exact path. How do I find it?
Is it possible to create FTP for this web application which is deployed on Debian Linux server? I think that if creating FTP is possible then I will directly connect to FTP using my Stand alone Java program and will easily do the creation of the file and other file and directory manipulation.
If you've deployed a war, the application isn't anywhere on the filesystem as such. Most servers will unpack the war somewhere, but you shouldn’t rely on where that is.
I can think of several options:
getServletContext().getAttribute("javax.servlet.context.tempdir") to get the application's temp directory, then inform you external program of this location and place the file somewhere in there in a know location.
Arrange for a "know location" outside of the application, such as /tmp/somewhere or /var/cache/your-app/somewhere to place such files. (Note: /tmp is usually cleaned on startup of a linux machine)
As for getting the file onto the server from a remote machine: You could get your client to upload the file directly to your webapp (something like Apache HTTPClient will help you there), which means that you could do without the "know location" above. If you want to do this outside of the application though, I'd avoid FTP (due to security). Instead, I'd go with scp (secure copy).
Edit: Reading between the lines a little, you mention "setting" in the data file. If this is a configuration file which is not changed once the app is running, you may find it more convenient to have a "deploy" step on your server which simply takes the settings file and adds it to the war before deploying it. This is easy enough with "ant war" for example. You could then access the file using getClass().getResourceStream(..) or such.

How to deploy a WAR file on Linux machine

I have a Linux Machine. Apache server is running and I need to deploy my project which is a .war file developed on Windows machine.
Can someone give me bit idea how to do that?
if you have FTP or SCP access to the directories where Tomcat is installed, you should be able to simply copy the generated WAR file to the tomcat/webapps directory. Tomcat will automatically deploy the war for you.
When redeploying, I find it safest to delete the original .WAR file in Tomcat, and tomcat will automatically destory the exploded directory for you. When that's done, copy up the .WAR file.
Finally, make sure you copy the .WAR file "all at once". If you have a slow upload, Tomcat will try and deploy the .WAR file even though it has not completely been uploaded yet. This will lead to a partial or unsuccessful deployment. It's best if you upload to a neutral directory (home directory, temp, whichever), and then either rename (using mv) the .WAR into tomcat, or simply copy it there using the local file systems copy command. Much faster than the upload. Safest way is to mv the file from the same filesystem.
All of this assumes you do not have any of the manager or admin ports open for Tomcat, as it provides mechanisms to remotely deploy applications directly.
But, in truth, simply removing the old app and slipping in the new app works simply and well for many applications.

Resources