<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Run oneagent on AWS docker swarm in Cloud platforms</title>
    <link>https://community.dynatrace.com/t5/Cloud-platforms/Run-oneagent-on-AWS-docker-swarm/m-p/41387#M321</link>
    <description>&lt;P&gt;As far as I can recall I used the prescribed docker run command. Other than that I have no idea what the problem could be in your case. Maybe I will try if the OneAgent docker image still works for me when I have time next week in which case I will update my answer.&lt;/P&gt;&lt;BR /&gt;</description>
    <pubDate>Sat, 20 Oct 2018 06:50:04 GMT</pubDate>
    <dc:creator>moritz_becker</dc:creator>
    <dc:date>2018-10-20T06:50:04Z</dc:date>
    <item>
      <title>Run oneagent on AWS docker swarm</title>
      <link>https://community.dynatrace.com/t5/Cloud-platforms/Run-oneagent-on-AWS-docker-swarm/m-p/41380#M314</link>
      <description>&lt;P&gt;Hi, apologies if this has already been asked, I've searched and can't see anything linked to the issue I'm facing.&lt;/P&gt;&lt;P&gt;I've got 2 docker swarms that are linked to an AWS account, I've successfully linked the AWS account to our Dynatrace account and getting high level reporting but it says I need to install the OneAgent to get more info about each EC2 instance. The EC2 instances are created as managers and nodes by docker swarm so I don't have access to the AMI's that they use. I can modify the cloudformation and include the install commands via the UserData command, but this fails.&lt;/P&gt;&lt;P&gt;Trying to install it manually via SSH I get the following message:&lt;/P&gt;&lt;P&gt;Error: Dynatrace OneAgent cannot be installed inside a docker container, setup won't continue.&lt;/P&gt;&lt;P&gt;But it isn't inside a docker container, it's the host, I'm guessing that because the OS is Alpine, the OneAgent just assumes it's a container and fails there.&lt;/P&gt;&lt;P&gt;Any suggestions for how I can get OneAgent installed on EC2 instances deployed via docker swarm?&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Let me know if you need any more information.&lt;/P&gt;&lt;P&gt;Rich&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2017 12:02:10 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Cloud-platforms/Run-oneagent-on-AWS-docker-swarm/m-p/41380#M314</guid>
      <dc:creator>richard_wilson</dc:creator>
      <dc:date>2017-11-08T12:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: Run oneagent on AWS docker swarm</title>
      <link>https://community.dynatrace.com/t5/Cloud-platforms/Run-oneagent-on-AWS-docker-swarm/m-p/41381#M315</link>
      <description>&lt;P&gt;When you connect to a Docker Swarm Node/Manager instance created by Docker Swarm for AWS (i.e. via the provided CloudFormation template), then you indeed connect to a container running on this instance, namely the docker4x/shell-aws container. This happens transparently because the host SSH port is forwarded to the docker4x/shell-aws container.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Dec 2017 18:13:50 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Cloud-platforms/Run-oneagent-on-AWS-docker-swarm/m-p/41381#M315</guid>
      <dc:creator>moritz_becker</dc:creator>
      <dc:date>2017-12-10T18:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: Run oneagent on AWS docker swarm</title>
      <link>https://community.dynatrace.com/t5/Cloud-platforms/Run-oneagent-on-AWS-docker-swarm/m-p/41382#M316</link>
      <description>&lt;P&gt;&lt;BR /&gt;	After hours of trying, here is what I figured out. I have tried to install OneAgent using two approaches.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;	The following relates to a Docker Swarm on AWS cluster that was created using the CloudFormation template &lt;BR /&gt;	&lt;A href="https://docs.docker.com/docker-for-aws/"&gt;supplied by Docker&lt;/A&gt;. EC2 instances in such a deployment are based on the AMI Moby Linux 17.10.0-ce-aws1 edge (ami-b20bb2dd) for the latest version.&lt;/P&gt;&lt;H2&gt;1. Install OneAgent on the "real" Docker Host&lt;/H2&gt;&lt;P&gt;&lt;BR /&gt;	I first attempted to manage to build a SSH connection to a swarm EC2 instance in order to try the installation. I managed to do that by inserting the following instructions into the User Data section before the rc-service docker restart instruction.&lt;/P&gt;&lt;BR /&gt;&lt;PRE&gt;echo "http://dl-2.alpinelinux.org/alpine/edge/community/" &amp;gt;&amp;gt; /etc/apk/repositories&lt;BR /&gt;apk add --no-cache openssh sudo shadow sed&lt;BR /&gt;echo "docker ALL=(ALL) NOPASSWD:ALL" &amp;gt;&amp;gt; /etc/sudoers# start sshd&lt;BR /&gt;sed -i 's/#Port 22/Port 2222/g' /etc/ssh/sshd_config&lt;BR /&gt;mkdir -p ~/.ssh &amp;amp;&amp;amp; docker cp shell-aws:/home/docker/.ssh/authorized_keys ~/.ssh/authorized_keys&lt;BR /&gt;/etc/init.d/sshd start&lt;BR /&gt;&lt;/PRE&gt;This allowed me to SSH into the Swarm EC2 instance at docker@{ec2-public-dns}:2222. The next issue was that the provided AMI is based on Alpine Linux but OneAgent requires glibc. I worked around this by installing glibc compatibility using the following commands:&lt;BR /&gt;&lt;PRE&gt;# install alpine-glibc&lt;BR /&gt;wget -q -O /etc/apk/keys/sgerrand.rsa.pub "https://raw.githubusercontent.com/sgerrand/alpine-pkg-glibc/master/sgerrand.rsa.pub"&lt;BR /&gt;wget "https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.27-r0/glibc-2.27-r0.apk"&lt;BR /&gt;apk add --force glibc-2.27-r0.apk&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;I then tried to reuse the OneAgent installation instructions provided during the Dynatrace SaaS setup. Before that, I had to install OpenSSL support as well as the trusted root CAs:&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;apk update &amp;amp;&amp;amp; apk upgrade wget &amp;amp;&amp;amp; apk add openssl coreutils &amp;amp;&amp;amp; apk --no-cache add ca-certificates&lt;BR /&gt;&lt;/PRE&gt;The installation commands provided by Dynatrace are as follows:&lt;BR /&gt;&lt;PRE&gt;wget -O Dynatrace-OneAgent-Linux.sh "https://{ACCOUNT-ID}.live.dynatrace.com/api/v1/deployment/installer/agent/unix/default/latest?Api-Token={API-TOKEN}&amp;amp;arch=x86&amp;amp;flavor=default"&lt;BR /&gt;# wget "https://ca.dynatrace.com/dt-root.cert.pem" ; ( echo 'Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="sha-256"; boundary="--SIGNED-INSTALLER"'; echo ; echo ; echo '----SIGNED-INSTALLER' ; cat Dynatrace-OneAgent-Linux.sh ) | openssl cms -verify -CAfile dt-root.cert.pem &amp;gt; /dev/null&lt;BR /&gt;/bin/sh Dynatrace-OneAgent-Linux.sh  APP_LOG_CONTENT_ACCESS=1&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;I needed to deactivate the signature verification because the root ca could not be downloaded:&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;Connecting to ca.dynatrace.com (52.85.184.247:443)&lt;BR /&gt;wget: error getting response: Connection reset by peer&lt;BR /&gt;&lt;/PRE&gt;Next, the GLIBC version check carried out by the OneAgent install script fails because it uses ldd --version and ldd in the AMI still targets the musl libc despite the prior installation of glibc compatibility. I manually deactivated the check in the script as a workaround.&lt;BR /&gt;After that, the invocation of base64 failed - it seems that Alpine comes with an uncommon version:&lt;BR /&gt;&lt;PRE&gt;/bin/base64: unrecognized option: i&lt;BR /&gt;BusyBox v1.25.1 (2017-11-23 08:48:46 GMT) multi-call binary.&lt;BR /&gt;Usage: base64 [-d] [FILE]&lt;BR /&gt;Base64 encode or decode FILE to standard output&lt;BR /&gt;        -d      Decode data&lt;BR /&gt;tar: short read&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;	I solved this by simply removing the -i option from the base64 invocation (readonly UNPACK_BINARY_ARGS="-d").&lt;BR /&gt;The next problem was that the AMI's root device is not mounted at / and the filesystem mounted as / is a tmpfs with only ~500MB in size. Thus, the installer script terminates because not enough space is available in the default insall path /opt/dynatrace.&lt;BR /&gt;I thought of 2 possible workarounds for this problem:&lt;/P&gt;&lt;OL&gt;&lt;BR /&gt;	&lt;BR /&gt;&lt;LI&gt;Specify a different install path (e.g. to /var which is mounted on the root device with sufficient memory)&lt;/LI&gt;	&lt;BR /&gt;&lt;LI&gt;Mount the root device in /opt via sudo mount /dev/xvdb1 /opt&lt;/LI&gt;&lt;/OL&gt;&lt;BR /&gt;I first tried option nr 2 and observed that the agent installation was working, although autostart could not be registered:&lt;BR /&gt;&lt;PRE&gt;15:11:18 Error: Couldn't add oneagent to autostart. Please adjust and add it manually.&lt;BR /&gt;Dynatrace-OneAgent-Linux.sh: line 3305: ex: not found&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;	After option nr 2 worked, I did not try option nr 1.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Here are the final instructions - leaving out the ssh stuff - that need to be inserted into the user data section of the Swarm CloudFormation template right before the rc-service docker restart (you may need to adapt the OneAgent download URL):&lt;/P&gt;&lt;BR /&gt;&lt;PRE&gt;"\n",&lt;BR /&gt;"# install openssl &amp;amp; ca certs\n",&lt;BR /&gt;"apk update &amp;amp;&amp;amp; apk upgrade wget &amp;amp;&amp;amp; apk add openssl coressl &amp;amp;&amp;amp; apk --no-cache add ca-certificates\n",&lt;BR /&gt;"# install alpine-glibc\n",&lt;BR /&gt;"wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://raw.githubusercontent.com/sgerrand/alpine-pkg-glibc/master/sgerrand.rsa.pub\n",&lt;BR /&gt;"wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.27-r0/glibc-2.27-r0.apk\n",&lt;BR /&gt;"apk add --force glibc-2.27-r0.apk\n",&lt;BR /&gt;"# install Dynatrace OneAgent\n",&lt;BR /&gt;"mkdir -p /opt/dynatrace\n",&lt;BR /&gt;"mount /dev/xvdb1 /opt/dynatrace\n",&lt;BR /&gt;"if [ -d /opt/dynatrace/oneagent ]; then\n",&lt;BR /&gt;"    /opt/dynatrace/oneagent/agent/initscripts/oneagent start\n",&lt;BR /&gt;"else\n",&lt;BR /&gt;"    wget -O Dynatrace-OneAgent-Linux.sh \"https://{ACCOUNT-ID}.live.dynatrace.com/api/v1/deployment/installer/agent/unix/default/latest?Api-Token={API-TOKEN}&amp;amp;arch=x86&amp;amp;flavor=default\"\n",&lt;BR /&gt;"    sed -i 's/arch_checkGlibc$/: #arch_checkGlibc/;s/readonly UNPACK_BINARY_ARGS=\\\"-di\\\"/readonly UNPACK_BINARY_ARGS=\\\"-d\\\"/' Dynatrace-OneAgent-Linux.sh\n",&lt;BR /&gt;"    /bin/sh Dynatrace-OneAgent-Linux.sh  APP_LOG_CONTENT_ACCESS=1\n",&lt;BR /&gt;"fi\n",&lt;BR /&gt;"\n",&lt;BR /&gt;&lt;/PRE&gt;&lt;H2&gt;2. Use &lt;A href="https://hub.docker.com/r/dynatrace/oneagent/"&gt;OneAgent docker image&lt;/A&gt;&lt;/H2&gt;&lt;P&gt;&lt;BR /&gt;	I noticed that there is also a docker image for running the OneAgent and tried that as well.&lt;/P&gt;&lt;BR /&gt;The docker image relies on a volume mount -v /:/mnt/root - this path is hard coded in the entrypoint.sh script. Again, the problem is that / is not mounted in the root device but in a tmpfs device with limited space. Hence, the installation fails due to insufficient space. The only way I was able to get it to work was by removing the volume mount and by adapting the entrypoint.sh script by:&lt;BR /&gt;&lt;PRE&gt;readonly DOCKER_HOST_ROOT_PREFIX=/&lt;BR /&gt;&lt;/PRE&gt;&lt;H2&gt;Conclusion&lt;/H2&gt;&lt;P&gt;&lt;BR /&gt;	Installing OneAgent on a Swarm EC2 instance works but it would be very nice if Dynatrace could modify their install procedures to make this work out-of-the-box.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 15:33:43 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Cloud-platforms/Run-oneagent-on-AWS-docker-swarm/m-p/41382#M316</guid>
      <dc:creator>moritz_becker</dc:creator>
      <dc:date>2017-12-11T15:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: Run oneagent on AWS docker swarm</title>
      <link>https://community.dynatrace.com/t5/Cloud-platforms/Run-oneagent-on-AWS-docker-swarm/m-p/41383#M317</link>
      <description>&lt;P&gt;I have a Question posted here. Could you please suggest any ideas if you have so?&lt;A href="https://community.dynatrace.com/spaces/482/dynatrace-open-qa/questions/201930/unable-to-get-the-services-running-in-docker-conta.html" target="_blank"&gt;https://community.dynatrace.com/spaces/482/dynatrace-open-qa/questions/201930/unable-to-get-the-services-running-in-docker-conta.html&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2023 15:03:51 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Cloud-platforms/Run-oneagent-on-AWS-docker-swarm/m-p/41383#M317</guid>
      <dc:creator>divya_sharma</dc:creator>
      <dc:date>2023-10-16T15:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: Run oneagent on AWS docker swarm</title>
      <link>https://community.dynatrace.com/t5/Cloud-platforms/Run-oneagent-on-AWS-docker-swarm/m-p/41384#M318</link>
      <description>&lt;P&gt;So, what did your docker run statement look like in its entirety?&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 19 Oct 2018 13:51:05 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Cloud-platforms/Run-oneagent-on-AWS-docker-swarm/m-p/41384#M318</guid>
      <dc:creator>tnoonan</dc:creator>
      <dc:date>2018-10-19T13:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: Run oneagent on AWS docker swarm</title>
      <link>https://community.dynatrace.com/t5/Cloud-platforms/Run-oneagent-on-AWS-docker-swarm/m-p/41385#M319</link>
      <description>&lt;P&gt;Sorry, but your question does not make sense to me.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 19 Oct 2018 14:28:41 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Cloud-platforms/Run-oneagent-on-AWS-docker-swarm/m-p/41385#M319</guid>
      <dc:creator>moritz_becker</dc:creator>
      <dc:date>2018-10-19T14:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: Run oneagent on AWS docker swarm</title>
      <link>https://community.dynatrace.com/t5/Cloud-platforms/Run-oneagent-on-AWS-docker-swarm/m-p/41386#M320</link>
      <description>&lt;P&gt;Sorry, my bad. Your option #2 of using the OneAgent docker image. I was wondering if you made any changes to the command as it is prescribed in the following link? https://www.dynatrace.com/support/help/deploy-dynatrace/oneagent/docker/how-do-i-deploy-dynatrace-oneagent-as-docker-container/ For some odd reason after download and install of the image, in a very similar setup to what you describe, the container fails with the following: First, this is run: The command that we run is: &lt;/P&gt;&lt;P&gt;docker run -d --privileged=true --restart=unless-stopped --pid=host --net=host --ipc=host --name=oneagent -v /:/mnt/root -e ONEAGENT_INSTALLER_SCRIPT_URL="https://***.live.dynatrace.com/api/v1/deployment/installer/agent/unix/def ault/latest?Api-Token=***&amp;amp;arch=x86&amp;amp;flavor=default" dynatrace/oneagent APP_LOG_CONTENT_ACCESS=1 &lt;/P&gt;&lt;P&gt;Then the output in the docker logs look like this. There's a check and failure for access rights on an initial mount point but it appears to move along and then fails trying to read the "-e" parameter? Very odd. &lt;/P&gt;&lt;P&gt;20:17:50 Error: Insufficient access rights () on: /var/lib &lt;/P&gt;&lt;P&gt;20:17:50 Error: /var/lib path must be globally readable (r-x permissions for others). 20:17:50 Error: Please adjust the permissions and then retry the installation. &lt;/P&gt;&lt;P&gt;20:17:51 Started agent deployment as a Docker container, PID 30911. &lt;/P&gt;&lt;P&gt;20:17:51 Downloading agent to /tmp/Dynatrace-OneAgent-Linux.sh via https://***.live.dynatrace.com/api/v1/deployment/installer/agent/unix/default/latest?Api-Token=***&amp;amp;arch=x86&amp;amp;flavor=default &lt;/P&gt;&lt;P&gt;20:17:51 Download was skipped as the agent version did not change &lt;/P&gt;&lt;P&gt;20:17:51 Validating downloaded agent installer 20:17:53 Verification successful 20:17:53 Deploying to: /mnt/host_root 20:17:53 Starting installer... &lt;/P&gt;&lt;P&gt;readlink: unrecognized option: e &lt;/P&gt;&lt;P&gt;BusyBox v1.25.1 (2016-10-26 16:15:20 GMT) multi-call binary. &lt;/P&gt;&lt;P&gt;Usage: readlink [-fnv] FILE &lt;/P&gt;&lt;P&gt;Display the value of a symlink &lt;/P&gt;&lt;P&gt;-f Canonicalize by following all symlinks ...........&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 19 Oct 2018 14:42:49 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Cloud-platforms/Run-oneagent-on-AWS-docker-swarm/m-p/41386#M320</guid>
      <dc:creator>tnoonan</dc:creator>
      <dc:date>2018-10-19T14:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: Run oneagent on AWS docker swarm</title>
      <link>https://community.dynatrace.com/t5/Cloud-platforms/Run-oneagent-on-AWS-docker-swarm/m-p/41387#M321</link>
      <description>&lt;P&gt;As far as I can recall I used the prescribed docker run command. Other than that I have no idea what the problem could be in your case. Maybe I will try if the OneAgent docker image still works for me when I have time next week in which case I will update my answer.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 20 Oct 2018 06:50:04 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Cloud-platforms/Run-oneagent-on-AWS-docker-swarm/m-p/41387#M321</guid>
      <dc:creator>moritz_becker</dc:creator>
      <dc:date>2018-10-20T06:50:04Z</dc:date>
    </item>
  </channel>
</rss>

