Blog
Creating a simple sftp in OL8 using the free resources of OCI.
Category: Cloud Author: César Carvalho Date: 5 years ago Comments: 0

Creating a simple sftp in OL8 using the free resources of OCI.

  1. 1. Provisioning Compute service.
For those who are not used to OCI, here is a description of what Compute Instances is.
The Compute service helps you provision VMs and bare metal instances to meet your compute and application requirements. An instance is a compute host. Choose between virtual machines (VMs) and bare metal instances. The image that you use to launch an instance determines its operating system and other software.
All the resources used are free, a VM with 1 OCP and 1GB of ram memory, with two 50GB block volume.
1.1 Enter the name of your instance and change the version of Oracle linux that we will use to OL8.
1.2 For those who are used to working and studying using OCI, we know that linux environments are accessed using a private key and not by user and password. In this way, download the private key and publish what the OCI will generate so that you can have access to the OL8 environment, then go to the create option.
1.3 Wait until the instance is provisioned and created.
1.4 Instance created and available for use, on the right side we have the public access ip and the user that we will use together with the private key.
2. We will add two 50gb block storage that OCI makes available for free, we will provision these two disks and we will use LVM to compose 100gb dedicated for our sftp files. Block volumes provide high-performance network storage to support a broad range of I/O intensive workloads.
2.1 Creating two free 50gb block volumes.
2.2 We will name it vol1, we will use Block Volume in the same Availability Domain as our instance with Oracle Linux 8, then we will go to the custom option to use the maximum performance of the volume allowed with the higther performance option.
2.3 Waiting for the provisioning and creation of the Block volume.
3. Adding the block volumes vol1 and vol2 in the instance Oracle Linux 8 sftp. Click on vol1, then attached instances.
3.1 We will add the vol1 and vol2 in instance, then we will choose the type of access and device path.
3.2 Provisioning and Attaching block volumes vol1 and vol2
4. Accessing the OL8 laboratory1 instance with a private key, in this example I am using the Mobaxterm tool.
4.1 Adding block volumes vol1 and vol2 on Oracle Linux 8 iSCSI.
Run the commands copied from the iSCSI Commands tab.
5 Adding block volumes vol1 and vol2 on Oracle Linux 8 with LVM.
5.1 Creating Physical Volumes
5.2 List physical volumes created PVS.
5.3 Create volume group with size of 100gb, adding the two block volumes vol1 and vol2.
5.4 Create logical volume with 100gb for use.
5.5 Formatting volume created from LVM volsftp in xfs.
5.6 Configuring fstab to automatically mount the volume created in the LVM.
5.7 Mounting the LVM volume.
6. Installing the SFTP service on Oracle Linux 8.
6.1 Configuring SFTP.
6.2 Creating the cesar user that we will use to access sftp.
6.3 Adding the user cesar to have access to sftp.
6.4 As at OCI we access linux environments with a private key, we will have to adjust it so that the user can access by password and not by private key.
6.5 Enabling and starting the sftp service.
6.6 For security change the user password opc.
6.7 Testing access using wiscp with sftp on the public ip of the instance.
 
César Carvalho – DBA
Contact: https://twitter.com/Cesar_DBA
https://sgbdbrasil.wordpress.com/

Celebrate 25 years of Java !!!!
Category: Middleware Author: Andre Luiz Dutra Ontalba (Board Member) Date: 5 years ago Comments: 0
Celebrate the Java 25th Anniversary – Free training and get Java Certified for $25
Trust everything is going well.
 
Celebrate 25 years of Java, starting from Feb 25th, you can get FREE access to the latest Java training and earn the most current Java Developer certification – Oracle Certified Professional: Java SE 11 Developer for $25.
 
Activate your free Java 25th anniversary learning subscription now and purchase your exam through the subscription until April 25, 2021.
 
Start your journey and earn a limited edition badge here, click here.

 

 

LuxOUG

Mounting an Oracle Cloud Object Storage Bucket as a File System on Linux
Category: Cloud Author: Andre Luiz Dutra Ontalba (Board Member) Date: 5 years ago Comments: 0

Mounting an Oracle Cloud Object Storage Bucket as a File System on Linux

Today I bring a very cool article of a need that arose to present an Object Storage on Linux to perform a backup.
You can use it to backup your database, upload files, and more
 
Prerequisites:
Ensure that bucket you’re trying to mount is in the compartment listed for S3 compatibility; by default, it’s a root compartment of the tenancy.
If you need to change that, settings are located under Administration->Tenancy Details->Edit Object Storage Setting.

 

Create an Object Storage Bucket from the OCI Console.

Click in Object Storage
Enter a name for the bucket and click on Create Bucket.
Install s3fs-fuse
You can install s3fs-fuse by using a prebuilt package from the Oracle Linux EPEL repository. In this post, I’m using the binary RPM.
Configure Credentials
 
In the Oracle Cloud Infrastructure Console, click the Profile icon in the top-right corner, and select User Settings.
 
Click Customer Secret Keys, and then click Generate Secret Key.
 
Give the key a meaningful name (for example, bk_orap2g), and then click Generate Secret Key
 
Copy and save the secret key because it won’t be shown again.
 
The S3 credentials are created by using an access key and the secret key. The access key is displayed in the Customer Secret Keys area of the Console.
Generate Secret Key: bk_orap2g
Generated Key: xxxxxxxxxxxxN5ujFRYICdG5RQbiuyxi07+PWrLdE=
Access key: cc3e970b898676154xxxxxxxxxxxxxxxxxxxxxxxx
Create the directory and assign ownership

 

# mkdir /home/oracle/bkp_db
# chown oracle:oinstall /home/oracle/bkp_db
Mount the File System

 

$ s3fs bucket2fs /home/oracle/bkp_db -o passwd_file==${HOME}/.password-bk -o url=https://mynamespace.compat.objectstorage..oraclecloud.com/ -o nomultipart -o use_path_request_style
Add an entry in the /etc/fstab file.
#s3fs
bk_orap2g /home/oracle/bkp_db fuse.s3fs _netdev,allow_other,nomultipart,use_path_request_style,passwd_file=/home/oracle/.passwd-bk,url=https://mynamespace.bej2.objectstorage.eu-frankfurt-1.oraclecloud.com/ 0 0
If you get the following error, change the permission of /usr/bin/fusermount:
fuse: failed to exec fusermount: Permission denied
[oracle@ora2pg ~]$ ls -l /usr/bin/fusermount
-rwsr-x---. 1 root fuse 32584 Fev 25 2021 /usr/bin/fusermount
Run the following command, and then try again:
[oracle@ora2pg ~]# sudo chmod +x /usr/bin/fusermount

[oracle@ora2pg ~]$ ls -l /usr/bin/fusermount
-rwsr-x–x. 1 root fuse 32584 Fev 25 2021 /usr/bin/fusermount

If there’s an issue, add the Debug parameter to help troubleshoot:
[oracle@ora2pg ~]$ s3fs bucket-1 /test_bucket -o passwd_file=${HOME}/.passwd-s3fs -o dbglevel=info -f -o curldbg=
 
I hope this helps you!!!

 

Stay tuned, following on twitter @aontalba and on Linkedin

 

Andre Luiz Dutra Ontalba

 

Disclaimer: “The postings on this site are my own and don’t necessarily represent my actual employer positions, strategies or opinions. The information here was edited to be useful for general purposes. Specific data and identifications were removed to allow reach generic audience and be useful.”

 


Adding OCI target manually using SSH Private Key in Enterprise Manager Cloud Control 13c
Category: Middleware Author: César Carvalho Date: 5 years ago Comments: 1

Adding OCI target manually using SSH Private Key in Enterprise Manager Cloud Control 13c

Guys, today’s tip is about how to add an OCI target manually in Enterprise Manager Cloud Control 13c using private key ssh.
This week I was implementing Enterprise Manager Cloud Control 13c using machines on Oracle Cloud Infrastructure (OCI), as access to Oracle 11g bank server was done only using a private key, I needed to add this server to be monitored on Cloud Control 13c using ssh private key, I researched a lot and broke my head to add an OCI host, so I decided to post to help other people, below are the steps:
Manually adding the Oracle database server to be monitored in Enterprise Manager Cloud Control 13c.
 
Guys today’s tip is about how to add an OCI target manually in Enterprise Manager Cloud Control 13c using private key ssh.
This week I was implementing Enterprise Manager Cloud Control 13c using machines on Oracle Cloud Infrastructure (OCI), as access to Oracle 11g bank server was done only using private key, I had the need to add this server to be monitored on Cloud Control 13c using ssh private key, I researched a lot and broke my head to add an OCI host, so I decided to post to help other people, below are the steps:
Manually adding the Oracle database server to be monitored in Enterprise Manager Cloud Control 13c
Adding the Oracle 11g Linux platform host
Create the directory in oracle home with oracle user to install the Agent on the server that we will monitor Oracle database 11g.
mkdir -p /u02/app/oracle/product/11.2.0/agentem13c
 
Add the base agent directory to deploy to Enterprise Manager Cloud Control 13c
Discovering the private key to be added from the default user opc in the OCI to add in Enterprise Manager Cloud Control 13c.
cat /home/opc/.ssh/id_rsa
Just copy all the text with the private key.
Fill in the UserName field with the opc user and paste the private key in the SSH Private Key field, then change the run privilege field to sudo and run as for the oracle user.
Okay, just go ok and follow the next steps that the deployment to the target with Oracle database 11g will finish and be successfully added to the Enterprise Manager Cloud Control 13c.

 

 

César Carvalho – DBA
Contact: https://twitter.com/Cesar_DBA
https://sgbdbrasil.wordpress.com/

1 2 3 4 5 6 32