I am new in elasticsearch. I have to set up wazuh with elasticsearch cluster. I did all the thing. I have also installed wazuh plugin on the Kibana . Once, I opened the app and clicked on the agent section It is saying =>
Error getting alerts from compliances
Your environment may not have any index with Wazuh's alerts
Please help me.
you could try to uninstall and install it again. Here you have the official uninstallation guide Uninstalling Wazuh with Elastic Stack, and after installing Elastic again with this guide Unattended installation
Remember if you want to preserve your configuration you can backup the files:
cp -p /var/ossec/etc/ossec.conf.orig /var/ossec_backup/etc/ossec.conf
cp -p /var/ossec/etc/local_internal_options.conf /var/ossec_backup /etc/local_internal_options.conf
cp -p /var/ossec/etc/ /var/ossec_backup/etc/client.keys
cp -p /var/ossec/queue/rids/ /var/ossec_backup/queue/rids/*
Here you have more information about that Migrating OSSEC agent
After that, you have to put the files in their original path again
Should containers be able to maintain state?
I am using a SQLServer Image like so.
docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=yourStrong(!)Password' -p 1433:1433 -d microsoft/mssql-server-linux:2017-latest
Then I create a database in it using dotnet ef.
dotnet ef database update -v
Database works fine until I restart the container. At which point my database is gona and the container is reset to it's initial state.
What am I missing? Do containers not persist state?
If so what's the point in using them for databases?
Yes they can if you don not delete the container so you can
docker stop xxx
or just simply restart your machine and than use
docker start xxx
or
docker restart xxx
if you use docker run you create a new container so there is no previous state to talk about. For sql server specifically there is an option to create a volume and store data there. If you do that you can delete a container and recreate it again without loosing data as its is no longer stored inside it.
I re-deployed my app to meteor by using 'meteor deploy '
and my Database was reset.
Any clue why this happened or how I can avoid it in the future ?
When a meteor app is deployed, your data saved in local mongo would not deployed to the server. So you could use mongodump and mongorestore to solve it:(docs)
Now first dump your database somewhere
mongodump --host localhost:3001
Get your mongodb`s credentials by running (in your app dir):
meteor mongo myapp.meteor.com --url
This will give you database url in the form:
mongodb://username:password#host:port/databasename
With these info you could fill them into mongorestore (docs) and restore your local database over
mongorestore -u username -p password -h host:port -d databasename ~/desktop/location_of_your_mongodb_dump
All of your data would get transferred in this way. I wish it could help.
I have a heroku database, d76mj7ltuqs.
I then have a local database, test_development.
The schema is the same on both of these databases - I want to pull all of the data from my production database and overwrite my local database, so that local is an exact replica of production at the time of pull.
How can I do that in Postgres?
Use heroku's "pg:pull":
You'll need to clear your local DB:
rake db:drop
Then collect some information from Heroku:
heroku pg:pull DATABASE_URL test_development
This will connect to the heroku DB, and copy it to the local database.
See Heroku's documentation on pg:pull for more details.
This command should do the work:
heroku pg:pull DATABASE_URL database-name --app heroku-app-name
clean your local database:
rake db:schema:load
dump your heroku database:
heroku pg:backups:capture -r <**your production git repo name**>
heroku pg:backups:download -r <**your production git repo name**>
load data in your local database
pg_restore --verbose --clean --no-acl --no-owner -h localhost -d <**test database name**> latest.dump
this is how i do it, be sure to gzip it as your database grows. also don't export the ACL as you likely don't have the same postgres user on heroku and local accounts. replace with your specific details.
pg_dump -h ec2-##-##-##-##.compute-1.amazonaws.com -p <port> -Fc --no-acl --no-owner -o -U <username> <databasename> | gzip > dumpfile.gz
#<Prompt for Password>
gunzip -c dumpfile.gz | pg_restore --verbose --clean --no-acl --no-owner -d test_development -U <local_username>
Use your terminal to make a local pg_dump and then either psql or pg_restore it into your local database.
Similar method can be found here.
If this is a Rails app, you can use the following script to overwrite your local database with the latest dump you've generated on Heroku. If you uncomment the line with heroku pg:backups capture, the script will generate a new snapshot on Heroku before downloading it to your machine.
Note that you shouldn't have to edit the script, since it reads all the configuration from your database.yml file.
#!/usr/bin/env ruby
require_relative '../config/environment'
# Uncomment the line below if you want to generate a new snapshot of the
# Heroku production database before downloading it to the local machine
# `heroku pg:backups capture`
database_dump_file_pathname = Tempfile.new('latest.dump').path
`heroku pg:backups:download --output #{database_dump_file_pathname}`
# Get database config fom database.yml file
database_config = YAML::load_file(Rails.root.join('config', 'database.yml'))
database_name = database_config['development']['database']
database_username = database_config['development']['username']
database_password = database_config['development']['password']
# Overwrite local database with dump
cmd_line_arguments = [
'--verbose',
'--clean',
'--no-acl',
'--no-owner',
'--host localhost',
"-U #{database_username}",
"-d #{database_name}",
database_dump_file_pathname
].join(' ')
`PGPASSWORD=#{database_password} pg_restore #{cmd_line_arguments}`
See the Heroku docs on downloading DB backups for details.
I'm trying to push my local database to Heroku using the following command:
heroku pg:push <local db name> DATABASE --app <heroku appname>
and I get:
env: psql: No such file or directory ! Remote database is not
empty. ! Please create a new database, or use heroku pg:reset
So I run heroku pg:reset which resets it but I then get the following when trying to push again therefore going around in circles:
env: psql: No such file or directory ! Remote database is not
empty. ! Please create a new database, or use heroku pg:reset
Any ideas on how to solve this?