ceph-mon[1437]: warning: unable to create /var/run/ceph: (13) Permission denied - ceph

I followed the ceph document manual install,and I use tarballs. The installation process went smoothly, but when I run start service display warning
Started Ceph cluster monitor daemon.
ceph-mon[1437]: warning: unable to create /var/run/ceph: (13) Permission denied
ceph-mon[1437]: 2018-08-15 12:21:08.625 7f04fa393180 -1 asok(0x55dee6e4c240) AdminSocketConfigObs::init: failed:
so, I run
chmod 775 -R /var/run/
After, ceph-mon service is normal, but when the system is rebooted, the warning appears again.
I tried to change /etc/ceph/ceph.conf. I added:
[client]
admin socket = /tmp/ceph/$cluster-$name.asok
But it didn't work. What should I do?

I solved this question
total two methods
1、modify ceph-mon#.service file,ceph replace root
ExecStart=/usr/bin/ceph-mon -f --cluster ${CLUSTER} --id %i --setuser root --setgroup root
or
2、modify ceph.conf file ,add
[mon]
run dir = XXXX (the path you want to use)

please trie:
chown ceph:ceph /var/run/ceph

You can check if the directory /var/run/ceph exists. If not, create a directory and give permission to your ceph user
sudo mkdir /var/run/ceph
sudo chown ceph:ceph /var/run/ceph

Related

How to pull mongodb logs with Wazuh agent?

I did following settings on /var/ossec/etc/ossec.conf and after that I restart agent but it's not showing logs on the Kibana dashboard
<localfile>
<log_format>syslog</log_format>
<location>/var/log/mongodb/mongod.log</location>
I performed a basic installation of Wazuh + MongoDB on agent side with the following results:
MongoDB by default writes inside syslog file located at /var/log/syslog.
Inside /var/log/mongodb/mongod.log there are internal mongo daemon logs that are more specific.
We could monitor such logs on Wazuh agent by:
<localfile>
<log_format>syslog</log_format>
<location>/var/log/syslog</location>
</localfile>
This rule is included by default on the agent but anyway is good to remember.
the other one as you point it out:
<localfile>
<log_format>syslog</log_format>
<location>/var/log/mongodb/mongod.log</location>
</localfile>
I only see that you didn't copy the closing tag </location> but it could be copy mistake, whatever is good to take a look at /var/ossec/logs/ossec.log to find some error.
With that configuration we could receive alerts like this:
** Alert 1595929148.661787: - syslog,access_control,authentication_failed,pci_dss_10.2.4,pci_dss_10.2.5,gpg13_7.8,gdpr_IV_35.7.d,gdpr_IV_32.2,hipaa_164.312.b,nist_800_53_AU.14,nist_800_53_AC.7,tsc_CC6.1,tsc_CC6.8,tsc_CC7.2,tsc_CC7.3,
2020 Jul 28 09:39:08 (ubuntu-bionic) any->/var/log/mongodb/mongod.log
Rule: 2501 (level 5) -> 'syslog: User authentication failure.'
2020-07-28T09:39:07.431+0000 I ACCESS [conn38] SASL SCRAM-SHA-1 authentication failed for root on admin from client 127.0.0.1:52244 ; UserNotFound: Could not find user "root" for db "admin"
If we run mongo -u root (with bad password) on agent side.

rsync: mkstemp failed: Permission denied (13)

I am writing one shell script which have below command to copy the code files from remote server to local server by skipping some file but it gives errors like :
Command :
rsync -avz --delete --exclude=**/cache --exclude=**/administrator/cache/ --exclude=**/tmp --exclude=**/configuration.php -e ssh $REMOTE_USER#$REMOTE_SERVER:$REMOTE_PATH $LOCAL_PATH
Errors :
1) rsync: mkstemp "/var/www/test.domainname/public/.sript.php.4FRyfv" failed: Permission denied (13)
2) rsync: mkstemp "/var/www/test.domainname/public/.access.txt.PECuqA" failed: Permission denied (13)
3) rsync: failed to set times on "/var/www/test.domainname/public/administrator/components/com_bconnect": Operation not permitted (1)
administrator/components/com_bconnect/
4) rsync: mkstemp "/var/www/test.domainname/public/administrator/components/com_bconnect/.config.xml.8LWLWF" failed: Permission denied (13)
Can you please help me out for above 4 errors.
I've just come across this error in a different form, i.e. attempting to rsync to a nested directory in /var/www/html on a remote server and not having write permission to the /var/www/html directory itself. In my case my error turned out to be due to mangled rsync syntax, but in your case you probably don't have permission to write to /var/www. This is where rsync is attempting to create its temporary files.
From my understanding you have two options:
use the
--temp-dir
parameter
use the
--inplace
parameter.
This is explained in the rsync man page and has also been asked before.
This is basically a permission issue for the remote/local directory to/from which one invites the data. I solved this error in a slightly differenr form again! I was sending files from the local ubuntu machine to the remote ubuntu machine through this.
rsync -arvz -e 'ssh -p 64060' ./SE-D-20-00279R2.pdf yogender#<IP>:</path/to/destination>
I had the same permission error:
rsync: mkstemp "<path/of/the/file2/you/try/to/rsync>" failed: Permission denied (13)
....
....
....
rsync: mkstemp "<path/of/the/file2/you/try/to/rsync>" failed: Permission denied (13)
After fiddling around I find this solution:
Problem: the receiver doesn't know the permission with the sender
solution: Need to create the folder at the receiver side (big machine) with sudo.
sudo mkdir </path/to/directory/you/are/sending/file/to/remote/machine>
Give the permission to the folder, which will send the data to this directory:
sudo chown yogender </path/to/directory/you/are/sending/file/to/remote/machine>
yogender here is the admin or user. you can get it by doing "whoami" on remote machine (when you are sending data from local to remote)
Then simply:
rsync -zaP -e 'ssh -p 64060' ./SE-D-20-00279R2.pdf yogender#147.32.99.72:</path/to/directory/you/are/sending/file/to/remote/machine>>

Failed to start mongod com.Could not find appropriate mongod in `/opt/mongodb/mms/mongodb-releases

I am getting following error when I tried to activate a backup for mongo instance.
I choosed local and copied all rpms to this folder /opt/mongodb/mms/mongodb-releases.
error:
Failed to start mongod
com.xgen.svc.brs.util.GenericMongoManager$MongodVersionException: Could not find appropriate mongod in `/opt/mongodb/mms/mongodb-releases/`, versions available to MMS: . Expecting version 3.4.4 or greater.
com.xgen.svc.brs.util.GenericMongoManager$Purpose.calculateBinaryPath(GenericMongoManager.java:166)
com.xgen.svc.brs.util.GenericMongoManager$Purpose.<init>(GenericMongoManager.java:125)
com.xgen.svc.brs.util.MongoManager$MongoDPurpose.<init>(MongoManager.java:331)
com.xgen.svc.brs.util.MongoManager$HeadPurpose.<init>(MongoManager.java:477)
com.xgen.svc.brs.job.ReplicaSetJob.startMongo(ReplicaSetJob.java:103)
com.xgen.svc.brs.job.ReplicaSetJob.startMongo(ReplicaSetJob.java:80)
com.xgen.svc.brs.job.IncrementalSyncJob.doWork(IncrementalSyncJob.java:82)
com.xgen.svc.brs.grid.Daemon.iterate(Daemon.java:116)
com.xgen.svc.brs.grid.Daemon.run(Daemon.java:305)

ERROR: child process failed, exited with error number 51 MongoDB

Getting this error while restarting MongoDB , I am using Mongo 3.2.4 and doing this set up on a new machine
Starting mongod... about to fork child process, waiting until server is ready for connections.
forked process: 19438
ERROR: child process failed, exited with error number 51
mongod(_ZN5mongo19MmapV1ExtentManager4initEPNS_16OperationContextE+0x4A8) [0x1040278]
mongod(_ZN5mongo26MMAPV1DatabaseCatalogEntryC1EPNS_16OperationContextENS_10StringDataES3_bb+0x187) [0x1036dc7]
mongod(_ZN5mongo12MMAPV1Engine23getDatabaseCatalogEntryEPNS_16OperationContextENS_10StringDataE+0x14E) [0x103a1de]
mongod(_ZN5mongo14DatabaseHolder6openDbEPNS_16OperationContextENS_10StringDataEPb+0x133) [0xac92a3]
----- END BACKTRACE -----
For me this error occured due to incorrect ownership of some files in my data directory. I fixed this using the following command:
sudo chown -R mongodb: /path/to/db/directory
Where mongodb was the database user in my case.
This is resolved by inserting the following lines into /etc/security/limits.conf:
mongodb soft nofile 65535
mongodb hard nofile 90000
mongodb soft nproc 65535
mongodb hard nproc 90000
We need to add the user account used to run the Mongo service. Generally, it is the mongodb user.
In my case the problem was that I haven't created the appropriate folders specified in the config files.

ERROR could not access file "$libdir/repmgr_funcs" No such file or directory

I follow this link to create master slave replication on Ubuntu postgresql server.
My Configuration of repmgr and postgresql are:
Postgresql 9.5-: /opt/PostgreSQL/9.5/
repmgr-: /usr/lib/postgresql/9.5/bin/repmgr
repmgr.conf -: /etc/rep.conf
pg_config --pkglibdir => /usr/lib/postgresql/9.5/lib
ls /usr/lib/postgresql/9.5/lib | grep repmgr_funcs => repmgr_funcs.so
I am getting ERROR-: unable to create the function
repmgr_update_last_updated: ERROR: could not access file "$libdir/repmgr_funcs": No such file or directory
ERROR: Unable to create repmgr schema - see preceding error message(s); aborting
If you are using repmgr ver. 4 and above then you need to change in postgresql.conf
From shared_preload_libraries = 'repmgr_funcs'
To shared_preload_libraries = 'repmgr'
Below are their upgrade notes
The repmgr shared library has been renamed from repmgr_funcs to
repmgr, meaning shared_preload_libraries in postgresql.conf needs to
be updated to the new name: shared_preload_libraries = 'repmgr'