There are TOO many post and solution for this problem, but still i am not able to solve it.
I am using puppet 3.7.5
Following is details
root#p1:/etc/puppet/manifests# ls -l
total 8
-rw-r--r-- 1 root root 40 Apr 9 12:37 nodes.pp
-rw-r--r-- 1 root root 18 Apr 9 11:58 site.pp
root#p1:/etc/puppet/manifests# cat nodes.pp
node 'wa.ro.XXX' {
include mytest
}
root#p1:/etc/puppet/manifests# cat site.pp
import 'nodes.pp'
Module path
root#p1:/etc/puppet/manifests# puppet master --configprint modulepath
/etc/puppet/modules:/usr/share/puppet/modules
root#p1:/etc/puppet# tree -L 2 -d modules
modules
- configfiles
-- files
-- manifests
- services
-- files
-- manifests
root#p1:/etc/puppet# cat modules/services/manifests/init.pp
class mytest {
file { '/tmp/puppettestfgt56666' :
mode => 0644,
content => "This Learning Puppet VM's IP address is ${ipaddress}",
}
}
On agent
root#wa:/var/cache# puppet agent --no-daemonize --onetime --verbose
Info: Retrieving plugin
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find class mytest for wa.ro.XXX on node wa.ro.XXX
Notice: Using cached catalog
Info: Applying configuration version '1428561896'
Notice: Finished catalog run in 0.07 seconds
Class mytest can and will only be found in module mytest. You cannot just throw it into module services and expect Puppet to be able to look it up from there.
Related
I'm following a tutorial here on creating linux containers, and I'm running into the following error which I cannot find an answer to:
$ sudo lxc-create -f lxc-left.conf -t download -n left -- -d fedora -r 26 -a amd64
lxc-create: left: parse.c: lxc_file_for_each_line_mmap: 100 Permission denied - Failed to open file "lxc-left.conf"
Setting up the GPG keyring
ERROR: Unable to fetch GPG key from keyserver
lxc-create: left: lxccontainer.c: create_run_template: 1625 Failed to create container from template
lxc-create: left: tools/lxc_create.c: main: 331 Failed to create container left
The permissions for the file are like so:
-rw-rw-rw-. 1 *** domain users 245 Oct 6 13:36 lxc-left.conf
-rw-rw-rw-. 1 *** domain users 248 Oct 6 13:36 lxc-right.conf
So I'm not sure why it would give me a permission denied - unless it expects it to be under a certain group.
For GPG keystring error, I know there's an options of --no-validate but I want to be able to validate with a gpg key. I am behind a proxy but can ping sites like google, etc.
The source code for the error is here
I'm using RHVH to manage my infrastructure VMs.
I've two bare metal servers in two different network subnets with same release version of RHVH.
I use an automated script to deploy VMs on both, and provision a docker repository file there on VMs.
The issue I'm facing is when I'm trying to query container-selinux package. It works on VMs from one of my bare metal servers, and not from the other.
first sever's VM:
[root#cpu-node0 ~]# /bin/repoquery --show-duplicates --plugins --disablerepo '' --enablerepo '' --qf '%{name}|%{epoch}|%{version}|%{release}|%{arch}|%{repoid}' container-selinux
container-selinux|2|2.107|1.el7_6|noarch|extras
container-selinux|2|2.107|3.el7|noarch|extras
[root#cpu-node0 ~]#
Second server's VM :
[root#cpu-node0 ~]# /bin/repoquery --show-duplicates --plugins --disablerepo '' --enablerepo '' --qf '%{name}|%{epoch}|%{version}|%{release}|%{arch}|%{repoid}' container-selinux
Could not match packages: failure: repodata/repomd.xml from docker-engine: [Errno 256] No more mirrors to try.
https://yum.dockerproject.org/repo/main/centos/7/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
[root#cpu-node0 ~]#
The yum repo configuration on both VMs running on each bare metal server:
[root#cpu-node0 ~]# ll /etc/yum.repos.d/
total 44
-rw-r--r--. 1 root root 1664 5 sept. 13:05 CentOS-Base.repo
-rw-r--r--. 1 root root 1309 5 sept. 13:05 CentOS-CR.repo
-rw-r--r--. 1 root root 649 5 sept. 13:05 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 314 5 sept. 13:05 CentOS-fasttrack.repo
-rw-r--r--. 1 root root 630 5 sept. 13:05 CentOS-Media.repo
-rw-r--r--. 1 root root 1331 5 sept. 13:05 CentOS-Sources.repo
-rw-r--r--. 1 root root 6639 5 sept. 13:05 CentOS-Vault.repo
-rw-r--r--. 1 root root 369 2 mars 23:31 docker.repo
-rw-r--r--. 1 root root 1050 17 sept. 23:25 epel.repo
-rw-r--r--. 1 root root 1149 17 sept. 23:25 epel-testing.repo
[root#cpu-node0 ~]#
docker.repo file content on both VMs :
[root#cpu-node0 ~]# cat /etc/yum.repos.d/docker.repo
[docker-ce]
name=Docker-CE Repository
baseurl=https://download.docker.com/linux/centos/7/$basearch/stable
enabled=1
gpgcheck=1
keepcache=1
gpgkey=https://download.docker.com/linux/centos/gpg
[docker-engine]
name=Docker-Engine Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/7
enabled=1
gpgcheck=1
keepcache=1
gpgkey=https://yum.dockerproject.org/gpg
[root#cpu-node0 ~]#
Repo list on the first VM :
[root#cpu-node0 ~]# yum repolist
id du dépôt nom du dépôt statut
base/7/x86_64 CentOS-7 - Base 10 097
docker-ce/x86_64 Docker-CE Repository 68
!docker-engine Docker-Engine Repository 110
epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 13 199
extras/7/x86_64 CentOS-7 - Extras 323
updates/7/x86_64 CentOS-7 - Updates 1 478
repolist: 25 275
[root#cpu-node0 ~]#
Yum repo list on the second VM:
[root#cpu-node0 ~]# yum repolist
https://yum.dockerproject.org/repo/main/centos/7/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Essai d'un autre miroir.
To address this issue please refer to the below wiki article
https://wiki.centos.org/yum-errors
If above article doesn't help to resolve this issue please use https://bugs.centos.org/.
docker-ce/x86_64/primary_db | 40 kB 00:00:05
https://yum.dockerproject.org/repo/main/centos/7/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Essai d'un autre miroir.
id du dépôt nom du dépôt statut
base/7/x86_64 CentOS-7 - Base 10 097
docker-ce/x86_64 Docker-CE Repository 68
docker-engine Docker-Engine Repository 0
epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 13 199
extras/7/x86_64 CentOS-7 - Extras 323
updates/7/x86_64 CentOS-7 - Updates 1 478
repolist: 25 165
[root#cpu-node0 ~]#
I also get the message below when trying to curl the repository URL :
[root#cpu-node0 ~]#curl https://yum.dockerproject.org/repo/main/centos/7/repodata/repomd.xml
<!doctype html>
<html lang="en">
<head></head>
<body>
<h1>Notice: Shutting down dockerproject.org APT and YUM repos 2020-03-31</h1>
<p>Docker will be shutting down the deprecated APT and YUM repositories hosted at "dockerproject.org" and "dockerproject.com" on the 31st of March 2020.</p>
<p>We noticed that this project is referencing one of these repositories, and recommend updating to use the "download.docker.com" repository to prevent disruption.</p>
<p>More info: https://www.docker.com/blog/changes-dockerproject-org-apt-yum-repositories/ </p>
</body>
</html>
Looks like docker does not want anyone to use this repo anymore. Probably they started issuing the error from today I guess.
Of course the two VMs do not have subscription-manager package installed, neither subscription attached, they don't need actually in our context, but why is there a mirror issue on one VM and not on the other, whose OS and system configuration is the same on both, except that they are locate in two different networks?
Looks like yum docker-engine querying came back to a normal state
Even docker project url curling is working without the warning message seen in my first post
Looks like the deployment process hit a bad state in the public repo and hence caused these errors.
I am running Jenkins as a docker container, and have installed the NodeJS plugin and followed thoroughly the setup instructions. When I try to run a script using node, I get the following error:
/tmp/jenkins9123978873441132802.sh: line 1: node: not found
Build step 'Execute shell' marked build as failure
Finished: FAILURE
I checked the docker volume, the node bin is where it should be and is executable is there and it works fine when I run it from my host server:
user#server:/data/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/latest/bin$ ./node --version
v9.2.0
I modified my build script to explore a bit further the problem:
echo $PATH
cd /var/jenkins_home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/latest/bin
ls -all
./node --version
node --version
npm --version
and look how strange this is:
Building in workspace /var/jenkins_home/workspace/release
[WS-CLEANUP] Deleting project workspace...
[WS-CLEANUP] Done
Adding all registry entries
copy managed file [Main config] to file:/var/jenkins_home/workspace/release#tmp/config69012336710357692tmp
[release] $ /bin/sh -xe /tmp/jenkins6243047436861395796.sh
+ echo /var/jenkins_home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/latest/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin
/var/jenkins_home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/latest/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin
+ cd /var/jenkins_home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/latest/bin
+ ls -all
total 34112
drwxr-xr-x 2 jenkins jenkins 4096 Nov 20 16:16 .
drwxr-xr-x 6 jenkins jenkins 4096 Nov 20 16:16 ..
-rwxrwxrwx 1 jenkins jenkins 34921762 Nov 14 20:33 node
lrwxrwxrwx 1 jenkins jenkins 38 Nov 20 16:16 npm -> ../lib/node_modules/npm/bin/npm-cli.js
lrwxrwxrwx 1 jenkins jenkins 38 Nov 20 16:16 npx -> ../lib/node_modules/npm/bin/npx-cli.js
+ ./node --version
/tmp/jenkins6243047436861395796.sh: line 1: ./node: not found
Build step 'Execute shell' marked build as failure
Finished: FAILURE
The node executable is present, and it's executable (+x). The path is correctly set, but the build still fails.
This is because the path to the node binary
/data/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/latest/bin
Does not exist on your shell path.
You should edit Jenkins' variables to adjust your PATH.
I have run into a problem on CentOS 7 when attempting to map a volume to the host in a tomcat container. This happens with the public tomcat images as well as an image I have created (based on centos instead of debian).
instantiating a container as follows will succeed:
docker run -it -d tomcat:8
instantiating a container as follows will succeed, but with errors in the log and logs are not written to the host:
docker run -it -d -v /usr/local/tomcat:/usr/local/tomcat tomcat:8
[wpackard#eagle2 tomcat]$ dkr run -it -d -v
/usr/local/tomcat:/usr/local/tomcat tomcat:8
34075701b1436f83a24212170b4d2113ae698df244c449203b1c9af9814485c9
[wpackard#eagle2 tomcat]$ dkr ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
34075701b143 tomcat:8 "catalina.sh run" 5 seconds ago Up 4 seconds 8080/tcp sharp_einstein
[wpackard#eagle2 tomcat]$ dkr logs sharp_einstein
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
java.util.logging.ErrorManager: 4
java.io.FileNotFoundException: /usr/local/tomcat/logs/catalina.2015-03-31.log (Permission denied)
...
31-Mar-2015 15:32:04.088 SEVERE [Catalina-startStop-1] org.apache.catalina.startup.HostConfig.start Unable to create directory for deployment: /usr/local/tomcat/conf/Catalina/localhost
31-Mar-2015 15:32:04.097 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/tomcat/webapps/ROOT
31-Mar-2015 15:32:04.468 WARNING [localhost-startStop-1] org.apache.catalina.core.StandardContext.postWorkDirectory Failed to create work directory [/usr/local/tomcat/work/Catalina/localhost/ROOT] for context []
31-Mar-2015 15:32:05.966 SEVERE [localhost-startStop-1] org.apache.jasper.EmbeddedServletOptions.<init> The scratchDir you specified: /usr/local/tomcat/work/Catalina/localhost/ROOT is unusable.
31-Mar-2015 15:32:06.042 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/local/tomcat/webapps/ROOT has finished in 1,929 ms
31-Mar-2015 15:32:06.043 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/tomcat/webapps/docs
31-Mar-2015 15:32:06.093 WARNING [localhost-startStop-1] org.apache.catalina.core.StandardContext.postWorkDirectory Failed to create work directory [/usr/local/tomcat/work/Catalina/localhost/docs] for context [/docs]
31-Mar-2015 15:32:06.216 SEVERE [localhost-startStop-1] org.apache.jasper.EmbeddedServletOptions.<init> The scratchDir you specified: /usr/local/tomcat/work/Catalina/localhost/docs is unusable.
31-Mar-2015 15:32:06.219 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/local/tomcat/webapps/docs has finished in 176 ms
31-Mar-2015 15:32:06.220 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/tomcat/webapps/examples
31-Mar-2015 15:32:06.272 WARNING [localhost-startStop-1] org.apache.catalina.core.StandardContext.postWorkDirectory Failed to create work directory [/usr/local/tomcat/work/Catalina/localhost/examples] for context [/examples]
31-Mar-2015 15:32:07.952 SEVERE [localhost-startStop-1] org.apache.jasper.EmbeddedServletOptions.<init> The scratchDir you specified: /usr/local/tomcat/work/Catalina/localhost/examples is unusable.
[wpackard#eagle2 tomcat]$
Exec'ing to the container and attempting to write also fails.
[wpackard#eagle2 tomcat]$ dkr ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
34075701b143 tomcat:8 "catalina.sh run" 5 minutes ago Up 5 minutes 8080/tcp sharp_einstein
[wpackard#eagle2 tomcat]$ dkr exec -it sharp_einstein /bin/bash
root#34075701b143:/usr/local/tomcat# ls -l
total 96
-rw-rw-r--. 1 root root 56977 Jan 23 11:59 LICENSE
-rw-rw-r--. 1 root root 1397 Jan 23 11:59 NOTICE
-rw-rw-r--. 1 root root 6779 Jan 23 11:59 RELEASE-NOTES
-rw-rw-r--. 1 root root 16204 Jan 23 11:59 RUNNING.txt
drwxrwxr-x. 2 root root 4096 Mar 31 12:14 bin
drwxrwxr-x. 2 root root 4096 Jan 23 11:59 conf
drwxrwxr-x. 2 root root 4096 Mar 31 12:14 lib
drwxrwxr-x. 2 root root 6 Jan 23 11:56 logs
drwxrwxr-x. 2 root root 29 Mar 31 12:14 temp
drwxrwxr-x. 7 root root 76 Jan 23 11:57 webapps
drwxrwxr-x. 2 root root 6 Jan 23 11:56 work
root#34075701b143:/usr/local/tomcat# cd logs
root#34075701b143:/usr/local/tomcat/logs# echo "test" > test.log
bash: test.log: Permission denied
I have created an instance of the postgresql container on centos and that successfully maps and uses the volume, verified by creating a db, stopping the instance and then re-running the container.
[wpackard#eagle2 ~]$ uname --all
Linux eagle2 3.10.0-123.20.1.el7.x86_64 #1 SMP Thu Jan 29 18:05:33 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
[wpackard#eagle2 ~]$
dkr is an alias to docker, I have created a docker group and added myself to the group to eliminate the need for sudo.
The volume mapping seems to work correctly on ubuntu. On CentOS I have tried both the package version (as below), and also updating it to 1.5.
[wpackard#eagle2 ~]$ dkr --version
Docker version 1.3.2, build 39fa2fa/1.3.2
[wpackard#eagle2 ~]$
How do I make volumes work on CentOS?
I think your volumes are working :-) You have a permission problem. I run into this fairly often with the mapping of user id between the host and the container. On your host, if you look at /usr/local/tomcat (ls -ld), you will see a owner, group and the permissions. You probably have something like 0755 (read/write/exec by owner, read/exec by group, read/exec by world. You can test this theory easily, simple remember the current settings for /usr/local/tomcat/logs, then do:
chmod 777 /usr/local/tomcat/logs
from the docker host (not the container). Then run your test on the container, the Permission denied should evaporate.
This is NOT a good fix, though. I don't know what the community says about user id mapping for docker. One thing you could do is figure out the user and group in your host for that directory. Then, when you create your image (or at run time) create a user with the same id and a group with the same id in the container. Then run your tomcat service using that user in the container.
This is due to SELinux.
You must attach correct type to host directory:
host$ chcon -Rt svirt_sandbox_file_t /usr/local/tomcat
I ran the following commands referring to https://cloud.google.com/hadoop/setting-up-a-hadoop-cluster on cygwin.
gsutil.cmd mb -p [projectname] gs://[bucketname]
./bdutil -p [projectname] -n 2 -b [bucketname] -e hadoop2_env.sh
generate_config configuration.sh
./bdutil -e configuration.sh deploy
After deployment, I am getting the following errors:
.
.
.
Node 'hadoop-w-0' did not become ssh-able after 10 attempts
Node 'hadoop-w-1' did not become ssh-able after 10 attempts
Node 'hadoop-m' did not become ssh-able after 10 attempts
Command failed: wait ${SUBPROC} on line 308.
Exit code of failed command: 1
Detailed debug info available in file: /tmp/bdutil-20150120-103601-mDh/debuginfo.txt*
The logs in debuginfo.txt are like these:
******************* Exit codes and VM logs *******************
Tue, Jan 20, 2015 10:18:09 AM: Exited 1 : gcloud.cmd --project=[projectname] --quiet --verbosity=info compute ssh hadoop-w-0 --command=exit 0 --ssh-flag=-oServerAliveInterval=60 --ssh-flag=-oServerAliveCountMax=3 --ssh-flag=-oConnectTimeout=30 --zone=us-central1-a
Tue, Jan 20, 2015 10:18:09 AM: Exited 1 : gcloud.cmd --project=[projectname] --quiet --verbosity=info compute ssh hadoop-w-1 --command=exit 0 --ssh-flag=-oServerAliveInterval=60 --ssh-flag=-oServerAliveCountMax=3 --ssh-flag=-oConnectTimeout=30 --zone=us-central1-a
Tue, Jan 20, 2015 10:18:09 AM: Exited 1 : gcloud.cmd --project=[projectname] --quiet --verbosity=info compute ssh hadoop-w-2 --command=exit 0 --ssh-flag=-oServerAliveInterval=60 --ssh-flag=-oServerAliveCountMax=3 --ssh-flag=-oConnectTimeout=30 --zone=us-central1-a
Could you please help me in resolving this issue?. Thank you a lot.
You may need to look at the console output for your Hadoop instances, from within the Developers console > Compute Engine > VM Instances > INSTANCE_NAME > scroll down to View Console Output .
Additionally you can run :
$ gcloud compute instances get-serial-port-output INSTANCE_NAME
this should give you a better picture of what is going on behind the scenes when the instances are booted (check if SSH daemon has started and on which port..etc.).