error in installing my_sql on AWS EMR cluster - amazon-emr

I'm trying to start up MYSQL on my EMR cluster but it's showing as ERROR 1045 (2800): Access denied as shown in picture posted . Wat should i do ?ERROR
After executing these commands :
wget https://de-mysql-connector.s3.amazonaws.com/mysql-connector-java-8.0.25.tar.gz
tar -xvf mysql-connector-java-8.0.25.tar.gz
cd mysql-connector-java-8.0.25/
sudo cp mysql-connector-java-8.0.25.jar /usr/lib/sqoop/lib/
I tried setting password of database but it wasn't connecting to it .

it took my 3 days for getting how to install mysql on EMR
Install MySQL using the following command:
sudo yum install mysql-server -y
Start the MySQL service using the following command:
sudo service mysqld start
Set a root password for MySQL using the following command:
sudo mysqladmin -u root password yourpassword
Optionally, you can secure your MySQL installation by running the secure installation script using the following command:
sudo mysql_secure_installation
This script will prompt you to set the root password, remove anonymous users, disallow root login remotely, remove the test database, and reload the privilege tables.

Related

How do I resolve Invalid SSH Key Entry error when starting App with GCE

I'm trying to launch my app on Google Compute Engine, and I get the following error:
Sep 26 22:46:09 debian google_guest_agent[411]: ERROR non_windows_accounts.go:199 Invalid ssh key entry - unrecognized format: ssh-rsa AAAAB...
I'm having a hard time interpreting it. I have the following startup script:
# Talk to the metadata server to get the project id
PROJECTID=$(curl -s "http://metadata.google.internal/computeMetadata/v1/project/project-id" -H "Metadata-Flavor: Google")
REPOSITORY="github_sleepywakes_thunderroost"
# Install logging monitor. The monitor will automatically pick up logs sent to
# syslog.
curl -s "https://storage.googleapis.com/signals-agents/logging/google-fluentd-install.sh" | bash
service google-fluentd restart &
# Install dependencies from apt
apt-get update
apt-get install -yq ca-certificates git build-essential supervisor
# Install nodejs
mkdir /opt/nodejs
curl https://nodejs.org/dist/v16.15.0/node-v16.15.0-linux-x64.tar.gz | tar xvzf - -C /opt/nodejs --strip-components=1
ln -s /opt/nodejs/bin/node /usr/bin/node
ln -s /opt/nodejs/bin/npm /usr/bin/npm
# Get the application source code from the Google Cloud Repository.
# git requires $HOME and it's not set during the startup script.
export HOME=/root
git config --global credential.helper gcloud.sh
git clone https://source.developers.google.com/p/${PROJECTID}/r/${REPOSITORY} /opt/app/github_sleepywakes_thunderroost
# Install app dependencies
cd /opt/app/github_sleepywakes_thunderroost
npm install
# Create a nodeapp user. The application will run as this user.
useradd -m -d /home/nodeapp nodeapp
chown -R nodeapp:nodeapp /opt/app
# Configure supervisor to run the node app.
cat >/etc/supervisor/conf.d/node-app.conf << EOF
[program:nodeapp]
directory=/opt/app/github_sleepywakes_thunderroost
command=npm start
autostart=true
autorestart=true
user=nodeapp
environment=HOME="/home/nodeapp",USER="nodeapp",NODE_ENV="production"
stdout_logfile=syslog
stderr_logfile=syslog
EOF
supervisorctl reread
supervisorctl update
# Application should now be running under supervisor
My instance shows I have 2 public SSH keys. The second begins like this one in the error, but after about 12 characters it is different.
Any idea why this might be occurring?
Thanks in advance.
Once you deployed your VM instance, its a default setting that the SSH key isn't
configure yet, but you can also configure the SSH key upon deploying the VM instance.
To elaborate the answer of #JohnHanley, I tried to test in my environment.
Created a VM instance, verified the SSH configuration. As a default configuration there's no SSH key configured as I said earlier you can configure SSH key upon deploying the VM
Created a SSH key pair via CLI, you can use this link for instruction details
Navigate your VM instance, Turn off > EDIT > Security > Add Item > SSH key 1 - copy+paste generated SSH key pair > Save > Power ON VM instance
Then test the VM instance if accessible.
Documentation link How to Add SSH keys to project metadata.

Installing and upgrading help Data directory (/var/www/moodledata) cannot be created by the installer

I'm trying to deploy Moodle into Docker.
Here is the steps I followed:
First, create a new network for the application and the database:
$ docker network create moodle
Then, start a new database process in an isolated container:
$ docker run --name mysql --network moodle -e MYSQL_ROOT_PASSWORD=password -d mysql
Finally, you can run this moodle image and link it to your mysql container:
$ docker run --name my-moodle --network moodle --link mysql:database -p 8080:80 -d aesr/moodle
Access it via http://localhost:8080 or http://host-ip:8080 in a browser.
But while installing moodle I'm getting this error:
Data directory (/var/www/moodledata) cannot be created by the installer.
Maybe because of Apache doesn't have the proper permission. I'm running Docker on Windows.
My solutions worked on Centos 7.
Just move out the moodledata to somewhere else, like
mkdir /moodledata
chown -R apache:apache /moodledata
Because it calls the folder /var can be expose from internet and not accept to start the Installation

I would like to set up rfc5766-turn-server in Ubuntu 14.04, can anyone give me the set of steps listed all together ? I am doing it in AWS EC2

I have tried to install and set up rfc5766-turn-server in AWS EC2 but unable to do it as I do not see a proper flow of work or command line for that, can someone help me about this ? I need to set it up in Ubuntu 14.04
do an ssh login to your ec2 instance, then run the below commands for installing and starting the turn server.
commands for installing turnserver:
sudo apt-get update
sudo apt-get install make gcc libssl-dev libevent-dev wget -y # for installing modules required by turn server
mkdir ~/turn && cd ~/turn # creating temp directory
wget turnserver.open-sys.org/downloads/v3.2.5.9/turnserver-3.2.5.9.tar.gz # downloading the TURN source code
tar -zxvf *.gz # extract
cd turn*
make
sudo make install # installing the rfc5766
cd ../.. && rm -rf turn # cleaning up
command for starting the TURN server:
turnserver -a -o -v -n -u user:root -p 3478 -L INT_IP -r someRealm -X EXT_IP/INT_IP
assumptions:
your ip, internal ip = EXT_IP, INT_IP
desired port for listening: 3478
single credential username:password = user:root
realm: someRealm
in your WebRTC app, you can use trun server like:
{
url: 'turn:user#EXT_IP:3478',
credential: 'root'
}

gitLab update : curl returns ssl error 35

I am trying to update my gitLab installation from 7.7.2.
When I am running the following command nothing downloads.
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
And I get this error:
0* Unknown SSL protocol error in connection to packages.gitlab.com:443
0 0 0 0 0 0 0 0 --:--:-- 0:02:00 --:--:--
0
* Closing connection 0
curl: (35) Unknown SSL protocol error in connection to packages.gitlab.com:44
3
curl is unable to connect to packagecloud.io over TLS when running:
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/co
nfig_file.list?os=Ubuntu&dist=trusty&name=git.curuba2.fr&source=script
This is usually due to one of two things:
1.) Missing CA root certificates (make sure the ca-certificates package is i
nstalled)
2.) An old version of libssl. Try upgrading libssl on your system to a more
recent version
My ubuntu Trusty is up to date, I have ca-certificates installed and I also did update-ca-certificates.
No idea what's wrong. I need to migrate my server. I installed it properly on the new one but I fail updating the old one...
[EDIT]
I also tried with -k with no luck...
I ran into the same problem trying to install the runner via a non-https proxy.
I tried using -x [proxy] --insecure in the command but it still failed.
I decided to look at the script itself and realised the issue is with the curl calls inside the script.
I update the calls I could find in a local copy of script.deb.sh to include -x [proxy] --insecure then just executed that using sudo ./script.deb.sh and it worked.
That's more a wrkaround than an answer.
I finally downgraded my future server to 7.7.2, restored there my backup and upgraded back to 7.12.0.
Here are the commands I ran on the future server:
sudo gitlab-ctl stop unicorn
sudo gitlab-ctl stop sidekiq
wget https://downloads-packages.s3.amazonaws.com/ubuntu-14.04/gitlab_7.7.2-omnibus.5.4.2.ci-1_amd64.deb
sudo dpkg -r gitlab-ce
sudo dpkg -i git*.deb
sudo gitlab-ctl reconfigure
cd /var/opt/gitlab/backups/ # This is where backups should be located
sudo gitlab-rake gitlab:backup:restore BACKUP=1435537802
sudo gitlab-ctl start unicorn
sudo gitlab-ctl start sidekiq
sudo gitlab-ctl status
sudo apt-get update
sudo apt-get install gitlab-ce

Error in creation of postgresql from bash - Install & Import

I am trying to automate the install of debian with postgreSQL but I'm running into issues with my script. The database import of schema.sql into the db1 doesn't seem to be working, and I'm not sure if I even created the database correctly.
This is the code I am using:
# POSTGRES
apt-get install -y postgresql
echo "CREATE ROLE deploy LOGIN ENCRYPTED PASSWORD '$APP_DB_PASS';" | sudo -u postgres psql
su postgres -c "createdb db1 --owner deploy"
su postgres -c "createdb db2 --owner deploy"
service postgresql reload
# IMPORT SQL
psql --username=postgres spider < /etc/schema.sql
When I try to see if the database is created I get the following errors and the SQL import didn't seem to work.
root#li624-168:/etc/app# psql -U root spider
psql: FATAL: role "root" does not exist
root#li624-168:/etc//app# psql -U deploy spider
psql: FATAL: Peer authentication failed for user "deploy"
Can anyone tell me please where I have gone wrong?
Firstly, make sure you check result codes when executing commands. You can abort your bash script by adding set -e at the top. If any single command fails it will stop immediately.
Secondly, take another look at the error message:
Peer authentication failed for user "deploy"
You're trying to login as "deploy" and it seems to recognize the user-name. However, your operating-system user is not called "deploy", so peer auth fails. It looks like you want to login using a password, so set up your pg_hba.conf file to allow that.
Postgres databases are owned by Linux users. So, you need to create an user in postgres tha have the same name of your Linux user. then, you have to use the new user to create your db. Example:
My linux account is razcor
sudo su postgres -c 'createuser -d -E -R -S razcor'
this creates a postgres user
sudo su razcor -c "createdb db1 --owner razcor"
this creates my db
result:
razcor#ubuntu:~$ psql -U razcor db1
psql (8.4.17)
Type "help" for help.
db1=>
In your case create a user named: root
#Richard Huxton: yes, I agree.