I use CentOS7 as my system
I tried to change the data direction on MariaDB 10.1.43
I follow the process on internet and all show to change the datadir=/var/lib/mysql/ in my.cnf
but the problem is there is no my.cnf file in my computer
only a my.cnf.d folder with a server.cnf file in it
I type datadir=/newpath/ in this server.cnf
but it didn't work, the datadir that mariaDB shows is still /var/lib/mysql/
what should I do for now? how can I find this my.cnf file?
I realize this is an old question. But wanted to add an answer that worked for me on a legacy machine running MariaDB 10.1.43 and CentOS 6.
Within the /etc/my.cnf file add this under [client-server] to look like this:
[client-server]
port=3306
socket=/home/mysql/mysql.sock
Then, within the /etc/my.cnf.d folder in the server.cnf file add this under [mysqld] to look like this:
[mysqld]
datadir=/home/mysql
socket=/home/mysql/mysql.sock
I moved the data to the /home directory, which is a newly mounted volume with additional space for this machine.
The next part of my answer is out of scope for this question. But the instructions here worked like a charm for moving your MySQL/MariaDB data directory. Semi-pro tip: Be sure to follow the RedHat/CentOS step to add the security context.
Related
Currently running a WHM / Cpanel server running Centos. Server seems to be running fine no issues there. However I'm using a deployment process to put files outside of the document root. e.g.
~/deployment
instead of:
~/public_html
Obviously I need to point public_html to this folder so my site will run. So, I'm removing the public_html and creating a symlink and pointing it to the new deployment folder. This results in a 500 error.
So looking at the logs I've discovered that it produces the following error:
Directory "/home/xyz/deployment" is writeable by group
Checking the file permissions looks as though the symlink is 777 where i need it to be 755 for the server to allow viewing.
Is there a setting in WHM ? Is there a setting in Centos? I have another box running that doesn't have this issue so I'm assuming that this is related to the current setup of this machine.
Any help would be appreciated, thanks.
when you create a hard link from a file or folder, This file/folder inherits the accesses and permissions of the original file/folder, and in soft link it will be 777 permission, so i think you can use rsync options for both purpose :
1- have a folder with all files in source
2- have your own permissions in folder
I am working on installing PgPoolAdmin on my local ubuntu system for installing it on server later. Currently, I am able to login but I keep getting an error Could not read .pcppass fileFile not found. I have tried this and many other resources, but no luck. Where is it looking for this file?
The username and passowrd in pcp.conf is same as here, just its in plain text in .pcppass and md5 in pcp.conf. Is that correct?
pcp.conf I have on 2 location /var/www/html and /var/www/html/admin-tool/
Its contents :
#insert:hostname:port:username:password
*:*:akshay:PASSWORD
*:*:postgres:PASSWORD
Thank you.
.pcppass needs to accessible by the user that runs your web server. For example, if you are serving pgpoolAdmin through apache2 with default paths and users. The following should solve the issue.
cp ~/.pcpass /var/www/.pcppass
chown www-data:www-data /var/www/.pcppass
chmod 600 /var/www/.pcppass
By default a .pcppass file should be located in the user's $HOME directory. If you have created it elsewhere, then initialize the $PCPPASSFILE environment variable with the filepath. Make sure the file is in this format:hostname:port:username:password. Then you should be able to access the database.
Note: You cannot use wildcards in the password files, as it will give error sometimes. It is better to use exact host/port values for better security.
After having installed MongoDB 2.6.12 for FreeBSD 10.2, I need to change some MongoDB configuration parameters but there seems to be a problem.
there is no mongodb.conf file in the directory /etc/
instead, I located a mongodb.conf under usr/local/etc/ but the file is empty!?
I don't get it, what is wrong? MongoDB installation routine did not prompt any errors, hence I was expecting a fully operational mongodb.conf under /etc/
How am I supposed to change the MongoDB configuration now? Simply add the desired entries to the existing file under usr/local/etc/?
The correct location is /usr/local/etc/mongodb.conf, and the file is supposed to be empty. All you need is to add something like dbpath=/usr/data/db (or wherever you have created the directory to host your database) to be able to start the server.
i have a tomcat6 server running on a CentOS 6 machine and so far so good.
in one of my webapps i need to use a context param to access an external folder located in the filesystem, i configured my server.xml like this (relevant portion of <Host> tag only) :
<Context path="/userimages" docBase="/home/someuser/faces/32x32" debug="0" reloadable="true" crossContext="true"/>
when i start the server i get this error :
java.lang.IllegalArgumentException: Document base /home/someuser/faces/32x32 does not exist or is not a readable directory
i read something about folder permission so i set both "32x32" and "webapps" folder to 777, but it's still not working...any idea of how to fix this ?
P.S. on windows OS it works perfectly
My suggestion is to put your data into /usr/share/tomcat6/conf/context.xml which is a symlink to /etc/tomcat6/context.xml on CentOS 6. At least tomcat6 does read the contents of that file when it restarts, and I had some luck getting resource data loaded from there. It would seem that this file is new in tomcat6.
I used strace to check which files it was visiting and it does run stat() on the various files like /var/lib/tomcat6/webapps/*/META-INF/context.xml but nowhere does it actually open() those files, so I'm pretty sure it does not read the contents. Maybe some bug? Maybe imaginary future feature?
I managed to get Plandora (uses context to supply MySQL database connection details) running on CentOS 6 with these packages (from yum):
apache-tomcat-apis-0.1-1.el6.noarch
java-1.6.0-openjdk-1.6.0.0-1.61.1.11.11.el6_4.i686
mysql-connector-java-5.1.17-6.el6.noarch
tomcat6-6.0.24-52.el6_4.noarch
tomcat6-servlet-2.5-api-6.0.24-52.el6_4.noarch
tomcat6-el-2.1-api-6.0.24-52.el6_4.noarch
tomcat6-admin-webapps-6.0.24-52.el6_4.noarch
tomcat6-jsp-2.1-api-6.0.24-52.el6_4.noarch
tomcat6-lib-6.0.24-52.el6_4.noarch
tomcat6-webapps-6.0.24-52.el6_4.noarch
Just in case anyone else is trying to get Plandora to work on CentOS 6, you also need to make sure you symlink:
ln -s /usr/share/java/mysql-connector-java.jar /usr/share/tomcat6/lib/
I am installing postgres 8.4 on an ubuntu lucid server (no, at the moment we are using the "lucid" LTS version on that server so an upgrade is not possible yet (although we are going to start testing the system on precise quite soon now))
I have set up an own partition for the /var/lib/postgresql/8.4/main directory with a ext4 file system. (Those of you who are really into postgres installs knows what is happening now...) Since ext4 puts a lost+found directory in the root of all file system, postgres will not use that directory as its data-directory since it is initially not empty...
initdb: directory "/var/lib/postgresql/8.4/main" exists but is not empty
If you want to create a new database system, either remove or empty
the directory "/var/lib/postgresql/8.4/main" or run initdb
with an argument other than "/var/lib/postgresql/8.4/main".
The easiest way to proceed would be to remove the lost+found and recreate it after initdb has done its job. - could that cause any problems? Does the lost+found have any special attributes or anything that makes it impossible to recreate, and also, it is needed at any other time than if checkdisk finds something it needs to put there?
Another way would be to unmount the .../main/ file system, init the database, temporary mount the .../main/ filesystem somewhere else, move things over there and mount it in place. Seems to be a bit more work than the "easiest way".
Or is it some way to make initdb ignore that the directory is not empty? (couldn't see any command line switches for that)
May a lost+found directory within postgres main directory cause any problems?
At the moment I am running the system on a virtual machine for testing, so it really doesn't matter if I mess up things, but before making this an official way of installing a mission-critical system, it would be nice to have some thoughts on this.
lost+found has preallocated blocks that make it easier for fsck to move data into it when the partition is short of free blocks. To create it, better use the mklost+found command rather than mkdir.
If you don't recreate it, fsck will do it anyway when it's needed.
But if it comes to the point where fsck finds corruption within PGDATA, I'd think about going for a backup rather than counting on lost+found to retrieve anything.