Skip to content

Software Development News: .NET, Java, PHP, Ruby, Agile, Databases, SOA, JavaScript, Open Source

Methods & Tools

Subscribe to Methods & Tools
if you are not afraid to read more than one page to be a smarter software developer, software tester or project manager!

Feed aggregator

Embedded Testing 2017

Intland Blog - Tue, 06/20/2017 - 11:01
Date: 20-22 June 2017 Location: Munich, Germany For the third time in 2017, Embedded Testing will take place in Munich between 20-22 June. The conference focuses exclusively on the embedded environment, with topics covering unit testing, static code analysis, black and white box testing, code coverage analysis, regression testing, integration testing, standards and liability risks,…
Categories: Vendor

Automotive Testing Expo Europe 2017

Intland Blog - Tue, 06/20/2017 - 11:00
Date: 20-22 June 2017 Location: Messe Stuttgart, Germany Intland Software’s booth number: 1048 2017 marks the 19th edition of the prestigious Automotive Testing Expo Europe event. With over 330 exhibiting companies congregating in Stuttgart, the automotive capital of Europe between 20-22 June, this expo is a major event for developers, suppliers, and other players in…
Categories: Vendor

MedConf Nord 2017

Intland Blog - Mon, 06/12/2017 - 11:00
Date: 12-14 June 2017 Location: Hamburg, Germany MedConf Nord takes place from 12 to 14 June in Hamburg, Germany for the first time in 2017. As the sister event of MedConf SĂĽd, a successful series of events for the past 10 years, MedConf Nord focuses on the topic of software and device development as well…
Categories: Vendor

CollabNet “Bronze Sponsor” of @CloudExpo | @CollabNet #AI #DX #DevOps

Java Developer's Journal - 2 hours 56 min ago
SYS-CON Events announced today that CollabNet, a global leader in enterprise software development, release automation and DevOps solutions, will be a Bronze Sponsor of SYS-CON's 20th International Cloud Expo®, taking place from June 6-8, 2017, at the Javits Center in New York City, NY. CollabNet offers a broad range of solutions with the mission of helping modern organizations deliver quality software at speed. The company’s latest innovation, the DevOps Lifecycle Manager (DLM), supports Value Stream Mapping for the development and operations tool chain by offering DevOps Tool Chain Integration and Traceability; DevOps Tool Chain Orchestration; and DevOps Insight and Intelligence. CollabNet also offers traditional application lifecycle management, ALM, for the enterprise through its TeamForge product.

read more

Categories: Java, Media

Announcing @Peak_Ten to Exhibit at @CloudExpo | #DataCenter #AI #Storage

Java Developer's Journal - 5 hours 41 min ago
SYS-CON Events announced today that Peak 10, Inc., a national IT infrastructure and cloud services provider, will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Peak 10 provides reliable, tailored data center and network services, cloud and managed services. Its solutions are designed to scale and adapt to customers’ changing business needs, enabling them to lower costs, improve performance and focus internal resources on core competencies.

read more

Categories: Java, Media

[session] Enterprise Cloud Adoption | @CloudExpo @DivvyCloud #AI #DevOps

This talk centers around how to automate best practices in a multi-/hybrid-cloud world based on our work with customers like GE, Discovery Communications and Fannie Mae. Today’s enterprises are reaping the benefits of cloud computing, but also discovering many risks and challenges. In the age of DevOps and the decentralization of IT, it’s easy to over-provision resources, forget that instances are running, or unintentionally expose vulnerabilities.

read more

Categories: Media, RIA

[session] Real-World Hybrid IT | @CloudExpo @Peak_Ten #DataCenter #AI #DX

Everywhere we turn in our industry we can find strong opinions about the direction, type and nature of cloud’s impact on computing and business. Another word that is used in every context in our industry is “hybrid.” In his session at 20th Cloud Expo, Alvaro Gonzalez, Director of Technical, Partner and Field Marketing at Peak 10, will use a combination of a few conceptual props and some research recently commissioned by Peak 10 to offer a real-world consideration of how the various categories of cloud can be relevant to your business.

read more

Categories: Media, RIA

Silicon Valley CFP | @CloudExpo #DevOps #Serverless #FinTech #IoT #AI #DX

Java Developer's Journal - 9 hours 41 min ago
The 21st International Cloud Expo has announced that its Call for Papers is open. Cloud Expo, to be held October 31 - November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA, brings together Cloud Computing, Big Data, Internet of Things, DevOps, Digital Transformation, Machine Learning and WebRTC to one location. With cloud computing driving a higher percentage of enterprise IT budgets every year, it becomes increasingly important to plant your flag in this fast-expanding business opportunity. Submit your speaking proposal today!

read more

Categories: Java, Media

The #IoT: How to Handle All This Data | @ThingsExpo #BigData #IIoT #M2M

Java Developer's Journal - 10 hours 26 min ago
Multiple data types are pouring into IoT deployments. Data is coming in small packages as well as enormous files and data streams of many sizes. Widespread use of mobile devices adds to the total. In this power panel at @ThingsExpo, moderated by Conference Chair Roger Strukhoff, panelists will look at the tools and environments that are being put to use in IoT deployments, as well as the team skills a modern enterprise IT shop needs to keep things running, get a handle on all this data, and deliver the analytics that add value.

read more

Categories: Java, Media

Top 10 Tips on How to Avoid Damage From Insider Threats

eWeek - Application Development - 11 hours 14 min ago
For many organizations the threat of data breaches and data thefts caused by insiders is an even bigger worry than cyber-attacks by outsiders. Here are the steps IT managers should take to prevent data losses caused by insiders.
Categories: Media

Microsoft Updates Surface Pro With Powerful CPUs, Long Battery Life

eWeek - Application Development - 12 hours 46 min ago
The new Surface Pro hybrid tablet/laptop is support to replace the aging Surface Pro 4. But most of the enhancements are hidden away inside the device.
Categories: Media

Red Hat Enterprise Linux 7.4 Set to Improve Security Features

eWeek - Application Development - 13 hours 50 min ago
Beta release of Red Hat's flagship Linux platform adds support for Network Bound Disk Encryption and the USBGuard software framework, providing improved security.
Categories: Media

MariaDB TX 2.0 Released

MariaDB Corporation, the company behind the fastest growing open source database, has announced the availability of MariaDB TX 2.0, the most feature complete, open source transactional database solution for modern application development. Busines ...
Categories: Vendor

Cylance Expands Cyber-Security Platform with Optics for Threat Hunting

eWeek - Application Development - 15 hours 34 min ago
Cylance expands its security platform with new threat hunting technology that provides visibility into endpoint risks.
Categories: Media

AdaCoreÂ’s GNAT Pro Supports Wind RiverÂ’s FACE Conformant VxWorks 653 Platform

Software Development Tools Directory - 15 hours 55 min ago
AdaCore has announced the continuing growth of its Future Airborne Capability Environment (FACE™) support, through both the current availability of its GNAT Pro 17.1 Ada Development Environment for the Wind River® FACE Certified VxWorks ...
Categories: Vendor

Using Docker to develop with Couchbase

NorthScale Blog - 16 hours 24 min ago

Rafael Ugolini is a full stack software developer currently based in Brussels, Belgium. He has been working with software development for more than 10 years and is lately focused on designing web solutions and developing using Python and JavaScript. Rafael Ugolini is Senior Software Developer at Famoco.

FullSizeRender Introduction

Docker is a great project that is helping developers around the world run applications in containers. This not only helps shipping software faster, but it also results with the famous “it works in my machine” phrase. In this article I will explain how to create a modular Couchbase image that doesn’t require any Web UI interaction to have a ready-to-go database for you.

All the code is available online here.

Dockerfile

The first step is to create the Dockerfile.

Couchbase Version

FROM couchbase/server:enterprise-4.6.1

This example is based on Couchbase Server Enterprise 4.6.1, but you can feel free to change to the specific version you are running in your environment.

Memory Configuration

ENV MEMORY_QUOTA 256
ENV INDEX_MEMORY_QUOTA 256
ENV FTS_MEMORY_QUOTA 256

All the values here are in MB:

– MEMORY_QUOTA: per node data service ram quota

– INDEX_MEMORY_QUOTA: per node index service ram quota

– FTS_MEMORY_QUOTA: per node index service ram quota

Services

ENV SERVICES "kv,n1ql,index,fts"

These are the services that will be available for the node created:

– kv: Data

– n1ql: Query

– index: Index

– fts: Full-Text Search

Credentials

ENV USERNAME "Administrator"
ENV PASSWORD "password"

Username and password to be used in Couchbase Server.

Cluster Options

ENV CLUSTER_HOST ""
ENV CLUSTER_REBALANCE ""

These options are only used if you want to add more than one node in the cluster.

– CLUSTER_HOST: hostname of the cluster for this node to join

– CLUSTER_REBALANCE: set “true” if you want the cluster to rebalance after the node is joined

Entrypoint

COPY entrypoint.sh /config-entrypoint.sh

ENTRYPOINT ["/config-entrypoint.sh"]

The Couchbase Server image already ships with an entrypoint.sh script and we don’t want to override it. The trick here is to copy our version of entrypoint.sh to /config-entrypoint.sh, run Couchbase Server entrypoint.sh in the background, and after configuring the node attach the script back to the original ENTRYPOINT.

Entrypoint

The ENTRYPOINT is used in combination with the original script from the Couchbase Server image. Let’s go line by line to understand how it works.

Initialize Couchbase Server

# Monitor mode (used to attach into couchbase entrypoint)
set -m
# Send it to background
/entrypoint.sh couchbase-server &

First we use set -m to enable job control, process running in background (like the original ENTRYPOINT) run in a separate process group. This option is turned off by default in non-interactive mode, like scripts.

Util Functions

# Check if couchbase server is up
check_db() {
 curl --silent http://127.0.0.1:8091/pools > /dev/null
 echo $?
}

This function is used to check when Couchbase Server starts answering HTTP calls.

# Variable used in echo
i=1
# Echo with
numbered_echo() {
echo "[$i] $@"
i=`expr $i + 1`
}

This is just a util function, add a number before any echo in the script to count the steps taken automatically.

# Parse JSON and get nodes from the cluster
read_nodes() {
cmd="import sys,json;"
cmd="${cmd} print(','.join([node['otpNode']"
cmd="${cmd} for node in json.load(sys.stdin)['nodes']"
cmd="${cmd} ]))"
python -c "${cmd}"
}

In order to parse the output of the nodes in Couchbase Server API, I’m using a function which runs ython to read STDIN, transform it to JSON and the Couchbase nodes. This is used for rebalancing.

Configure the Node

# Wait until it's ready
until [[ $(check_db) = 0 ]]; do
>&2 numbered_echo "Waiting for Couchbase Server to be available"
sleep 1
done

echo "# Couchbase Server Online"
echo "# Starting setup process"

The first step is to wait until the server is ready, then using the function numbered_echo you can see how long it took for Couchbase Server to have the API calls available.

HOSTNAME=`hostname -f`

# Reset steps
i=1

Then we set a variable HOSTNAME to be used in all the API calls we do and we also reset the counter from numbered_echo by setting it to 1.

numbered_echo "Initialize the node"
curl --silent "http://${HOSTNAME}:8091/nodes/self/controller/settings" \
-d path="/opt/couchbase/var/lib/couchbase/data" \
-d index_path="/opt/couchbase/var/lib/couchbase/data"

numbered_echo "Setting hostname"
curl --silent "http://${HOSTNAME}:8091/node/controller/rename" \
-d hostname=${HOSTNAME}

 

First thing to do is to set up disk storage configuration and then we set the hostname.

Joining a Cluster

if [[ ${CLUSTER_HOST} ]];then
numbered_echo "Joining cluster ${CLUSTER_HOST}"
curl --silent -u ${USERNAME}:${PASSWORD} \
"http://${CLUSTER_HOST}:8091/controller/addNode" \
-d hostname="${HOSTNAME}" \
-d user="${USERNAME}" \
-d password="${PASSWORD}" \
-d services="${SERVICES}" > /dev/null

If CLUSTER_HOST is set, the script will try to add the current container to the cluster.

if [[ ${CLUSTER_REBALANCE} ]]; then
# "Unexpected server error without the sleep 2
sleep 2
numbered_echo "Retrieving nodes"
known_nodes=$(
curl --silent -u ${USERNAME}:${PASSWORD} http://${CLUSTER_HOST}:8091/pools/default | read_nodes
)

numbered_echo "Rebalancing cluster"
curl -u ${USERNAME}:${PASSWORD} \
"http://${CLUSTER_HOST}:8091/controller/rebalance" \
-d knownNodes="${known_nodes}"
fi

else

After adding the node into the cluster, the script can also check for the variable CLUSTER_REBALANCE to see if it needs to rebalance the cluster automatically. This is where we use the Python function to read the nodes from /pools/default endpoint.

Not joining a cluster

numbered_echo "Setting up memory"
curl --silent "http://${HOSTNAME}:8091/pools/default" \
-d memoryQuota=${MEMORY_QUOTA} \
-d indexMemoryQuota=${INDEX_MEMORY_QUOTA} \
-d ftsMemoryQuota=${FTS_MEMORY_QUOTA}

Memory settings for the services.

numbered_echo "Setting up services"
curl --silent "http://${HOSTNAME}:8091/node/controller/setupServices" \
-d services="${SERVICES}"

Services to be used by the node.

numbered_echo "Setting up user credentials"
curl --silent "http://${HOSTNAME}:8091/settings/web" \
-d port=8091 \
-d username=${USERNAME} \
-d password=${PASSWORD} > /dev/null

fi

Set up the credentials for the node.

Finalize

# Attach to couchbase entrypoint
numbered_echo "Attaching to couchbase-server entrypoint"
fg 1

To end the script, we attach it to the original ENTRYPOINT.

Example

To demonstrate how to use it, I will be using the image registered in Docker Hub with the code here.

Single node

 

docker run -ti --name couchbase-server-nosetup \
-h node1.cluster \
-p 8091-8093:8091-8093 \
-p 11210:11210 \
-p 4369:4369 \
-p 21100-21299:21100-21299 \
rugolini/couchbase-server-nosetup

This runs a single node using the minimum required memory and the default credentials (Administrator/password) registered in the image. All the network ports Couchbase Server uses are exposed as well.

docker run -ti --name couchbase-server-nosetup \
-h node1.cluster \
-p 8091-8093:8091-8093 \
-p 11210:11210 \
-p 4369:4369 \
-e MEMORY_QUOTA=512 \
-e INDEX_MEMORY_QUOTA=512 \
-e FTS_MEMORY_QUOTA=512 \
-e USERNAME=admin \
-e PASSWORD=adminadmin \
-p 21100-21299:21100-21299 \
rugolini/couchbase-server-nosetup

The command above plays a little with the environment variables available in the Dockerfile.

Cluster

In this example, we will connect 3 nodes in the cluster.

docker network create couchbase

 

We must first create a network Couchbase where we will connect all nodes.

docker run -ti --name node1.cluster \
-p 8091-8093:8091-8093 \
-p 11210:11210 \
-p 4369:4369 \
-p 21100-21299:21100-21299 \
-h node1.cluster \
--network=couchbase \
rugolini/couchbase-server-nosetup

Then we create the first node.

docker run -ti --name node2.cluster \
--network=couchbase \
-h node2.cluster \
-e CLUSTER_HOST=node1.cluster \
-e CLUSTER_REBALANCE=true \
rugolini/couchbase-server-nosetup

 

Since all the network ports are exposed in the first node, it’s not necessary to expose them here.

Attention to the detail that CLUSTER_HOST is set to node1.cluster which is the hostname of the first node and CLUSTER_REBALANCE is also set to true. Once the node is added to the cluster, it will rebalance automatically.

docker run -ti --name node3.cluster \
--network=couchbase \
-h node3.cluster \
-e CLUSTER_HOST=node1.cluster \
rugolini/couchbase-server-nosetup

 

The node3 is also added to the cluster, but since CLUSTER_REBALANCE wasn’t set, it will require manual rebalance of the cluster for it to become available.

 

This post is part of the Couchbase Community Writing Program

The post Using Docker to develop with Couchbase appeared first on The Couchbase Blog.

Categories: Architecture, Database

Tip: Capturing Textboxes Available in a Google Authentification Page Using Selenium

Devx: Latest Published Articles - 18 hours 22 min ago
Learn how to retrieve a list of textboxes available in a Google authentication page.
Categories: Media

Capturing Textboxes Available in a Google Authentification Page Using Selenium

Devx: Latest Published Articles - 18 hours 23 min ago
Language: IDEs, Expertise: Intermediate - Learn how to retrieve a list of textboxes available in a Google authentication page.
Categories: Media

Infosys Harnessing 'Purposeful AI' to Aid Digital Transformations

eWeek - Application Development - 19 hours 30 min ago
The company's new artificial intelligence platform aims to bring intelligence and automation to complex business processes.
Categories: Media

Eclipse Newsletter - Language Server Protocol 101

Eclipse News - 20 hours 6 min ago
Everything you need to know about the Language Server Procotol (aka LSP) is in this month's newsletter!
Categories: Open Source