Sphinx 3.0.3 searchd don't see my config - sphinx

I try ver 3.0.3 (ver 3.0.2 works).
The searchd cannot see sphinx.conf .
#indexer --all --config sphinxdata/sphinx.conf
creates indexes how it said in config:
path = /home/user/sphinx-3.0.3/sphinxdata/indexes/test1
Ok. But:
# bin/searchd
no config file, using 'sphinxdata' folder.
Also tried:
#/home/user/sphinx-3.0.3/bin/searchd --config /home/user/sphinx-3.0.3/sphinxdata/sphinx.conf
No config file, using 'sphinxdata' folder.
Both sphinxdata and config file 'sphinxdata/spinx.conf' exists. Using 'sphinxdata' folder.
I use Ubuntu16 and Sрhinx 3.0.3 binary.

Right answer (from author Sphinx): Remove the folder sphinxdata!

v3, drasticially changed how it 'looks' for the sphinx.conf file, it no longer varies by distribution for example.
In general would say best to use absolute paths...
/usr/bin/searchd --config /etc/sphinx.conf

./searchd --stop
while you are in /bin folder
then
DELETE SPHINXDATA FOLDER first thing.
You have to create /usr/local/sphinx/var/data and /usr/local/sphinx/var/log folders on sphinx 3 and not start searchd before indexes created with indexer --all setting.
Once all indexes are created - searchd can be started otherwise it will continue saying:
The searchd cannot see sphinx.conf .
no config file, using 'sphinxdata' folder.
No config file, using 'sphinxdata' folder.
Both sphinxdata and config file 'sphinxdata/spinx.conf' exists. Using 'sphinxdata' folder.
And another difference from old Sphinx is - you have to start and to stop it by providing config file path, not only for indexing. If you do not provide - it creates sphinxdata folder and you have to stop it without config then, delete that sphinxdata folder and start correctly to avoid incorrect setup.
RUN such for start/stop:
./searchd --config /usr/local/sphinx/etc/sphinx.conf
./searchd --stop --config /usr/local/sphinx/etc/sphinx.conf
The same with indexer - provide a full path to config!

Related

docker-compose cannot find the yaml file

I've placed a docker compose file project.yaml at the location /etc/project/project.yaml
the file and well as the project directory have the same file permission, i.e. -rxwrxxrwx
but when I run docker-compose
sudo docker-compose -f ./project.yaml up -d
if errors out with the following
Cannot find the file ./project.yaml
I have checked various times and it seems there is no permission issue. Can anyone tell why we have this problem and what would be the solution
Beside using the full path, as commented by quoc9x, double-check your current working directory when you call a command with a relative path ./project.yaml
If you are not in the right folder, that would explain the error message.

Postgres initdb: How to set logging_collector=on in the generated postgressql.conf file

The default postgresql.conf file created using initdb contains the following line
#logging_collector = off # Enable capturing of stderr and csvlog
Is there anyway to force initdb itself to generate a file with
logging_collector = on
rather than set options on pg-ctl or edit the generated file.
I keep all the changes in a separate file named custom.conf
Then after initdb ran, I copy the file to the data directory and append an include directive to postgresql.conf:
cp /path/to/dir/custom.conf $PGDATA
echo include = 'custom.conf' >> $PGDATA/postgresql.conf
These steps are easily scriptable, so no manual intervention required.
Alternatively you can skip the copy step and include the config file directly from the central directory. Or you could use include_dir to include the whole directory where your custom config file is stored.
This has the added benefit (in my opinion) that I have all customizations in a single file. I don't need to go through postgresql.conf to find settings that are changed from the default.
No, there is no way to do it like that.
But you can modify the file postgresql.conf.sample in the “share” directory of the PostgreSQL installation, which is used as the blueprint for postgresql.conf during initdb.

Run supervisord with custom configuration file from startup

I'm using this article as a source to get me half way there, but I cannot figure out how to run supervisor with a custom config file path.
When I want to run supervisor manually, I just do:
supervisord -c /home/test/_app/supervisord.conf
When I implemented the auto start up script, it runs the default supervisor config file which is located in /etc/ directory. I don't want to use that one because it separates it from the core project folder and makes it hard to maintain and keep track of.
Try this:
In /etc/rc.d/init.d/supervisord, add prog_opts variable like this:
prog_opts=" -c /home/test/_app/supervisord.conf"
prog_bin="${exec_prefix}/bin/supervisord"
Then in start() function, change the call to:
daemon $prog_bin --pidfile $PIDFILE -- $prog_opts
I was able to fix this issue by simply deleting the default supervisord.conf file and then making a sym link with that default location and my custom conf file path.

bash: mongodb/bin/mongod : No such file or directory

I'm trying to install and run some basic commands on mongodb from this tutorial (on page 4).
So far,
I've downloaded the a 32-bit zip file from the mongodb download page.
I've unzip the file in the following locations home/user1 then renamed it to mongodb
I've create a folder called data then another one inside called db
I've created a file name mongodb.config containing the path of the folder where I want to store my data, which is mongodb/data/db.
But when I run the command to start the server:
user1#user1-VirtualBox: ~$ mongodb/bin/mongod --dbpath ~mongodb/data/db
I'm getting the following error:
bash: mongodb/bin/mongod : No such file or directory
Am I missing something?
Missing a '/', it should be ~/mongodb/data/db, not '~mongodb/data/db'

Capistrano - How to put files in the shared folder?

I am new to Capistranoand I saw there is shared folder and also option :linked_files. I think shared folder is used to keep files between releases. But my question is, how do files end up being in the shared folder?
Also, if I want to symlink another directory to the current directory e.g. static folder at some path, how do I put it at the linked_dirs ?
Lastly how to set chmod 755 to linked_files and linked_dirs.
Thank you.
Folders inside your app are symlinks to folders in the shared directory. If your app writes to log/production.log, it will actually write to ../shared/log/production.log. That's how the files end up being in the shared folder.
You can see how this works by looking at the feature specs or tests in Capistrano.
If you want to chmod these shared files, you can just do it once directly over ssh since they won't ever be modified by Capistrano after they've been created.
To add a linked directory, in your deploy.rb:
set :linked_dirs, %w{bin log tmp/backup tmp/pids tmp/cache tmp/sockets vendor/bundle}
or
set :linked_dirs, fetch(:linked_dirs) + %w{public/system}
Capistrano 3.5+
Capistrano 3.5 introduced append for array fields. From the official docs, you should use these:
For Shared Files:
append :linked_files, %w{config/database.yml}
For Shared Directories:
append :linked_dirs, %w{bin log public/uploads vendor/bundle}
I've written a task for Capistrano 3 to upload your config files to the shared folder of each of your servers, it'll check these directories in order:
config/deploy/config/:stage/*.yml
config/deploy/config/*.yml
And upload all config files found. It'll only upload the files if they've changed. Note also that if you have the same file on both directories then the second one will be ignored.
Here's the code: https://gist.github.com/Jesus/448d618c83fb0445ebbf
One last thing, this task is just uploading the config. files to your remote shared folder, you still need to set linked_files in config/deploy.rb, eg:
set :linked_files, %w{config/database.yml config/aws.yml}
UPDATE:
If you're using Git, you'll probably want to ignore these files:
echo "config/deploy/config/*" >> .gitignore
There are 3 simple steps you can follow to put a file that you don't want to change in consecutive releases; add your file to linked_files list.
set :linked_files, fetch(:linked_files, []).push('config.php')
Select all the files that you want to share. Put this file from your local to remote server through scp
scp config.php deployer#amazon:~/capistrano/shared/config.php
Now, deploy through the command given below:
bundle exec cap staging deploy
of course, staging can be changed as per requirements may be production,sandbox etc.
One more thing, because you don't want your team members to commit such files. So, put this file to your .gitignore file. And push it to git remote repo.
For Capistrano 3.5+, as specified in official doc :
append :linked_dirs, ".bundle", "tmp"
For me non of the above worked so I ended up adding two functions to the end of the deployment process:
namespace :your_company do
desc "remove index.php"
task :rm_files do
on roles(:all) do
execute "rm -rf #{release_path}/index.php"
end
end
end
namespace :your_company do
desc "add symlink to index.php"
task :add_files do
on roles(:all) do
execute "ln -sf #{shared_path }/index.php #{release_path}/index.php"
end
end
end
after "deploy:finished", "your_company:rm_files"
after "deploy:finished", "your_company:add_files"